Unified · Split
| @@ -36,6 +36,7 @@ Andrew Morton <akpm@linux-foundation.org> · 35 unmodified lines | |||
| 36 | Andrew Murray <amurray@thegoodpenguin.co.uk> <amurray@embedded-bits.co.uk> | 36 | Andrew Murray <amurray@thegoodpenguin.co.uk> <amurray@embedded-bits.co.uk> |
| 37 | Andrew Murray <amurray@thegoodpenguin.co.uk> <andrew.murray@arm.com> | 37 | Andrew Murray <amurray@thegoodpenguin.co.uk> <andrew.murray@arm.com> |
| 38 | Andrew Vasquez <andrew.vasquez@qlogic.com> | 38 | Andrew Vasquez <andrew.vasquez@qlogic.com> |
| 39 | Andrey Konovalov <andreyknvl@gmail.com> <andreyknvl@google.com> | ||
| 39 | Andrey Ryabinin <ryabinin.a.a@gmail.com> <a.ryabinin@samsung.com> | 40 | Andrey Ryabinin <ryabinin.a.a@gmail.com> <a.ryabinin@samsung.com> |
| 40 | Andrey Ryabinin <ryabinin.a.a@gmail.com> <aryabinin@virtuozzo.com> | 41 | Andrey Ryabinin <ryabinin.a.a@gmail.com> <aryabinin@virtuozzo.com> |
| 41 | Andy Adamson <andros@citi.umich.edu> | 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 | Changbin Du <changbin.du@intel.com> <changbin.du@intel.com> | 66 | Changbin Du <changbin.du@intel.com> <changbin.du@intel.com> |
| 66 | Chao Yu <chao@kernel.org> <chao2.yu@samsung.com> | 67 | Chao Yu <chao@kernel.org> <chao2.yu@samsung.com> |
| 67 | Chao Yu <chao@kernel.org> <yuchao0@huawei.com> | 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 | Christophe Ricard <christophe.ricard@gmail.com> | 71 | Christophe Ricard <christophe.ricard@gmail.com> |
| 69 | Christoph Hellwig <hch@lst.de> | 72 | Christoph Hellwig <hch@lst.de> |
| 70 | Corey Minyard <minyard@acm.org> | 73 | Corey Minyard <minyard@acm.org> |
| @@ -165,6 +168,7 @@ Johan Hovold <johan@kernel.org> <jhovold@gmail.com> · 94 unmodified lines | |||
| 165 | Johan Hovold <johan@kernel.org> <johan@hovoldconsulting.com> | 168 | Johan Hovold <johan@kernel.org> <johan@hovoldconsulting.com> |
| 166 | John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> | 169 | John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> |
| 167 | John Stultz <johnstul@us.ibm.com> | 170 | John Stultz <johnstul@us.ibm.com> |
| 171 | Jordan Crouse <jordan@cosmicpenguin.net> <jcrouse@codeaurora.org> | ||
| 168 | <josh@joshtriplett.org> <josh@freedesktop.org> | 172 | <josh@joshtriplett.org> <josh@freedesktop.org> |
| 169 | <josh@joshtriplett.org> <josh@kernel.org> | 173 | <josh@joshtriplett.org> <josh@kernel.org> |
| 170 | <josh@joshtriplett.org> <josht@linux.vnet.ibm.com> | 174 | <josh@joshtriplett.org> <josht@linux.vnet.ibm.com> |
| @@ -250,8 +254,14 @@ Morten Welinder <welinder@anemone.rentec.com> · 79 unmodified lines | |||
| 250 | Morten Welinder <welinder@darter.rentec.com> | 254 | Morten Welinder <welinder@darter.rentec.com> |
| 251 | Morten Welinder <welinder@troll.com> | 255 | Morten Welinder <welinder@troll.com> |
| 252 | Mythri P K <mythripk@ti.com> | 256 | Mythri P K <mythripk@ti.com> |
| 257 | Nadia Yvette Chambers <nyc@holomorphy.com> William Lee Irwin III <wli@holomorphy.com> | ||
| 253 | Nathan Chancellor <nathan@kernel.org> <natechancellor@gmail.com> | 258 | Nathan Chancellor <nathan@kernel.org> <natechancellor@gmail.com> |
| 254 | Nguyen Anh Quynh <aquynh@gmail.com> | 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 | Nicolas Ferre <nicolas.ferre@microchip.com> <nicolas.ferre@atmel.com> | 265 | Nicolas Ferre <nicolas.ferre@microchip.com> <nicolas.ferre@atmel.com> |
| 256 | Nicolas Pitre <nico@fluxnic.net> <nicolas.pitre@linaro.org> | 266 | Nicolas Pitre <nico@fluxnic.net> <nicolas.pitre@linaro.org> |
| 257 | Nicolas Pitre <nico@fluxnic.net> <nico@linaro.org> | 267 | Nicolas Pitre <nico@fluxnic.net> <nico@linaro.org> |
| @@ -1,7 +1,7 @@ | |||
| 1 | What: /sys/kernel/debug/moxtet/input | 1 | What: /sys/kernel/debug/moxtet/input |
| 2 | Date: March 2019 | 2 | Date: March 2019 |
| 3 | KernelVersion: 5.3 | 3 | KernelVersion: 5.3 |
| 4 | Contact: Marek Behún <marek.behun@nic.cz> | 4 | Contact: Marek Behún <kabel@kernel.org> |
| 5 | Description: (Read) Read input from the shift registers, in hexadecimal. | 5 | Description: (Read) Read input from the shift registers, in hexadecimal. |
| 6 | Returns N+1 bytes, where N is the number of Moxtet connected | 6 | Returns N+1 bytes, where N is the number of Moxtet connected |
| 7 | modules. The first byte is from the CPU board itself. | 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 | What: /sys/kernel/debug/moxtet/output | 19 | What: /sys/kernel/debug/moxtet/output |
| 20 | Date: March 2019 | 20 | Date: March 2019 |
| 21 | KernelVersion: 5.3 | 21 | KernelVersion: 5.3 |
| 22 | Contact: Marek Behún <marek.behun@nic.cz> | 22 | Contact: Marek Behún <kabel@kernel.org> |
| 23 | Description: (RW) Read last written value to the shift registers, in | 23 | Description: (RW) Read last written value to the shift registers, in |
| 24 | hexadecimal, or write values to the shift registers, also | 24 | hexadecimal, or write values to the shift registers, also |
| 25 | in hexadecimal. | 25 | in hexadecimal. |
| @@ -1,7 +1,7 @@ | |||
| 1 | What: /sys/kernel/debug/turris-mox-rwtm/do_sign | 1 | What: /sys/kernel/debug/turris-mox-rwtm/do_sign |
| 2 | Date: Jun 2020 | 2 | Date: Jun 2020 |
| 3 | KernelVersion: 5.8 | 3 | KernelVersion: 5.8 |
| 4 | Contact: Marek Behún <marek.behun@nic.cz> | 4 | Contact: Marek Behún <kabel@kernel.org> |
| 5 | Description: | 5 | Description: |
| 6 | 6 | ||
| 7 | ======= =========================================================== | 7 | ======= =========================================================== |
| @@ -1,17 +1,17 @@ | |||
| 1 | What: /sys/bus/moxtet/devices/moxtet-<name>.<addr>/module_description | 1 | What: /sys/bus/moxtet/devices/moxtet-<name>.<addr>/module_description |
| 2 | Date: March 2019 | 2 | Date: March 2019 |
| 3 | KernelVersion: 5.3 | 3 | KernelVersion: 5.3 |
| 4 | Contact: Marek Behún <marek.behun@nic.cz> | 4 | Contact: Marek Behún <kabel@kernel.org> |
| 5 | Description: (Read) Moxtet module description. Format: string | 5 | Description: (Read) Moxtet module description. Format: string |
| 6 | 6 | ||
| 7 | What: /sys/bus/moxtet/devices/moxtet-<name>.<addr>/module_id | 7 | What: /sys/bus/moxtet/devices/moxtet-<name>.<addr>/module_id |
| 8 | Date: March 2019 | 8 | Date: March 2019 |
| 9 | KernelVersion: 5.3 | 9 | KernelVersion: 5.3 |
| 10 | Contact: Marek Behún <marek.behun@nic.cz> | 10 | Contact: Marek Behún <kabel@kernel.org> |
| 11 | Description: (Read) Moxtet module ID. Format: %x | 11 | Description: (Read) Moxtet module ID. Format: %x |
| 12 | 12 | ||
| 13 | What: /sys/bus/moxtet/devices/moxtet-<name>.<addr>/module_name | 13 | What: /sys/bus/moxtet/devices/moxtet-<name>.<addr>/module_name |
| 14 | Date: March 2019 | 14 | Date: March 2019 |
| 15 | KernelVersion: 5.3 | 15 | KernelVersion: 5.3 |
| 16 | Contact: Marek Behún <marek.behun@nic.cz> | 16 | Contact: Marek Behún <kabel@kernel.org> |
| 17 | Description: (Read) Moxtet module name. Format: string | 17 | Description: (Read) Moxtet module name. Format: string |
| @@ -1,7 +1,7 @@ | |||
| 1 | What: /sys/class/leds/<led>/device/brightness | 1 | What: /sys/class/leds/<led>/device/brightness |
| 2 | Date: July 2020 | 2 | Date: July 2020 |
| 3 | KernelVersion: 5.9 | 3 | KernelVersion: 5.9 |
| 4 | Contact: Marek Behún <marek.behun@nic.cz> | 4 | Contact: Marek Behún <kabel@kernel.org> |
| 5 | Description: (RW) On the front panel of the Turris Omnia router there is also | 5 | Description: (RW) On the front panel of the Turris Omnia router there is also |
| 6 | a button which can be used to control the intensity of all the | 6 | a button which can be used to control the intensity of all the |
| 7 | LEDs at once, so that if they are too bright, user can dim them. | 7 | LEDs at once, so that if they are too bright, user can dim them. |
| @@ -1,21 +1,21 @@ | |||
| 1 | What: /sys/firmware/turris-mox-rwtm/board_version | 1 | What: /sys/firmware/turris-mox-rwtm/board_version |
| 2 | Date: August 2019 | 2 | Date: August 2019 |
| 3 | KernelVersion: 5.4 | 3 | KernelVersion: 5.4 |
| 4 | Contact: Marek Behún <marek.behun@nic.cz> | 4 | Contact: Marek Behún <kabel@kernel.org> |
| 5 | Description: (Read) Board version burned into eFuses of this Turris Mox board. | 5 | Description: (Read) Board version burned into eFuses of this Turris Mox board. |
| 6 | Format: %i | 6 | Format: %i |
| 7 | 7 | ||
| 8 | What: /sys/firmware/turris-mox-rwtm/mac_address* | 8 | What: /sys/firmware/turris-mox-rwtm/mac_address* |
| 9 | Date: August 2019 | 9 | Date: August 2019 |
| 10 | KernelVersion: 5.4 | 10 | KernelVersion: 5.4 |
| 11 | Contact: Marek Behún <marek.behun@nic.cz> | 11 | Contact: Marek Behún <kabel@kernel.org> |
| 12 | Description: (Read) MAC addresses burned into eFuses of this Turris Mox board. | 12 | Description: (Read) MAC addresses burned into eFuses of this Turris Mox board. |
| 13 | Format: %pM | 13 | Format: %pM |
| 14 | 14 | ||
| 15 | What: /sys/firmware/turris-mox-rwtm/pubkey | 15 | What: /sys/firmware/turris-mox-rwtm/pubkey |
| 16 | Date: August 2019 | 16 | Date: August 2019 |
| 17 | KernelVersion: 5.4 | 17 | KernelVersion: 5.4 |
| 18 | Contact: Marek Behún <marek.behun@nic.cz> | 18 | Contact: Marek Behún <kabel@kernel.org> |
| 19 | Description: (Read) ECDSA public key (in pubkey hex compressed form) computed | 19 | Description: (Read) ECDSA public key (in pubkey hex compressed form) computed |
| 20 | as pair to the ECDSA private key burned into eFuses of this | 20 | as pair to the ECDSA private key burned into eFuses of this |
| 21 | Turris Mox Board. | 21 | Turris Mox Board. |
| @@ -24,7 +24,7 @@ Description: (Read) ECDSA public key (in pubkey hex compressed form) computed · 2 unmodified lines | |||
| 24 | What: /sys/firmware/turris-mox-rwtm/ram_size | 24 | What: /sys/firmware/turris-mox-rwtm/ram_size |
| 25 | Date: August 2019 | 25 | Date: August 2019 |
| 26 | KernelVersion: 5.4 | 26 | KernelVersion: 5.4 |
| 27 | Contact: Marek Behún <marek.behun@nic.cz> | 27 | Contact: Marek Behún <kabel@kernel.org> |
| 28 | Description: (Read) RAM size in MiB of this Turris Mox board as was detected | 28 | Description: (Read) RAM size in MiB of this Turris Mox board as was detected |
| 29 | during manufacturing and burned into eFuses. Can be 512 or 1024. | 29 | during manufacturing and burned into eFuses. Can be 512 or 1024. |
| 30 | Format: %i | 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 | What: /sys/firmware/turris-mox-rwtm/serial_number | 32 | What: /sys/firmware/turris-mox-rwtm/serial_number |
| 33 | Date: August 2019 | 33 | Date: August 2019 |
| 34 | KernelVersion: 5.4 | 34 | KernelVersion: 5.4 |
| 35 | Contact: Marek Behún <marek.behun@nic.cz> | 35 | Contact: Marek Behún <kabel@kernel.org> |
| 36 | Description: (Read) Serial number burned into eFuses of this Turris Mox device. | 36 | Description: (Read) Serial number burned into eFuses of this Turris Mox device. |
| 37 | Format: %016X | 37 | Format: %016X |
| @@ -33,7 +33,7 @@ Contact: xfs@oss.sgi.com · 32 unmodified lines | |||
| 33 | Description: | 33 | Description: |
| 34 | The current state of the log write grant head. It | 34 | The current state of the log write grant head. It |
| 35 | represents the total log reservation of all currently | 35 | represents the total log reservation of all currently |
| 36 | oustanding transactions, including regrants due to | 36 | outstanding transactions, including regrants due to |
| 37 | rolling transactions. The grant head is exported in | 37 | rolling transactions. The grant head is exported in |
| 38 | "cycle:bytes" format. | 38 | "cycle:bytes" format. |
| 39 | Users: xfstests | 39 | Users: xfstests |
| @@ -17,12 +17,12 @@ For ACPI on arm64, tables also fall into the following categories: · 16 unmodified lines | |||
| 17 | 17 | ||
| 18 | - Recommended: BERT, EINJ, ERST, HEST, PCCT, SSDT | 18 | - Recommended: BERT, EINJ, ERST, HEST, PCCT, SSDT |
| 19 | 19 | ||
| 20 | - Optional: BGRT, CPEP, CSRT, DBG2, DRTM, ECDT, FACS, FPDT, IORT, | 20 | - Optional: BGRT, CPEP, CSRT, DBG2, DRTM, ECDT, FACS, FPDT, IBFT, |
| 21 | MCHI, MPST, MSCT, NFIT, PMTT, RASF, SBST, SLIT, SPMI, SRAT, STAO, | 21 | IORT, MCHI, MPST, MSCT, NFIT, PMTT, RASF, SBST, SLIT, SPMI, SRAT, |
| 22 | TCPA, TPM2, UEFI, XENV | 22 | STAO, TCPA, TPM2, UEFI, XENV |
| 23 | 23 | ||
| 24 | - Not supported: BOOT, DBGP, DMAR, ETDT, HPET, IBFT, IVRS, LPIT, | 24 | - Not supported: BOOT, DBGP, DMAR, ETDT, HPET, IVRS, LPIT, MSDM, OEMx, |
| 25 | MSDM, OEMx, PSDT, RSDT, SLIC, WAET, WDAT, WDRT, WPBT | 25 | PSDT, RSDT, SLIC, WAET, WDAT, WDRT, WPBT |
| 26 | 26 | ||
| 27 | ====== ======================================================================== | 27 | ====== ======================================================================== |
| 28 | Table Usage for ARMv8 Linux | 28 | Table Usage for ARMv8 Linux |
| @@ -130,6 +130,9 @@ stable kernels. · 129 unmodified lines | |||
| 130 | | Marvell | ARM-MMU-500 | #582743 | N/A | | 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 | | Freescale/NXP | LS2080A/LS1043A | A-008585 | FSL_ERRATUM_A008585 | | 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 | - "#thermal-sensor-cells" Used to expose itself to thermal fw. | 32 | - "#thermal-sensor-cells" Used to expose itself to thermal fw. |
| 33 | 33 | ||
| 34 | Read more about iio bindings at | 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 | Example: | 37 | Example: |
| 38 | ncp15wb473@0 { | 38 | ncp15wb473@0 { |
| @@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# · 6 unmodified lines | |||
| 7 | title: Bindings for GPIO bitbanged I2C | 7 | title: Bindings for GPIO bitbanged I2C |
| 8 | 8 | ||
| 9 | maintainers: | 9 | maintainers: |
| 10 | - Wolfram Sang <wolfram@the-dreams.de> | 10 | - Wolfram Sang <wsa@kernel.org> |
| 11 | 11 | ||
| 12 | allOf: | 12 | allOf: |
| 13 | - $ref: /schemas/i2c/i2c-controller.yaml# | 13 | - $ref: /schemas/i2c/i2c-controller.yaml# |
| @@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# · 6 unmodified lines | |||
| 7 | title: Freescale Inter IC (I2C) and High Speed Inter IC (HS-I2C) for i.MX | 7 | title: Freescale Inter IC (I2C) and High Speed Inter IC (HS-I2C) for i.MX |
| 8 | 8 | ||
| 9 | maintainers: | 9 | maintainers: |
| 10 | - Wolfram Sang <wolfram@the-dreams.de> | 10 | - Oleksij Rempel <o.rempel@pengutronix.de> |
| 11 | 11 | ||
| 12 | allOf: | 12 | allOf: |
| 13 | - $ref: /schemas/i2c/i2c-controller.yaml# | 13 | - $ref: /schemas/i2c/i2c-controller.yaml# |
| @@ -14,8 +14,9 @@ description: > · 13 unmodified lines | |||
| 14 | Industrial I/O subsystem bindings for ADC controller found in | 14 | Industrial I/O subsystem bindings for ADC controller found in |
| 15 | Ingenic JZ47xx SoCs. | 15 | Ingenic JZ47xx SoCs. |
| 16 | 16 | ||
| 17 | ADC clients must use the format described in iio-bindings.txt, giving | 17 | ADC clients must use the format described in |
| 18 | a phandle and IIO specifier pair ("io-channels") to the ADC controller. | 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 | properties: | 21 | properties: |
| 21 | compatible: | 22 | compatible: |
| @@ -24,7 +24,9 @@ properties: · 23 unmodified lines | |||
| 24 | description: > | 24 | description: > |
| 25 | List of phandle and IIO specifier pairs. | 25 | List of phandle and IIO specifier pairs. |
| 26 | Each pair defines one ADC channel to which a joystick axis is connected. | 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 | '#address-cells': | 31 | '#address-cells': |
| 30 | const: 1 | 32 | const: 1 |
| @@ -5,7 +5,10 @@ Required properties: · 4 unmodified lines | |||
| 5 | - compatible: must be "resistive-adc-touch" | 5 | - compatible: must be "resistive-adc-touch" |
| 6 | The device must be connected to an ADC device that provides channels for | 6 | The device must be connected to an ADC device that provides channels for |
| 7 | position measurement and optional pressure. | 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 | - iio-channels: must have at least two channels connected to an ADC device. | 12 | - iio-channels: must have at least two channels connected to an ADC device. |
| 10 | These should correspond to the channels exposed by the ADC device and should | 13 | These should correspond to the channels exposed by the ADC device and should |
| 11 | have the right index as the ADC device registers them. These channels | 14 | have the right index as the ADC device registers them. These channels |
| @@ -23,6 +23,7 @@ properties: · 22 unmodified lines | |||
| 23 | - enum: | 23 | - enum: |
| 24 | - ingenic,jz4775-intc | 24 | - ingenic,jz4775-intc |
| 25 | - ingenic,jz4770-intc | 25 | - ingenic,jz4770-intc |
| 26 | - ingenic,jz4760b-intc | ||
| 26 | - const: ingenic,jz4760-intc | 27 | - const: ingenic,jz4760-intc |
| 27 | - items: | 28 | - items: |
| 28 | - const: ingenic,x1000-intc | 29 | - const: ingenic,x1000-intc |
| @@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# · 6 unmodified lines | |||
| 7 | title: CZ.NIC's Turris Omnia LEDs driver | 7 | title: CZ.NIC's Turris Omnia LEDs driver |
| 8 | 8 | ||
| 9 | maintainers: | 9 | maintainers: |
| 10 | - Marek Behún <marek.behun@nic.cz> | 10 | - Marek Behún <kabel@kernel.org> |
| 11 | 11 | ||
| 12 | description: | 12 | description: |
| 13 | This module adds support for the RGB LEDs found on the front panel of the | 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 | pwm|regulator|rtc|sysctrl|usb]"; | 72 | pwm|regulator|rtc|sysctrl|usb]"; |
| 73 | 73 | ||
| 74 | A few child devices require ADC channels from the GPADC node. Those follow the | 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 | abx500-temp : io-channels "aux1" and "aux2" for measuring external | 79 | abx500-temp : io-channels "aux1" and "aux2" for measuring external |
| 78 | temperatures. | 80 | temperatures. |
| @@ -16,14 +16,14 @@ Optional subnodes: · 15 unmodified lines | |||
| 16 | The sub-functions of CPCAP get their own node with their own compatible values, | 16 | The sub-functions of CPCAP get their own node with their own compatible values, |
| 17 | which are described in the following files: | 17 | which are described in the following files: |
| 18 | 18 | ||
| 19 | - ../power/supply/cpcap-battery.txt | 19 | - Documentation/devicetree/bindings/power/supply/cpcap-battery.txt |
| 20 | - ../power/supply/cpcap-charger.txt | 20 | - Documentation/devicetree/bindings/power/supply/cpcap-charger.txt |
| 21 | - ../regulator/cpcap-regulator.txt | 21 | - Documentation/devicetree/bindings/regulator/cpcap-regulator.txt |
| 22 | - ../phy/phy-cpcap-usb.txt | 22 | - Documentation/devicetree/bindings/phy/phy-cpcap-usb.txt |
| 23 | - ../input/cpcap-pwrbutton.txt | 23 | - Documentation/devicetree/bindings/input/cpcap-pwrbutton.txt |
| 24 | - ../rtc/cpcap-rtc.txt | 24 | - Documentation/devicetree/bindings/rtc/cpcap-rtc.txt |
| 25 | - ../leds/leds-cpcap.txt | 25 | - Documentation/devicetree/bindings/leds/leds-cpcap.txt |
| 26 | - ../iio/adc/cpcap-adc.txt | 26 | - Documentation/devicetree/bindings/iio/adc/motorola,cpcap-adc.yaml |
| 27 | 27 | ||
| 28 | The only exception is the audio codec. Instead of a compatible value its | 28 | The only exception is the audio codec. Instead of a compatible value its |
| 29 | node must be named "audio-codec". | 29 | node must be named "audio-codec". |
| @@ -32,7 +32,7 @@ required: · 31 unmodified lines | |||
| 32 | - interrupts | 32 | - interrupts |
| 33 | - interrupt-names | 33 | - interrupt-names |
| 34 | 34 | ||
| 35 | additionalProperties: false | 35 | unevaluatedProperties: false |
| 36 | 36 | ||
| 37 | examples: | 37 | examples: |
| 38 | - | | 38 | - | |
| @@ -49,7 +49,7 @@ properties: · 48 unmodified lines | |||
| 49 | description: | 49 | description: |
| 50 | Reference to an nvmem node for the MAC address | 50 | Reference to an nvmem node for the MAC address |
| 51 | 51 | ||
| 52 | nvmem-cells-names: | 52 | nvmem-cell-names: |
| 53 | const: mac-address | 53 | const: mac-address |
| 54 | 54 | ||
| 55 | phy-connection-type: | 55 | phy-connection-type: |
| @@ -65,6 +65,71 @@ KSZ9031: · 64 unmodified lines | |||
| 65 | step is 60ps. The default value is the neutral setting, so setting | 65 | step is 60ps. The default value is the neutral setting, so setting |
| 66 | rxc-skew-ps=<0> actually results in -900 picoseconds adjustment. | 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 | Optional properties: | 133 | Optional properties: |
| 69 | 134 | ||
| 70 | Maximum value of 1860, default value 900: | 135 | Maximum value of 1860, default value 900: |
| @@ -120,11 +185,21 @@ KSZ9131: · 49 unmodified lines | |||
| 120 | 185 | ||
| 121 | Examples: | 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 | mdio { | 198 | mdio { |
| 124 | phy0: ethernet-phy@0 { | 199 | phy0: ethernet-phy@0 { |
| 125 | rxc-skew-ps = <3000>; | 200 | rxc-skew-ps = <1800>; |
| 126 | rxdv-skew-ps = <0>; | 201 | rxdv-skew-ps = <0>; |
| 127 | txc-skew-ps = <3000>; | 202 | txc-skew-ps = <1800>; |
| 128 | txen-skew-ps = <0>; | 203 | txen-skew-ps = <0>; |
| 129 | reg = <0>; | 204 | reg = <0>; |
| 130 | }; | 205 | }; |
| @@ -133,3 +208,20 @@ Examples: · 2 unmodified lines | |||
| 133 | phy = <&phy0>; | 208 | phy = <&phy0>; |
| 134 | phy-mode = "rgmii-id"; | 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 | - fsl,vf610-spdif | 21 | - fsl,vf610-spdif |
| 22 | - fsl,imx6sx-spdif | 22 | - fsl,imx6sx-spdif |
| 23 | - fsl,imx8qm-spdif | 23 | - fsl,imx8qm-spdif |
| 24 | - fsl,imx8qxp-spdif | ||
| 25 | - fsl,imx8mq-spdif | ||
| 26 | - fsl,imx8mm-spdif | ||
| 27 | - fsl,imx8mn-spdif | ||
| 24 | 28 | ||
| 25 | reg: | 29 | reg: |
| 26 | maxItems: 1 | 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 | Level: Intermediate | 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 | Better Testing | 637 | Better Testing |
| 617 | ============== | 638 | ============== |
| 618 | 639 | ||
| @@ -1988,7 +1988,7 @@ netif_carrier. · 1987 unmodified lines | |||
| 1988 | If use_carrier is 0, then the MII monitor will first query the | 1988 | If use_carrier is 0, then the MII monitor will first query the |
| 1989 | device's (via ioctl) MII registers and check the link state. If that | 1989 | device's (via ioctl) MII registers and check the link state. If that |
| 1990 | request fails (not just that it returns carrier down), then the MII | 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 | the same information. If both methods fail (i.e., the driver either | 1992 | the same information. If both methods fail (i.e., the driver either |
| 1993 | does not support or had some error in processing both the MII register | 1993 | does not support or had some error in processing both the MII register |
| 1994 | and ethtool requests), then the MII monitor will assume the link is | 1994 | and ethtool requests), then the MII monitor will assume the link is |
| @@ -267,7 +267,7 @@ DATA PATH · 266 unmodified lines | |||
| 267 | Tx | 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 | - Maps data buffers (skb->data and frags). | 272 | - Maps data buffers (skb->data and frags). |
| 273 | - Populates ena_buf for the push buffer (if the driver and device are | 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 | ``devlink-dpipe`` should change according to the changes done by the | 52 | ``devlink-dpipe`` should change according to the changes done by the |
| 53 | standard configuration tools. | 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 | using Ternary Content Addressable Memory (TCAM). The TCAM memory can be | 56 | using Ternary Content Addressable Memory (TCAM). The TCAM memory can be |
| 57 | divided into TCAM regions. Complex TC filters can have multiple rules with | 57 | divided into TCAM regions. Complex TC filters can have multiple rules with |
| 58 | different priorities and different lookup keys. On the other hand hardware | 58 | different priorities and different lookup keys. On the other hand hardware |
| @@ -151,7 +151,7 @@ representor netdevice. · 150 unmodified lines | |||
| 151 | ------------- | 151 | ------------- |
| 152 | A subfunction devlink port is created but it is not active yet. That means the | 152 | A subfunction devlink port is created but it is not active yet. That means the |
| 153 | entities are created on devlink side, the e-switch port representor is created, | 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 | representor to do settings, putting it into bridge, adding TC rules, etc. A user | 155 | representor to do settings, putting it into bridge, adding TC rules, etc. A user |
| 156 | might as well configure the hardware address (such as MAC address) of the | 156 | might as well configure the hardware address (such as MAC address) of the |
| 157 | subfunction while subfunction is inactive. | 157 | subfunction while subfunction is inactive. |
| @@ -173,7 +173,7 @@ Terms and Definitions · 15 unmodified lines | |||
| 173 | * - Term | 173 | * - Term |
| 174 | - Definitions | 174 | - Definitions |
| 175 | * - ``PCI device`` | 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 | more PCI controllers. | 177 | more PCI controllers. |
| 178 | * - ``PCI controller`` | 178 | * - ``PCI controller`` |
| 179 | - A controller consists of potentially multiple physical functions, | 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 | PAUSE_GET | 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 | Request contents: | 983 | Request contents: |
| 984 | 984 | ||
| @@ -1007,7 +1007,7 @@ the statistics in the following structure: · 22 unmodified lines | |||
| 1007 | Each member has a corresponding attribute defined. | 1007 | Each member has a corresponding attribute defined. |
| 1008 | 1008 | ||
| 1009 | PAUSE_SET | 1009 | PAUSE_SET |
| 1010 | ============ | 1010 | ========= |
| 1011 | 1011 | ||
| 1012 | Sets pause parameters like ``ETHTOOL_GPAUSEPARAM`` ioctl request. | 1012 | Sets pause parameters like ``ETHTOOL_GPAUSEPARAM`` ioctl request. |
| 1013 | 1013 | ||
| @@ -1024,7 +1024,7 @@ Request contents: · 10 unmodified lines | |||
| 1024 | EEE_GET | 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 | Request contents: | 1029 | Request contents: |
| 1030 | 1030 | ||
| @@ -1054,7 +1054,7 @@ first 32 are provided by the ``ethtool_ops`` callback. · 23 unmodified lines | |||
| 1054 | EEE_SET | 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 | Request contents: | 1059 | Request contents: |
| 1060 | 1060 | ||
| @@ -1849,21 +1849,6 @@ ip6frag_low_thresh - INTEGER · 1848 unmodified lines | |||
| 1849 | ip6frag_time - INTEGER | 1849 | ip6frag_time - INTEGER |
| 1850 | Time in seconds to keep an IPv6 fragment in memory. | 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 | ``conf/default/*``: | 1852 | ``conf/default/*``: |
| 1868 | Change the interface-specific default settings. | 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 | the patches the way they would look like if your latest patch series was to be | 142 | the patches the way they would look like if your latest patch series was to be |
| 143 | merged. | 143 | merged. |
| 144 | 144 | ||
| 145 | How can I tell what patches are queued up for backporting to the various stable releases? | 145 | Are there special rules regarding stable submissions on netdev? |
| 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? | ||
| 205 | --------------------------------------------------------------- | 146 | --------------------------------------------------------------- |
| 206 | Due to capacity, Dave could only take care of the backports for the | 147 | While it used to be the case that netdev submissions were not supposed |
| 207 | last two stable releases. For earlier stable releases, each stable | 148 | to carry explicit ``CC: stable@vger.kernel.org`` tags that is no longer |
| 208 | branch maintainer is supposed to take care of them. If you find any | 149 | the case today. Please follow the standard stable rules in |
| 209 | patch is missing from an earlier stable branch, please notify | 150 | :ref:`Documentation/process/stable-kernel-rules.rst <stable_kernel_rules>`, |
| 210 | stable@vger.kernel.org with either a commit ID or a formal patch | 151 | and make sure you include appropriate Fixes tags! |
| 211 | backported, and CC Dave and other relevant networking developers. | ||
| 212 | 152 | ||
| 213 | Is the comment style convention different for the networking content? | 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 | * 1 - Drop SR packets without HMAC, validate SR packets with HMAC | 24 | * 1 - Drop SR packets without HMAC, validate SR packets with HMAC |
| 25 | 25 | ||
| 26 | Default is 0. | 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 | The NIC driver offering ipsec offload will need to implement these | 51 | The NIC driver offering ipsec offload will need to implement these |
| 52 | callbacks to make the offload available to the network stack's | 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 | NETIF_F_HW_ESP_TX_CSUM will signal the availability of the offload. | 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 | Procedure for submitting patches to the -stable tree | 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 | - Security patches should not be handled (solely) by the -stable review | 38 | - Security patches should not be handled (solely) by the -stable review |
| 45 | process but should follow the procedures in | 39 | process but should follow the procedures in |
| 46 | :ref:`Documentation/admin-guide/security-bugs.rst <securitybugs>`. | 40 | :ref:`Documentation/admin-guide/security-bugs.rst <securitybugs>`. |
| @@ -250,11 +250,6 @@ should also read · 249 unmodified lines | |||
| 250 | :ref:`Documentation/process/stable-kernel-rules.rst <stable_kernel_rules>` | 250 | :ref:`Documentation/process/stable-kernel-rules.rst <stable_kernel_rules>` |
| 251 | in addition to this file. | 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 | If changes affect userland-kernel interfaces, please send the MAN-PAGES | 253 | If changes affect userland-kernel interfaces, please send the MAN-PAGES |
| 259 | maintainer (as listed in the MAINTAINERS file) a man-pages patch, or at | 254 | maintainer (as listed in the MAINTAINERS file) a man-pages patch, or at |
| 260 | least a notification of the change, so that some information makes its way | 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 | be retrieved using KVM_CAP_ARM_VM_IPA_SIZE of the KVM_CHECK_EXTENSION | 182 | be retrieved using KVM_CAP_ARM_VM_IPA_SIZE of the KVM_CHECK_EXTENSION |
| 183 | ioctl() at run-time. | 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 | Please note that configuring the IPA size does not affect the capability | 188 | Please note that configuring the IPA size does not affect the capability |
| 186 | exposed by the guest CPUs in ID_AA64MMFR0_EL1[PARange]. It only affects | 189 | exposed by the guest CPUs in ID_AA64MMFR0_EL1[PARange]. It only affects |
| 187 | size of the address translated by the stage2 level (guest physical to | 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 | Define which vcpu is the Bootstrap Processor (BSP). Values are the same | 1496 | Define which vcpu is the Bootstrap Processor (BSP). Values are the same |
| 1494 | as the vcpu id in KVM_CREATE_VCPU. If this ioctl is not called, the default | 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 | 4.42 KVM_GET_XSAVE | 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 | allows user space to deflect and potentially handle various MSR accesses | 4807 | allows user space to deflect and potentially handle various MSR accesses |
| 4804 | into user space. | 4808 | into user space. |
| 4805 | 4809 | ||
| 4806 | If a vCPU is in running state while this ioctl is invoked, the vCPU may | 4810 | Note, invoking this ioctl with a vCPU is running is inherently racy. However, |
| 4807 | experience inconsistent filtering behavior on MSR accesses. | 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 | 4.127 KVM_XEN_HVM_SET_ATTR | 4815 | 4.127 KVM_XEN_HVM_SET_ATTR |
| 4810 | -------------------------- | 4816 | -------------------------- |
| @@ -261,8 +261,8 @@ ABI/API · 260 unmodified lines | |||
| 261 | L: linux-api@vger.kernel.org | 261 | L: linux-api@vger.kernel.org |
| 262 | F: include/linux/syscalls.h | 262 | F: include/linux/syscalls.h |
| 263 | F: kernel/sys_ni.c | 263 | F: kernel/sys_ni.c |
| 264 | F: include/uapi/ | 264 | X: include/uapi/ |
| 265 | F: arch/*/include/uapi/ | 265 | X: arch/*/include/uapi/ |
| 266 | 266 | ||
| 267 | ABIT UGURU 1,2 HARDWARE MONITOR DRIVER | 267 | ABIT UGURU 1,2 HARDWARE MONITOR DRIVER |
| 268 | M: Hans de Goede <hdegoede@redhat.com> | 268 | M: Hans de Goede <hdegoede@redhat.com> |
| @@ -1181,7 +1181,7 @@ M: Joel Fernandes <joel@joelfernandes.org> · 912 unmodified lines | |||
| 1181 | M: Christian Brauner <christian@brauner.io> | 1181 | M: Christian Brauner <christian@brauner.io> |
| 1182 | M: Hridya Valsaraju <hridya@google.com> | 1182 | M: Hridya Valsaraju <hridya@google.com> |
| 1183 | M: Suren Baghdasaryan <surenb@google.com> | 1183 | M: Suren Baghdasaryan <surenb@google.com> |
| 1184 | L: devel@driverdev.osuosl.org | 1184 | L: linux-kernel@vger.kernel.org |
| 1185 | S: Supported | 1185 | S: Supported |
| 1186 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git | 1186 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git |
| 1187 | F: drivers/android/ | 1187 | F: drivers/android/ |
| @@ -1576,11 +1576,13 @@ R: Jernej Skrabec <jernej.skrabec@siol.net> · 388 unmodified lines | |||
| 1576 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) | 1576 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) |
| 1577 | S: Maintained | 1577 | S: Maintained |
| 1578 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux.git | 1578 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux.git |
| 1579 | L: linux-sunxi@lists.linux.dev | ||
| 1579 | F: arch/arm/mach-sunxi/ | 1580 | F: arch/arm/mach-sunxi/ |
| 1580 | F: arch/arm64/boot/dts/allwinner/ | 1581 | F: arch/arm64/boot/dts/allwinner/ |
| 1581 | F: drivers/clk/sunxi-ng/ | 1582 | F: drivers/clk/sunxi-ng/ |
| 1582 | F: drivers/pinctrl/sunxi/ | 1583 | F: drivers/pinctrl/sunxi/ |
| 1583 | F: drivers/soc/sunxi/ | 1584 | F: drivers/soc/sunxi/ |
| 1585 | N: allwinner | ||
| 1584 | N: sun[x456789]i | 1586 | N: sun[x456789]i |
| 1585 | N: sun50i | 1587 | N: sun50i |
| 1586 | 1588 | ||
| @@ -1790,19 +1792,26 @@ F: drivers/net/ethernet/cortina/ · 203 unmodified lines | |||
| 1790 | F: drivers/pinctrl/pinctrl-gemini.c | 1792 | F: drivers/pinctrl/pinctrl-gemini.c |
| 1791 | F: drivers/rtc/rtc-ftrtc010.c | 1793 | F: drivers/rtc/rtc-ftrtc010.c |
| 1792 | 1794 | ||
| 1793 | ARM/CZ.NIC TURRIS MOX SUPPORT | 1795 | ARM/CZ.NIC TURRIS SUPPORT |
| 1794 | M: Marek Behun <marek.behun@nic.cz> | 1796 | M: Marek Behun <kabel@kernel.org> |
| 1795 | S: Maintained | 1797 | S: Maintained |
| 1796 | W: http://mox.turris.cz | 1798 | W: https://www.turris.cz/ |
| 1797 | F: Documentation/ABI/testing/debugfs-moxtet | 1799 | F: Documentation/ABI/testing/debugfs-moxtet |
| 1798 | F: Documentation/ABI/testing/sysfs-bus-moxtet-devices | 1800 | F: Documentation/ABI/testing/sysfs-bus-moxtet-devices |
| 1799 | F: Documentation/ABI/testing/sysfs-firmware-turris-mox-rwtm | 1801 | F: Documentation/ABI/testing/sysfs-firmware-turris-mox-rwtm |
| 1800 | F: Documentation/devicetree/bindings/bus/moxtet.txt | 1802 | F: Documentation/devicetree/bindings/bus/moxtet.txt |
| 1801 | F: Documentation/devicetree/bindings/firmware/cznic,turris-mox-rwtm.txt | 1803 | F: Documentation/devicetree/bindings/firmware/cznic,turris-mox-rwtm.txt |
| 1802 | F: Documentation/devicetree/bindings/gpio/gpio-moxtet.txt | 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 | F: drivers/bus/moxtet.c | 1807 | F: drivers/bus/moxtet.c |
| 1804 | F: drivers/firmware/turris-mox-rwtm.c | 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 | F: drivers/gpio/gpio-moxtet.c | 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 | F: include/linux/moxtet.h | 1815 | F: include/linux/moxtet.h |
| 1807 | 1816 | ||
| 1808 | ARM/EZX SMARTPHONES (A780, A910, A1200, E680, ROKR E2 and ROKR E6) | 1817 | ARM/EZX SMARTPHONES (A780, A910, A1200, E680, ROKR E2 and ROKR E6) |
| @@ -2489,7 +2498,7 @@ N: sc27xx · 680 unmodified lines | |||
| 2489 | N: sc2731 | 2498 | N: sc2731 |
| 2490 | 2499 | ||
| 2491 | ARM/STI ARCHITECTURE | 2500 | ARM/STI ARCHITECTURE |
| 2492 | M: Patrice Chotard <patrice.chotard@st.com> | 2501 | M: Patrice Chotard <patrice.chotard@foss.st.com> |
| 2493 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) | 2502 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) |
| 2494 | S: Maintained | 2503 | S: Maintained |
| 2495 | W: http://www.stlinux.com | 2504 | W: http://www.stlinux.com |
| @@ -2522,7 +2531,7 @@ F: include/linux/remoteproc/st_slim_rproc.h · 26 unmodified lines | |||
| 2522 | 2531 | ||
| 2523 | ARM/STM32 ARCHITECTURE | 2532 | ARM/STM32 ARCHITECTURE |
| 2524 | M: Maxime Coquelin <mcoquelin.stm32@gmail.com> | 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 | L: linux-stm32@st-md-mailman.stormreply.com (moderated for non-subscribers) | 2535 | L: linux-stm32@st-md-mailman.stormreply.com (moderated for non-subscribers) |
| 2527 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) | 2536 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) |
| 2528 | S: Maintained | 2537 | S: Maintained |
| @@ -3115,7 +3124,7 @@ C: irc://irc.oftc.net/bcache · 586 unmodified lines | |||
| 3115 | F: drivers/md/bcache/ | 3124 | F: drivers/md/bcache/ |
| 3116 | 3125 | ||
| 3117 | BDISP ST MEDIA DRIVER | 3126 | BDISP ST MEDIA DRIVER |
| 3118 | M: Fabien Dessenne <fabien.dessenne@st.com> | 3127 | M: Fabien Dessenne <fabien.dessenne@foss.st.com> |
| 3119 | L: linux-media@vger.kernel.org | 3128 | L: linux-media@vger.kernel.org |
| 3120 | S: Supported | 3129 | S: Supported |
| 3121 | W: https://linuxtv.org | 3130 | W: https://linuxtv.org |
| @@ -3675,7 +3684,7 @@ M: bcm-kernel-feedback-list@broadcom.com · 553 unmodified lines | |||
| 3675 | L: linux-pm@vger.kernel.org | 3684 | L: linux-pm@vger.kernel.org |
| 3676 | S: Maintained | 3685 | S: Maintained |
| 3677 | T: git git://github.com/broadcom/stblinux.git | 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 | F: include/dt-bindings/soc/bcm-pmb.h | 3688 | F: include/dt-bindings/soc/bcm-pmb.h |
| 3680 | 3689 | ||
| 3681 | BROADCOM SPECIFIC AMBA DRIVER (BCMA) | 3690 | BROADCOM SPECIFIC AMBA DRIVER (BCMA) |
| @@ -5080,7 +5089,7 @@ S: Maintained · 1398 unmodified lines | |||
| 5080 | F: drivers/platform/x86/dell/dell-wmi.c | 5089 | F: drivers/platform/x86/dell/dell-wmi.c |
| 5081 | 5090 | ||
| 5082 | DELTA ST MEDIA DRIVER | 5091 | DELTA ST MEDIA DRIVER |
| 5083 | M: Hugues Fruchet <hugues.fruchet@st.com> | 5092 | M: Hugues Fruchet <hugues.fruchet@foss.st.com> |
| 5084 | L: linux-media@vger.kernel.org | 5093 | L: linux-media@vger.kernel.org |
| 5085 | S: Supported | 5094 | S: Supported |
| 5086 | W: https://linuxtv.org | 5095 | W: https://linuxtv.org |
| @@ -5835,7 +5844,7 @@ M: David Airlie <airlied@linux.ie> · 748 unmodified lines | |||
| 5835 | M: Daniel Vetter <daniel@ffwll.ch> | 5844 | M: Daniel Vetter <daniel@ffwll.ch> |
| 5836 | L: dri-devel@lists.freedesktop.org | 5845 | L: dri-devel@lists.freedesktop.org |
| 5837 | S: Maintained | 5846 | S: Maintained |
| 5838 | B: https://bugs.freedesktop.org/ | 5847 | B: https://gitlab.freedesktop.org/drm |
| 5839 | C: irc://chat.freenode.net/dri-devel | 5848 | C: irc://chat.freenode.net/dri-devel |
| 5840 | T: git git://anongit.freedesktop.org/drm/drm | 5849 | T: git git://anongit.freedesktop.org/drm/drm |
| 5841 | F: Documentation/devicetree/bindings/display/ | 5850 | F: Documentation/devicetree/bindings/display/ |
| @@ -6006,7 +6015,6 @@ F: drivers/gpu/drm/rockchip/ · 164 unmodified lines | |||
| 6006 | 6015 | ||
| 6007 | DRM DRIVERS FOR STI | 6016 | DRM DRIVERS FOR STI |
| 6008 | M: Benjamin Gaignard <benjamin.gaignard@linaro.org> | 6017 | M: Benjamin Gaignard <benjamin.gaignard@linaro.org> |
| 6009 | M: Vincent Abriou <vincent.abriou@st.com> | ||
| 6010 | L: dri-devel@lists.freedesktop.org | 6018 | L: dri-devel@lists.freedesktop.org |
| 6011 | S: Maintained | 6019 | S: Maintained |
| 6012 | T: git git://anongit.freedesktop.org/drm/drm-misc | 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 | F: drivers/gpu/drm/sti | 6022 | F: drivers/gpu/drm/sti |
| 6015 | 6023 | ||
| 6016 | DRM DRIVERS FOR STM | 6024 | DRM DRIVERS FOR STM |
| 6017 | M: Yannick Fertre <yannick.fertre@st.com> | 6025 | M: Yannick Fertre <yannick.fertre@foss.st.com> |
| 6018 | M: Philippe Cornu <philippe.cornu@st.com> | 6026 | M: Philippe Cornu <philippe.cornu@foss.st.com> |
| 6019 | M: Benjamin Gaignard <benjamin.gaignard@linaro.org> | 6027 | M: Benjamin Gaignard <benjamin.gaignard@linaro.org> |
| 6020 | M: Vincent Abriou <vincent.abriou@st.com> | ||
| 6021 | L: dri-devel@lists.freedesktop.org | 6028 | L: dri-devel@lists.freedesktop.org |
| 6022 | S: Maintained | 6029 | S: Maintained |
| 6023 | T: git git://anongit.freedesktop.org/drm/drm-misc | 6030 | T: git git://anongit.freedesktop.org/drm/drm-misc |
| @@ -7091,7 +7098,7 @@ S: Maintained · 1067 unmodified lines | |||
| 7091 | F: drivers/i2c/busses/i2c-cpm.c | 7098 | F: drivers/i2c/busses/i2c-cpm.c |
| 7092 | 7099 | ||
| 7093 | FREESCALE IMX / MXC FEC DRIVER | 7100 | FREESCALE IMX / MXC FEC DRIVER |
| 7094 | M: Fugang Duan <fugang.duan@nxp.com> | 7101 | M: Joakim Zhang <qiangqing.zhang@nxp.com> |
| 7095 | L: netdev@vger.kernel.org | 7102 | L: netdev@vger.kernel.org |
| 7096 | S: Maintained | 7103 | S: Maintained |
| 7097 | F: Documentation/devicetree/bindings/net/fsl-fec.txt | 7104 | F: Documentation/devicetree/bindings/net/fsl-fec.txt |
| @@ -7476,8 +7483,9 @@ F: include/uapi/asm-generic/ · 378 unmodified lines | |||
| 7476 | GENERIC PHY FRAMEWORK | 7483 | GENERIC PHY FRAMEWORK |
| 7477 | M: Kishon Vijay Abraham I <kishon@ti.com> | 7484 | M: Kishon Vijay Abraham I <kishon@ti.com> |
| 7478 | M: Vinod Koul <vkoul@kernel.org> | 7485 | M: Vinod Koul <vkoul@kernel.org> |
| 7479 | L: linux-kernel@vger.kernel.org | 7486 | L: linux-phy@lists.infradead.org |
| 7480 | S: Supported | 7487 | S: Supported |
| 7488 | Q: https://patchwork.kernel.org/project/linux-phy/list/ | ||
| 7481 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy.git | 7489 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy.git |
| 7482 | F: Documentation/devicetree/bindings/phy/ | 7490 | F: Documentation/devicetree/bindings/phy/ |
| 7483 | F: drivers/phy/ | 7491 | F: drivers/phy/ |
| @@ -8116,7 +8124,6 @@ F: drivers/crypto/hisilicon/sec2/sec_main.c · 632 unmodified lines | |||
| 8116 | 8124 | ||
| 8117 | HISILICON STAGING DRIVERS FOR HIKEY 960/970 | 8125 | HISILICON STAGING DRIVERS FOR HIKEY 960/970 |
| 8118 | M: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 8126 | M: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> |
| 8119 | L: devel@driverdev.osuosl.org | ||
| 8120 | S: Maintained | 8127 | S: Maintained |
| 8121 | F: drivers/staging/hikey9xx/ | 8128 | F: drivers/staging/hikey9xx/ |
| 8122 | 8129 | ||
| @@ -8231,7 +8238,7 @@ F: include/linux/hugetlb.h · 108 unmodified lines | |||
| 8231 | F: mm/hugetlb.c | 8238 | F: mm/hugetlb.c |
| 8232 | 8239 | ||
| 8233 | HVA ST MEDIA DRIVER | 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 | L: linux-media@vger.kernel.org | 8242 | L: linux-media@vger.kernel.org |
| 8236 | S: Supported | 8243 | S: Supported |
| 8237 | W: https://linuxtv.org | 8244 | W: https://linuxtv.org |
| @@ -8519,8 +8526,9 @@ F: drivers/pci/hotplug/rpaphp* · 281 unmodified lines | |||
| 8519 | 8526 | ||
| 8520 | IBM Power SRIOV Virtual NIC Device Driver | 8527 | IBM Power SRIOV Virtual NIC Device Driver |
| 8521 | M: Dany Madden <drt@linux.ibm.com> | 8528 | M: Dany Madden <drt@linux.ibm.com> |
| 8522 | M: Lijun Pan <ljp@linux.ibm.com> | ||
| 8523 | M: Sukadev Bhattiprolu <sukadev@linux.ibm.com> | 8529 | M: Sukadev Bhattiprolu <sukadev@linux.ibm.com> |
| 8530 | R: Thomas Falcon <tlfalcon@linux.ibm.com> | ||
| 8531 | R: Lijun Pan <lijunp213@gmail.com> | ||
| 8524 | L: netdev@vger.kernel.org | 8532 | L: netdev@vger.kernel.org |
| 8525 | S: Supported | 8533 | S: Supported |
| 8526 | F: drivers/net/ethernet/ibm/ibmvnic.* | 8534 | F: drivers/net/ethernet/ibm/ibmvnic.* |
| @@ -10030,7 +10038,6 @@ F: scripts/leaking_addresses.pl · 1503 unmodified lines | |||
| 10030 | 10038 | ||
| 10031 | LED SUBSYSTEM | 10039 | LED SUBSYSTEM |
| 10032 | M: Pavel Machek <pavel@ucw.cz> | 10040 | M: Pavel Machek <pavel@ucw.cz> |
| 10033 | R: Dan Murphy <dmurphy@ti.com> | ||
| 10034 | L: linux-leds@vger.kernel.org | 10041 | L: linux-leds@vger.kernel.org |
| 10035 | S: Maintained | 10042 | S: Maintained |
| 10036 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds.git | 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 | MARVELL MWIFIEX WIRELESS DRIVER | 10724 | MARVELL MWIFIEX WIRELESS DRIVER |
| 10718 | M: Amitkumar Karwar <amitkarwar@gmail.com> | 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 | M: Xinming Hu <huxinming820@gmail.com> | 10728 | M: Xinming Hu <huxinming820@gmail.com> |
| 10721 | L: linux-wireless@vger.kernel.org | 10729 | L: linux-wireless@vger.kernel.org |
| 10722 | S: Maintained | 10730 | S: Maintained |
| @@ -10905,7 +10913,6 @@ T: git git://linuxtv.org/media_tree.git · 182 unmodified lines | |||
| 10905 | F: drivers/media/radio/radio-maxiradio* | 10913 | F: drivers/media/radio/radio-maxiradio* |
| 10906 | 10914 | ||
| 10907 | MCAN MMIO DEVICE DRIVER | 10915 | MCAN MMIO DEVICE DRIVER |
| 10908 | M: Dan Murphy <dmurphy@ti.com> | ||
| 10909 | M: Pankaj Sharma <pankj.sharma@samsung.com> | 10916 | M: Pankaj Sharma <pankj.sharma@samsung.com> |
| 10910 | L: linux-can@vger.kernel.org | 10917 | L: linux-can@vger.kernel.org |
| 10911 | S: Maintained | 10918 | S: Maintained |
| @@ -11166,7 +11173,7 @@ T: git git://linuxtv.org/media_tree.git · 254 unmodified lines | |||
| 11166 | F: drivers/media/dvb-frontends/stv6111* | 11173 | F: drivers/media/dvb-frontends/stv6111* |
| 11167 | 11174 | ||
| 11168 | MEDIA DRIVERS FOR STM32 - DCMI | 11175 | MEDIA DRIVERS FOR STM32 - DCMI |
| 11169 | M: Hugues Fruchet <hugues.fruchet@st.com> | 11176 | M: Hugues Fruchet <hugues.fruchet@foss.st.com> |
| 11170 | L: linux-media@vger.kernel.org | 11177 | L: linux-media@vger.kernel.org |
| 11171 | S: Supported | 11178 | S: Supported |
| 11172 | T: git git://linuxtv.org/media_tree.git | 11179 | T: git git://linuxtv.org/media_tree.git |
| @@ -12537,7 +12544,7 @@ NETWORKING [MPTCP] · 1364 unmodified lines | |||
| 12537 | M: Mat Martineau <mathew.j.martineau@linux.intel.com> | 12544 | M: Mat Martineau <mathew.j.martineau@linux.intel.com> |
| 12538 | M: Matthieu Baerts <matthieu.baerts@tessares.net> | 12545 | M: Matthieu Baerts <matthieu.baerts@tessares.net> |
| 12539 | L: netdev@vger.kernel.org | 12546 | L: netdev@vger.kernel.org |
| 12540 | L: mptcp@lists.01.org | 12547 | L: mptcp@lists.linux.dev |
| 12541 | S: Maintained | 12548 | S: Maintained |
| 12542 | W: https://github.com/multipath-tcp/mptcp_net-next/wiki | 12549 | W: https://github.com/multipath-tcp/mptcp_net-next/wiki |
| 12543 | B: https://github.com/multipath-tcp/mptcp_net-next/issues | 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 | QLOGIC QLGE 10Gb ETHERNET DRIVER | 14715 | QLOGIC QLGE 10Gb ETHERNET DRIVER |
| 14709 | M: Manish Chopra <manishc@marvell.com> | 14716 | M: Manish Chopra <manishc@marvell.com> |
| 14710 | M: GR-Linux-NIC-Dev@marvell.com | 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 | M: Coiby Xu <coiby.xu@gmail.com> | 14718 | M: Coiby Xu <coiby.xu@gmail.com> |
| 14717 | L: netdev@vger.kernel.org | 14719 | L: netdev@vger.kernel.org |
| 14718 | S: Maintained | 14720 | S: Supported |
| 14719 | F: Documentation/networking/device_drivers/qlogic/qlge.rst | 14721 | F: Documentation/networking/device_drivers/qlogic/qlge.rst |
| 14722 | F: drivers/staging/qlge/ | ||
| 14720 | 14723 | ||
| 14721 | QM1D1B0004 MEDIA DRIVER | 14724 | QM1D1B0004 MEDIA DRIVER |
| 14722 | M: Akihiro Tsukada <tskd08@gmail.com> | 14725 | M: Akihiro Tsukada <tskd08@gmail.com> |
| @@ -14856,6 +14859,14 @@ L: linux-arm-msm@vger.kernel.org · 133 unmodified lines | |||
| 14856 | S: Maintained | 14859 | S: Maintained |
| 14857 | F: drivers/iommu/arm/arm-smmu/qcom_iommu.c | 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 | QUALCOMM IPCC MAILBOX DRIVER | 14870 | QUALCOMM IPCC MAILBOX DRIVER |
| 14860 | M: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> | 14871 | M: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> |
| 14861 | L: linux-arm-msm@vger.kernel.org | 14872 | L: linux-arm-msm@vger.kernel.org |
| @@ -15205,6 +15216,7 @@ F: fs/reiserfs/ · 343 unmodified lines | |||
| 15205 | REMOTE PROCESSOR (REMOTEPROC) SUBSYSTEM | 15216 | REMOTE PROCESSOR (REMOTEPROC) SUBSYSTEM |
| 15206 | M: Ohad Ben-Cohen <ohad@wizery.com> | 15217 | M: Ohad Ben-Cohen <ohad@wizery.com> |
| 15207 | M: Bjorn Andersson <bjorn.andersson@linaro.org> | 15218 | M: Bjorn Andersson <bjorn.andersson@linaro.org> |
| 15219 | M: Mathieu Poirier <mathieu.poirier@linaro.org> | ||
| 15208 | L: linux-remoteproc@vger.kernel.org | 15220 | L: linux-remoteproc@vger.kernel.org |
| 15209 | S: Maintained | 15221 | S: Maintained |
| 15210 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/andersson/remoteproc.git rproc-next | 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 | REMOTE PROCESSOR MESSAGING (RPMSG) SUBSYSTEM | 15230 | REMOTE PROCESSOR MESSAGING (RPMSG) SUBSYSTEM |
| 15219 | M: Ohad Ben-Cohen <ohad@wizery.com> | 15231 | M: Ohad Ben-Cohen <ohad@wizery.com> |
| 15220 | M: Bjorn Andersson <bjorn.andersson@linaro.org> | 15232 | M: Bjorn Andersson <bjorn.andersson@linaro.org> |
| 15233 | M: Mathieu Poirier <mathieu.poirier@linaro.org> | ||
| 15221 | L: linux-remoteproc@vger.kernel.org | 15234 | L: linux-remoteproc@vger.kernel.org |
| 15222 | S: Maintained | 15235 | S: Maintained |
| 15223 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/andersson/remoteproc.git rpmsg-next | 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 | S390 VFIO AP DRIVER | 15648 | S390 VFIO AP DRIVER |
| 15636 | M: Tony Krowiak <akrowiak@linux.ibm.com> | 15649 | M: Tony Krowiak <akrowiak@linux.ibm.com> |
| 15637 | M: Pierre Morel <pmorel@linux.ibm.com> | ||
| 15638 | M: Halil Pasic <pasic@linux.ibm.com> | 15650 | M: Halil Pasic <pasic@linux.ibm.com> |
| 15651 | M: Jason Herne <jjherne@linux.ibm.com> | ||
| 15639 | L: linux-s390@vger.kernel.org | 15652 | L: linux-s390@vger.kernel.org |
| 15640 | S: Supported | 15653 | S: Supported |
| 15641 | W: http://www.ibm.com/developerworks/linux/linux390/ | 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 | S390 VFIO-CCW DRIVER | 15660 | S390 VFIO-CCW DRIVER |
| 15648 | M: Cornelia Huck <cohuck@redhat.com> | 15661 | M: Cornelia Huck <cohuck@redhat.com> |
| 15649 | M: Eric Farman <farman@linux.ibm.com> | 15662 | M: Eric Farman <farman@linux.ibm.com> |
| 15663 | M: Matthew Rosato <mjrosato@linux.ibm.com> | ||
| 15650 | R: Halil Pasic <pasic@linux.ibm.com> | 15664 | R: Halil Pasic <pasic@linux.ibm.com> |
| 15651 | L: linux-s390@vger.kernel.org | 15665 | L: linux-s390@vger.kernel.org |
| 15652 | L: kvm@vger.kernel.org | 15666 | L: kvm@vger.kernel.org |
| @@ -15657,6 +15671,7 @@ F: include/uapi/linux/vfio_ccw.h · 4 unmodified lines | |||
| 15657 | 15671 | ||
| 15658 | S390 VFIO-PCI DRIVER | 15672 | S390 VFIO-PCI DRIVER |
| 15659 | M: Matthew Rosato <mjrosato@linux.ibm.com> | 15673 | M: Matthew Rosato <mjrosato@linux.ibm.com> |
| 15674 | M: Eric Farman <farman@linux.ibm.com> | ||
| 15660 | L: linux-s390@vger.kernel.org | 15675 | L: linux-s390@vger.kernel.org |
| 15661 | L: kvm@vger.kernel.org | 15676 | L: kvm@vger.kernel.org |
| 15662 | S: Supported | 15677 | S: Supported |
| @@ -16886,8 +16901,10 @@ F: tools/spi/ · 1223 unmodified lines | |||
| 16886 | 16901 | ||
| 16887 | SPIDERNET NETWORK DRIVER for CELL | 16902 | SPIDERNET NETWORK DRIVER for CELL |
| 16888 | M: Ishizaki Kou <kou.ishizaki@toshiba.co.jp> | 16903 | M: Ishizaki Kou <kou.ishizaki@toshiba.co.jp> |
| 16904 | M: Geoff Levand <geoff@infradead.org> | ||
| 16889 | L: netdev@vger.kernel.org | 16905 | L: netdev@vger.kernel.org |
| 16890 | S: Supported | 16906 | L: linuxppc-dev@lists.ozlabs.org |
| 16907 | S: Maintained | ||
| 16891 | F: Documentation/networking/device_drivers/ethernet/toshiba/spider_net.rst | 16908 | F: Documentation/networking/device_drivers/ethernet/toshiba/spider_net.rst |
| 16892 | F: drivers/net/ethernet/toshiba/spider_net* | 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 | F: drivers/media/i2c/st-mipid02.c | 16958 | F: drivers/media/i2c/st-mipid02.c |
| 16942 | 16959 | ||
| 16943 | ST STM32 I2C/SMBUS DRIVER | 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 | L: linux-i2c@vger.kernel.org | 16963 | L: linux-i2c@vger.kernel.org |
| 16946 | S: Maintained | 16964 | S: Maintained |
| 16947 | F: drivers/i2c/busses/i2c-stm32* | 16965 | F: drivers/i2c/busses/i2c-stm32* |
| @@ -17039,7 +17057,7 @@ F: drivers/staging/vt665?/ · 91 unmodified lines | |||
| 17039 | 17057 | ||
| 17040 | STAGING SUBSYSTEM | 17058 | STAGING SUBSYSTEM |
| 17041 | M: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 17059 | M: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
| 17042 | L: devel@driverdev.osuosl.org | 17060 | L: linux-staging@lists.linux.dev |
| 17043 | S: Supported | 17061 | S: Supported |
| 17044 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git | 17062 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git |
| 17045 | F: drivers/staging/ | 17063 | F: drivers/staging/ |
| @@ -17066,7 +17084,7 @@ F: kernel/jump_label.c · 20 unmodified lines | |||
| 17066 | F: kernel/static_call.c | 17084 | F: kernel/static_call.c |
| 17067 | 17085 | ||
| 17068 | STI AUDIO (ASoC) DRIVERS | 17086 | STI AUDIO (ASoC) DRIVERS |
| 17069 | M: Arnaud Pouliquen <arnaud.pouliquen@st.com> | 17087 | M: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com> |
| 17070 | L: alsa-devel@alsa-project.org (moderated for non-subscribers) | 17088 | L: alsa-devel@alsa-project.org (moderated for non-subscribers) |
| 17071 | S: Maintained | 17089 | S: Maintained |
| 17072 | F: Documentation/devicetree/bindings/sound/st,sti-asoc-card.txt | 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 | F: drivers/media/usb/stk1160/ | 17104 | F: drivers/media/usb/stk1160/ |
| 17087 | 17105 | ||
| 17088 | STM32 AUDIO (ASoC) DRIVERS | 17106 | STM32 AUDIO (ASoC) DRIVERS |
| 17089 | M: Olivier Moysan <olivier.moysan@st.com> | 17107 | M: Olivier Moysan <olivier.moysan@foss.st.com> |
| 17090 | M: Arnaud Pouliquen <arnaud.pouliquen@st.com> | 17108 | M: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com> |
| 17091 | L: alsa-devel@alsa-project.org (moderated for non-subscribers) | 17109 | L: alsa-devel@alsa-project.org (moderated for non-subscribers) |
| 17092 | S: Maintained | 17110 | S: Maintained |
| 17093 | F: Documentation/devicetree/bindings/iio/adc/st,stm32-*.yaml | 17111 | F: Documentation/devicetree/bindings/iio/adc/st,stm32-*.yaml |
| 17094 | F: sound/soc/stm/ | 17112 | F: sound/soc/stm/ |
| 17095 | 17113 | ||
| 17096 | STM32 TIMER/LPTIMER DRIVERS | 17114 | STM32 TIMER/LPTIMER DRIVERS |
| 17097 | M: Fabrice Gasnier <fabrice.gasnier@st.com> | 17115 | M: Fabrice Gasnier <fabrice.gasnier@foss.st.com> |
| 17098 | S: Maintained | 17116 | S: Maintained |
| 17099 | F: Documentation/ABI/testing/*timer-stm32 | 17117 | F: Documentation/ABI/testing/*timer-stm32 |
| 17100 | F: Documentation/devicetree/bindings/*/*stm32-*timer* | 17118 | F: Documentation/devicetree/bindings/*/*stm32-*timer* |
| @@ -17104,7 +17122,7 @@ F: include/linux/*/stm32-*tim* · 3 unmodified lines | |||
| 17104 | 17122 | ||
| 17105 | STMMAC ETHERNET DRIVER | 17123 | STMMAC ETHERNET DRIVER |
| 17106 | M: Giuseppe Cavallaro <peppe.cavallaro@st.com> | 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 | M: Jose Abreu <joabreu@synopsys.com> | 17126 | M: Jose Abreu <joabreu@synopsys.com> |
| 17109 | L: netdev@vger.kernel.org | 17127 | L: netdev@vger.kernel.org |
| 17110 | S: Supported | 17128 | S: Supported |
| @@ -17846,7 +17864,6 @@ S: Maintained · 735 unmodified lines | |||
| 17846 | F: drivers/thermal/ti-soc-thermal/ | 17864 | F: drivers/thermal/ti-soc-thermal/ |
| 17847 | 17865 | ||
| 17848 | TI BQ27XXX POWER SUPPLY DRIVER | 17866 | TI BQ27XXX POWER SUPPLY DRIVER |
| 17849 | R: Dan Murphy <dmurphy@ti.com> | ||
| 17850 | F: drivers/power/supply/bq27xxx_battery.c | 17867 | F: drivers/power/supply/bq27xxx_battery.c |
| 17851 | F: drivers/power/supply/bq27xxx_battery_i2c.c | 17868 | F: drivers/power/supply/bq27xxx_battery_i2c.c |
| 17852 | F: include/linux/power/bq27xxx_battery.h | 17869 | F: include/linux/power/bq27xxx_battery.h |
| @@ -17981,7 +17998,6 @@ S: Odd Fixes · 128 unmodified lines | |||
| 17981 | F: sound/soc/codecs/tas571x* | 17998 | F: sound/soc/codecs/tas571x* |
| 17982 | 17999 | ||
| 17983 | TI TCAN4X5X DEVICE DRIVER | 18000 | TI TCAN4X5X DEVICE DRIVER |
| 17984 | M: Dan Murphy <dmurphy@ti.com> | ||
| 17985 | L: linux-can@vger.kernel.org | 18001 | L: linux-can@vger.kernel.org |
| 17986 | S: Maintained | 18002 | S: Maintained |
| 17987 | F: Documentation/devicetree/bindings/net/can/tcan4x5x.txt | 18003 | F: Documentation/devicetree/bindings/net/can/tcan4x5x.txt |
| @@ -19134,7 +19150,7 @@ VME SUBSYSTEM · 1146 unmodified lines | |||
| 19134 | M: Martyn Welch <martyn@welchs.me.uk> | 19150 | M: Martyn Welch <martyn@welchs.me.uk> |
| 19135 | M: Manohar Vanga <manohar.vanga@gmail.com> | 19151 | M: Manohar Vanga <manohar.vanga@gmail.com> |
| 19136 | M: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 19152 | M: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
| 19137 | L: devel@driverdev.osuosl.org | 19153 | L: linux-kernel@vger.kernel.org |
| 19138 | S: Maintained | 19154 | S: Maintained |
| 19139 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git | 19155 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git |
| 19140 | F: Documentation/driver-api/vme.rst | 19156 | F: Documentation/driver-api/vme.rst |
| @@ -19165,7 +19181,7 @@ S: Maintained · 24 unmodified lines | |||
| 19165 | F: drivers/infiniband/hw/vmw_pvrdma/ | 19181 | F: drivers/infiniband/hw/vmw_pvrdma/ |
| 19166 | 19182 | ||
| 19167 | VMware PVSCSI driver | 19183 | VMware PVSCSI driver |
| 19168 | M: Jim Gill <jgill@vmware.com> | 19184 | M: Vishal Bhakta <vbhakta@vmware.com> |
| 19169 | M: VMware PV-Drivers <pv-drivers@vmware.com> | 19185 | M: VMware PV-Drivers <pv-drivers@vmware.com> |
| 19170 | L: linux-scsi@vger.kernel.org | 19186 | L: linux-scsi@vger.kernel.org |
| 19171 | S: Maintained | 19187 | S: Maintained |
| @@ -2,7 +2,7 @@ · 1 unmodified line | |||
| 2 | VERSION = 5 | 2 | VERSION = 5 |
| 3 | PATCHLEVEL = 12 | 3 | PATCHLEVEL = 12 |
| 4 | SUBLEVEL = 0 | 4 | SUBLEVEL = 0 |
| 5 | EXTRAVERSION = -rc2 | 5 | EXTRAVERSION = -rc8 |
| 6 | NAME = Frozen Wasteland | 6 | NAME = Frozen Wasteland |
| 7 | 7 | ||
| 8 | # *DOCUMENTATION* | 8 | # *DOCUMENTATION* |
| @@ -264,7 +264,8 @@ no-dot-config-targets := $(clean-targets) \ · 255 unmodified lines | |||
| 264 | $(version_h) headers headers_% archheaders archscripts \ | 264 | $(version_h) headers headers_% archheaders archscripts \ |
| 265 | %asm-generic kernelversion %src-pkg dt_binding_check \ | 265 | %asm-generic kernelversion %src-pkg dt_binding_check \ |
| 266 | outputmakefile | 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 | single-targets := %.a %.i %.ko %.lds %.ll %.lst %.mod %.o %.s %.symtypes %/ | 269 | single-targets := %.a %.i %.ko %.lds %.ll %.lst %.mod %.o %.s %.symtypes %/ |
| 269 | 270 | ||
| 270 | config-build := | 271 | config-build := |
| @@ -478,6 +479,7 @@ USERINCLUDE := \ · 207 unmodified lines | |||
| 478 | -I$(objtree)/arch/$(SRCARCH)/include/generated/uapi \ | 479 | -I$(objtree)/arch/$(SRCARCH)/include/generated/uapi \ |
| 479 | -I$(srctree)/include/uapi \ | 480 | -I$(srctree)/include/uapi \ |
| 480 | -I$(objtree)/include/generated/uapi \ | 481 | -I$(objtree)/include/generated/uapi \ |
| 482 | -include $(srctree)/include/linux/compiler-version.h \ | ||
| 481 | -include $(srctree)/include/linux/kconfig.h | 483 | -include $(srctree)/include/linux/kconfig.h |
| 482 | 484 | ||
| 483 | # Use LINUXINCLUDE when you must reference the include/ directory. | 485 | # Use LINUXINCLUDE when you must reference the include/ directory. |
| @@ -632,13 +632,12 @@ config HAS_LTO_CLANG · 631 unmodified lines | |||
| 632 | def_bool y | 632 | def_bool y |
| 633 | # Clang >= 11: https://github.com/ClangBuiltLinux/linux/issues/510 | 633 | # Clang >= 11: https://github.com/ClangBuiltLinux/linux/issues/510 |
| 634 | depends on CC_IS_CLANG && CLANG_VERSION >= 110000 && LD_IS_LLD | 634 | depends on CC_IS_CLANG && CLANG_VERSION >= 110000 && LD_IS_LLD |
| 635 | depends on $(success,test $(LLVM) -eq 1) | ||
| 636 | depends on $(success,test $(LLVM_IAS) -eq 1) | 635 | depends on $(success,test $(LLVM_IAS) -eq 1) |
| 637 | depends on $(success,$(NM) --help | head -n 1 | grep -qi llvm) | 636 | depends on $(success,$(NM) --help | head -n 1 | grep -qi llvm) |
| 638 | depends on $(success,$(AR) --help | head -n 1 | grep -qi llvm) | 637 | depends on $(success,$(AR) --help | head -n 1 | grep -qi llvm) |
| 639 | depends on ARCH_SUPPORTS_LTO_CLANG | 638 | depends on ARCH_SUPPORTS_LTO_CLANG |
| 640 | depends on !FTRACE_MCOUNT_USE_RECORDMCOUNT | 639 | depends on !FTRACE_MCOUNT_USE_RECORDMCOUNT |
| 641 | depends on !KASAN | 640 | depends on !KASAN || KASAN_HW_TAGS |
| 642 | depends on !GCOV_KERNEL | 641 | depends on !GCOV_KERNEL |
| 643 | help | 642 | help |
| 644 | The compiler and Kconfig options support building with Clang's | 643 | The compiler and Kconfig options support building with Clang's |
| @@ -16,7 +16,7 @@ · 15 unmodified lines | |||
| 16 | memory { | 16 | memory { |
| 17 | device_type = "memory"; | 17 | device_type = "memory"; |
| 18 | /* CONFIG_LINUX_RAM_BASE needs to match low mem start */ | 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 | 0x1 0x00000000 0x0 0x40000000>; /* 1 GB highmem */ | 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 | sizeof(sf->uc.uc_mcontext.regs.scratch)); | 96 | sizeof(sf->uc.uc_mcontext.regs.scratch)); |
| 97 | err |= __copy_to_user(&sf->uc.uc_sigmask, set, sizeof(sigset_t)); | 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 | static int restore_usr_regs(struct pt_regs *regs, struct rt_sigframe __user *sf) | 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 | &(sf->uc.uc_mcontext.regs.scratch), | 110 | &(sf->uc.uc_mcontext.regs.scratch), |
| 111 | sizeof(sf->uc.uc_mcontext.regs.scratch)); | 111 | sizeof(sf->uc.uc_mcontext.regs.scratch)); |
| 112 | if (err) | 112 | if (err) |
| 113 | return err; | 113 | return -EFAULT; |
| 114 | 114 | ||
| 115 | set_current_blocked(&set); | 115 | set_current_blocked(&set); |
| 116 | regs->bta = uregs.scratch.bta; | 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 | const void *table_start, unsigned long table_size, | 187 | const void *table_start, unsigned long table_size, |
| 188 | const u8 *header_start, unsigned long header_size) | 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 | table->core.pc = (unsigned long)core_start; | 190 | table->core.pc = (unsigned long)core_start; |
| 194 | table->core.range = core_size; | 191 | table->core.range = core_size; |
| 195 | table->init.pc = (unsigned long)init_start; | 192 | table->init.pc = (unsigned long)init_start; |
| 196 | table->init.range = init_size; | 193 | table->init.range = init_size; |
| 197 | table->address = table_start; | 194 | table->address = table_start; |
| 198 | table->size = table_size; | 195 | table->size = table_size; |
| 199 | 196 | /* To avoid the pointer addition with NULL pointer.*/ | |
| 200 | /* See if the linker provided table looks valid. */ | 197 | if (header_start != NULL) { |
| 201 | if (header_size <= 4 | 198 | const u8 *ptr = header_start + 4; |
| 202 | || header_start[0] != 1 | 199 | const u8 *end = header_start + header_size; |
| 203 | || (void *)read_pointer(&ptr, end, header_start[1]) != table_start | 200 | /* See if the linker provided table looks valid. */ |
| 204 | || header_start[2] == DW_EH_PE_omit | 201 | if (header_size <= 4 |
| 205 | || read_pointer(&ptr, end, header_start[2]) <= 0 | 202 | || header_start[0] != 1 |
| 206 | || header_start[3] == DW_EH_PE_omit) | 203 | || (void *)read_pointer(&ptr, end, header_start[1]) |
| 207 | header_start = NULL; | 204 | != table_start |
| 208 | 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 | table->hdrsz = header_size; | 210 | table->hdrsz = header_size; |
| 210 | smp_wmb(); | 211 | smp_wmb(); |
| 211 | table->header = header_start; | 212 | table->header = header_start; |
| @@ -348,6 +348,7 @@ config ARCH_EP93XX · 347 unmodified lines | |||
| 348 | select ARM_AMBA | 348 | select ARM_AMBA |
| 349 | imply ARM_PATCH_PHYS_VIRT | 349 | imply ARM_PATCH_PHYS_VIRT |
| 350 | select ARM_VIC | 350 | select ARM_VIC |
| 351 | select GENERIC_IRQ_MULTI_HANDLER | ||
| 351 | select AUTO_ZRELADDR | 352 | select AUTO_ZRELADDR |
| 352 | select CLKDEV_LOOKUP | 353 | select CLKDEV_LOOKUP |
| 353 | select CLKSRC_MMIO | 354 | select CLKSRC_MMIO |
| @@ -1292,9 +1293,15 @@ config KASAN_SHADOW_OFFSET · 938 unmodified lines | |||
| 1292 | 1293 | ||
| 1293 | config NR_CPUS | 1294 | config NR_CPUS |
| 1294 | int "Maximum number of CPUs (2-32)" | 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 | depends on SMP | 1298 | depends on SMP |
| 1297 | default "4" | 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 | config HOTPLUG_CPU | 1306 | config HOTPLUG_CPU |
| 1300 | bool "Support for hot-pluggable CPUs" | 1307 | bool "Support for hot-pluggable CPUs" |
| @@ -40,6 +40,9 @@ · 39 unmodified lines | |||
| 40 | ethernet1 = &cpsw_emac1; | 40 | ethernet1 = &cpsw_emac1; |
| 41 | spi0 = &spi0; | 41 | spi0 = &spi0; |
| 42 | spi1 = &spi1; | 42 | spi1 = &spi1; |
| 43 | mmc0 = &mmc1; | ||
| 44 | mmc1 = &mmc2; | ||
| 45 | mmc2 = &mmc3; | ||
| 43 | }; | 46 | }; |
| 44 | 47 | ||
| 45 | cpus { | 48 | cpus { |
| @@ -32,7 +32,8 @@ · 31 unmodified lines | |||
| 32 | ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000 | 32 | ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000 |
| 33 | MBUS_ID(0x01, 0x1d) 0 0xfff00000 0x100000 | 33 | MBUS_ID(0x01, 0x1d) 0 0xfff00000 0x100000 |
| 34 | MBUS_ID(0x09, 0x19) 0 0xf1100000 0x10000 | 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 | internal-regs { | 38 | internal-regs { |
| 38 | 39 | ||
| @@ -389,6 +390,7 @@ · 350 unmodified lines | |||
| 389 | phy1: ethernet-phy@1 { | 390 | phy1: ethernet-phy@1 { |
| 390 | compatible = "ethernet-phy-ieee802.3-c22"; | 391 | compatible = "ethernet-phy-ieee802.3-c22"; |
| 391 | reg = <1>; | 392 | reg = <1>; |
| 393 | marvell,reg-init = <3 18 0 0x4985>; | ||
| 392 | 394 | ||
| 393 | /* irq is connected to &pcawan pin 7 */ | 395 | /* irq is connected to &pcawan pin 7 */ |
| 394 | }; | 396 | }; |
| @@ -334,14 +334,6 @@ · 333 unmodified lines | |||
| 334 | }; | 334 | }; |
| 335 | 335 | ||
| 336 | &pinctrl { | 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 | adc { | 337 | adc { |
| 346 | pinctrl_adc_default: adc_default { | 338 | pinctrl_adc_default: adc_default { |
| 347 | atmel,pins = <AT91_PIOB 15 AT91_PERIPH_A AT91_PINCTRL_NONE>; | 339 | atmel,pins = <AT91_PIOB 15 AT91_PERIPH_A AT91_PINCTRL_NONE>; |
| @@ -84,8 +84,8 @@ · 83 unmodified lines | |||
| 84 | pinctrl-0 = <&pinctrl_macb0_default>; | 84 | pinctrl-0 = <&pinctrl_macb0_default>; |
| 85 | phy-mode = "rmii"; | 85 | phy-mode = "rmii"; |
| 86 | 86 | ||
| 87 | ethernet-phy@0 { | 87 | ethernet-phy@7 { |
| 88 | reg = <0x0>; | 88 | reg = <0x7>; |
| 89 | interrupt-parent = <&pioA>; | 89 | interrupt-parent = <&pioA>; |
| 90 | interrupts = <PIN_PD31 IRQ_TYPE_LEVEL_LOW>; | 90 | interrupts = <PIN_PD31 IRQ_TYPE_LEVEL_LOW>; |
| 91 | pinctrl-names = "default"; | 91 | pinctrl-names = "default"; |
| @@ -308,14 +308,6 @@ · 307 unmodified lines | |||
| 308 | #reset-cells = <1>; | 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 | aon_intr: interrupt-controller@7ef00100 { | 311 | aon_intr: interrupt-controller@7ef00100 { |
| 320 | compatible = "brcm,bcm2711-l2-intc", "brcm,l2-intc"; | 312 | compatible = "brcm,bcm2711-l2-intc", "brcm,l2-intc"; |
| 321 | reg = <0x7ef00100 0x30>; | 313 | reg = <0x7ef00100 0x30>; |
| @@ -362,8 +354,6 @@ · 40 unmodified lines | |||
| 362 | reg = <0x7ef04500 0x100>, <0x7ef00b00 0x300>; | 354 | reg = <0x7ef04500 0x100>, <0x7ef00b00 0x300>; |
| 363 | reg-names = "bsc", "auto-i2c"; | 355 | reg-names = "bsc", "auto-i2c"; |
| 364 | clock-frequency = <97500>; | 356 | clock-frequency = <97500>; |
| 365 | interrupt-parent = <&bsc_intr>; | ||
| 366 | interrupts = <0>; | ||
| 367 | status = "disabled"; | 357 | status = "disabled"; |
| 368 | }; | 358 | }; |
| 369 | 359 | ||
| @@ -405,8 +395,6 @@ · 35 unmodified lines | |||
| 405 | reg = <0x7ef09500 0x100>, <0x7ef05b00 0x300>; | 395 | reg = <0x7ef09500 0x100>, <0x7ef05b00 0x300>; |
| 406 | reg-names = "bsc", "auto-i2c"; | 396 | reg-names = "bsc", "auto-i2c"; |
| 407 | clock-frequency = <97500>; | 397 | clock-frequency = <97500>; |
| 408 | interrupt-parent = <&bsc_intr>; | ||
| 409 | interrupts = <1>; | ||
| 410 | status = "disabled"; | 398 | status = "disabled"; |
| 411 | }; | 399 | }; |
| 412 | }; | 400 | }; |
| @@ -433,6 +433,7 @@ · 432 unmodified lines | |||
| 433 | pinctrl-0 = <&pinctrl_usdhc2>; | 433 | pinctrl-0 = <&pinctrl_usdhc2>; |
| 434 | cd-gpios = <&gpio1 4 GPIO_ACTIVE_LOW>; | 434 | cd-gpios = <&gpio1 4 GPIO_ACTIVE_LOW>; |
| 435 | wp-gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>; | 435 | wp-gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>; |
| 436 | vmmc-supply = <&vdd_sd1_reg>; | ||
| 436 | status = "disabled"; | 437 | status = "disabled"; |
| 437 | }; | 438 | }; |
| 438 | 439 | ||
| @@ -442,5 +443,6 @@ · 3 unmodified lines | |||
| 442 | &pinctrl_usdhc3_cdwp>; | 443 | &pinctrl_usdhc3_cdwp>; |
| 443 | cd-gpios = <&gpio1 27 GPIO_ACTIVE_LOW>; | 444 | cd-gpios = <&gpio1 27 GPIO_ACTIVE_LOW>; |
| 444 | wp-gpios = <&gpio1 29 GPIO_ACTIVE_HIGH>; | 445 | wp-gpios = <&gpio1 29 GPIO_ACTIVE_HIGH>; |
| 446 | vmmc-supply = <&vdd_sd0_reg>; | ||
| 445 | status = "disabled"; | 447 | status = "disabled"; |
| 446 | }; | 448 | }; |
| @@ -210,9 +210,6 @@ · 209 unmodified lines | |||
| 210 | micrel,led-mode = <1>; | 210 | micrel,led-mode = <1>; |
| 211 | clocks = <&clks IMX6UL_CLK_ENET_REF>; | 211 | clocks = <&clks IMX6UL_CLK_ENET_REF>; |
| 212 | clock-names = "rmii-ref"; | 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 | micrel,led-mode = <1>; | 219 | micrel,led-mode = <1>; |
| 223 | clocks = <&clks IMX6UL_CLK_ENET2_REF>; | 220 | clocks = <&clks IMX6UL_CLK_ENET2_REF>; |
| 224 | clock-names = "rmii-ref"; | 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 | status = "okay"; | 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 | &i2c1 { | 256 | &i2c1 { |
| 247 | clock-frequency = <100000>; | 257 | clock-frequency = <100000>; |
| 248 | pinctrl-names = "default"; | 258 | pinctrl-names = "default"; |
| @@ -14,5 +14,6 @@ · 13 unmodified lines | |||
| 14 | }; | 14 | }; |
| 15 | 15 | ||
| 16 | &gpmi { | 16 | &gpmi { |
| 17 | fsl,use-minimum-ecc; | ||
| 17 | status = "okay"; | 18 | status = "okay"; |
| 18 | }; | 19 | }; |
| @@ -24,6 +24,9 @@ · 23 unmodified lines | |||
| 24 | i2c0 = &i2c1; | 24 | i2c0 = &i2c1; |
| 25 | i2c1 = &i2c2; | 25 | i2c1 = &i2c2; |
| 26 | i2c2 = &i2c3; | 26 | i2c2 = &i2c3; |
| 27 | mmc0 = &mmc1; | ||
| 28 | mmc1 = &mmc2; | ||
| 29 | mmc2 = &mmc3; | ||
| 27 | serial0 = &uart1; | 30 | serial0 = &uart1; |
| 28 | serial1 = &uart2; | 31 | serial1 = &uart2; |
| 29 | serial2 = &uart3; | 32 | serial2 = &uart3; |
| @@ -22,6 +22,11 @@ · 21 unmodified lines | |||
| 22 | i2c1 = &i2c2; | 22 | i2c1 = &i2c2; |
| 23 | i2c2 = &i2c3; | 23 | i2c2 = &i2c3; |
| 24 | i2c3 = &i2c4; | 24 | i2c3 = &i2c4; |
| 25 | mmc0 = &mmc1; | ||
| 26 | mmc1 = &mmc2; | ||
| 27 | mmc2 = &mmc3; | ||
| 28 | mmc3 = &mmc4; | ||
| 29 | mmc4 = &mmc5; | ||
| 25 | serial0 = &uart1; | 30 | serial0 = &uart1; |
| 26 | serial1 = &uart2; | 31 | serial1 = &uart2; |
| 27 | serial2 = &uart3; | 32 | serial2 = &uart3; |
| @@ -770,14 +770,6 @@ · 769 unmodified lines | |||
| 770 | ti,max-div = <2>; | 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 | usb_phy_cm_clk32k: usb_phy_cm_clk32k@640 { | 773 | usb_phy_cm_clk32k: usb_phy_cm_clk32k@640 { |
| 782 | #clock-cells = <0>; | 774 | #clock-cells = <0>; |
| 783 | compatible = "ti,gate-clock"; | 775 | compatible = "ti,gate-clock"; |
| @@ -25,6 +25,11 @@ · 24 unmodified lines | |||
| 25 | i2c2 = &i2c3; | 25 | i2c2 = &i2c3; |
| 26 | i2c3 = &i2c4; | 26 | i2c3 = &i2c4; |
| 27 | i2c4 = &i2c5; | 27 | i2c4 = &i2c5; |
| 28 | mmc0 = &mmc1; | ||
| 29 | mmc1 = &mmc2; | ||
| 30 | mmc2 = &mmc3; | ||
| 31 | mmc3 = &mmc4; | ||
| 32 | mmc4 = &mmc5; | ||
| 28 | serial0 = &uart1; | 33 | serial0 = &uart1; |
| 29 | serial1 = &uart2; | 34 | serial1 = &uart2; |
| 30 | serial2 = &uart3; | 35 | serial2 = &uart3; |
| @@ -606,6 +606,15 @@ · 605 unmodified lines | |||
| 606 | compatible = "microchip,sam9x60-pinctrl", "atmel,at91sam9x5-pinctrl", "atmel,at91rm9200-pinctrl", "simple-bus"; | 606 | compatible = "microchip,sam9x60-pinctrl", "atmel,at91sam9x5-pinctrl", "atmel,at91rm9200-pinctrl", "simple-bus"; |
| 607 | ranges = <0xfffff400 0xfffff400 0x800>; | 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 | pioA: gpio@fffff400 { | 618 | pioA: gpio@fffff400 { |
| 610 | compatible = "microchip,sam9x60-gpio", "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio"; | 619 | compatible = "microchip,sam9x60-gpio", "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio"; |
| 611 | reg = <0xfffff400 0x200>; | 620 | reg = <0xfffff400 0x200>; |
| @@ -15,14 +15,14 @@ · 14 unmodified lines | |||
| 15 | #include <asm/mach-types.h> | 15 | #include <asm/mach-types.h> |
| 16 | 16 | ||
| 17 | /* cats host-specific stuff */ | 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 | static u8 cats_no_swizzle(struct pci_dev *dev, u8 *pin) | 20 | static u8 cats_no_swizzle(struct pci_dev *dev, u8 *pin) |
| 21 | { | 21 | { |
| 22 | return 0; | 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 | if (dev->irq >= 255) | 27 | if (dev->irq >= 255) |
| 28 | return -1; /* not a valid interrupt. */ | 28 | return -1; /* not a valid interrupt. */ |
| @@ -14,9 +14,9 @@ · 13 unmodified lines | |||
| 14 | #include <asm/mach/pci.h> | 14 | #include <asm/mach/pci.h> |
| 15 | #include <asm/mach-types.h> | 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 | if (dev->vendor == PCI_VENDOR_ID_CONTAQ && | 21 | if (dev->vendor == PCI_VENDOR_ID_CONTAQ && |
| 22 | dev->device == PCI_DEVICE_ID_CONTAQ_82C693) | 22 | dev->device == PCI_DEVICE_ID_CONTAQ_82C693) |
| @@ -18,7 +18,7 @@ · 17 unmodified lines | |||
| 18 | * We now use the slot ID instead of the device identifiers to select | 18 | * We now use the slot ID instead of the device identifiers to select |
| 19 | * which interrupt is routed where. | 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 | switch (slot) { | 23 | switch (slot) { |
| 24 | case 0: /* host bridge */ | 24 | case 0: /* host bridge */ |
| @@ -14,13 +14,12 @@ · 13 unmodified lines | |||
| 14 | #include <asm/mach/pci.h> | 14 | #include <asm/mach/pci.h> |
| 15 | #include <asm/mach-types.h> | 15 | #include <asm/mach-types.h> |
| 16 | 16 | ||
| 17 | static int irqmap_personal_server[] __initdata = { | 17 | static int irqmap_personal_server[] = { |
| 18 | IRQ_IN0, IRQ_IN1, IRQ_IN2, IRQ_IN3, 0, 0, 0, | 18 | IRQ_IN0, IRQ_IN1, IRQ_IN2, IRQ_IN3, 0, 0, 0, |
| 19 | IRQ_DOORBELLHOST, IRQ_DMA1, IRQ_DMA2, IRQ_PCI | 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, | 22 | static int personal_server_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) |
| 23 | u8 pin) | ||
| 24 | { | 23 | { |
| 25 | unsigned char line; | 24 | unsigned char line; |
| 26 | 25 | ||
| @@ -7,6 +7,7 @@ · 6 unmodified lines | |||
| 7 | #include <linux/module.h> | 7 | #include <linux/module.h> |
| 8 | #include <linux/irq.h> | 8 | #include <linux/irq.h> |
| 9 | #include <linux/irqdomain.h> | 9 | #include <linux/irqdomain.h> |
| 10 | #include <linux/irqchip.h> | ||
| 10 | #include <linux/io.h> | 11 | #include <linux/io.h> |
| 11 | #include <linux/of.h> | 12 | #include <linux/of.h> |
| 12 | #include <linux/of_address.h> | 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 | * interrupts. It registers the interrupt enable and disable functions | 163 | * interrupts. It registers the interrupt enable and disable functions |
| 163 | * to the kernel for each interrupt source. | 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 | struct device_node *np; | 168 | struct device_node *np; |
| 168 | int irq_base; | 169 | int irq_base; |
| @@ -220,3 +221,16 @@ void __init mxc_init_irq(void __iomem *irqbase) · 51 unmodified lines | |||
| 220 | 221 | ||
| 221 | printk(KERN_INFO "MXC IRQ initialized\n"); | 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 | void imx21_init_early(void); | 22 | void imx21_init_early(void); |
| 23 | void imx31_init_early(void); | 23 | void imx31_init_early(void); |
| 24 | void imx35_init_early(void); | 24 | void imx35_init_early(void); |
| 25 | void mxc_init_irq(void __iomem *); | ||
| 26 | void mx31_init_irq(void); | 25 | void mx31_init_irq(void); |
| 27 | void mx35_init_irq(void); | 26 | void mx35_init_irq(void); |
| 28 | void mxc_set_cpu_type(unsigned int type); | 27 | void mxc_set_cpu_type(unsigned int type); |
| @@ -17,16 +17,6 @@ static void __init imx1_init_early(void) · 16 unmodified lines | |||
| 17 | mxc_set_cpu_type(MXC_CPU_MX1); | 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 | static const char * const imx1_dt_board_compat[] __initconst = { | 20 | static const char * const imx1_dt_board_compat[] __initconst = { |
| 31 | "fsl,imx1", | 21 | "fsl,imx1", |
| 32 | NULL | 22 | NULL |
| @@ -34,7 +24,6 @@ static const char * const imx1_dt_board_compat[] __initconst = { · 1 unmodified line | |||
| 34 | 24 | ||
| 35 | DT_MACHINE_START(IMX1_DT, "Freescale i.MX1 (Device Tree Support)") | 25 | DT_MACHINE_START(IMX1_DT, "Freescale i.MX1 (Device Tree Support)") |
| 36 | .init_early = imx1_init_early, | 26 | .init_early = imx1_init_early, |
| 37 | .init_irq = imx1_init_irq, | ||
| 38 | .dt_compat = imx1_dt_board_compat, | 27 | .dt_compat = imx1_dt_board_compat, |
| 39 | .restart = mxc_restart, | 28 | .restart = mxc_restart, |
| 40 | MACHINE_END | 29 | MACHINE_END |
| @@ -22,17 +22,6 @@ static void __init imx25_dt_init(void) · 21 unmodified lines | |||
| 22 | imx_aips_allow_unprivileged_access("fsl,imx25-aips"); | 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 | static const char * const imx25_dt_board_compat[] __initconst = { | 25 | static const char * const imx25_dt_board_compat[] __initconst = { |
| 37 | "fsl,imx25", | 26 | "fsl,imx25", |
| 38 | NULL | 27 | NULL |
| @@ -42,6 +31,5 @@ DT_MACHINE_START(IMX25_DT, "Freescale i.MX25 (Device Tree Support)") · 3 unmodified lines | |||
| 42 | .init_early = imx25_init_early, | 31 | .init_early = imx25_init_early, |
| 43 | .init_machine = imx25_dt_init, | 32 | .init_machine = imx25_dt_init, |
| 44 | .init_late = imx25_pm_init, | 33 | .init_late = imx25_pm_init, |
| 45 | .init_irq = mx25_init_irq, | ||
| 46 | .dt_compat = imx25_dt_board_compat, | 34 | .dt_compat = imx25_dt_board_compat, |
| 47 | MACHINE_END | 35 | MACHINE_END |
| @@ -56,17 +56,6 @@ static void __init imx27_init_early(void) · 55 unmodified lines | |||
| 56 | mxc_set_cpu_type(MXC_CPU_MX27); | 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 | static const char * const imx27_dt_board_compat[] __initconst = { | 59 | static const char * const imx27_dt_board_compat[] __initconst = { |
| 71 | "fsl,imx27", | 60 | "fsl,imx27", |
| 72 | NULL | 61 | NULL |
| @@ -75,7 +64,6 @@ static const char * const imx27_dt_board_compat[] __initconst = { · 2 unmodified lines | |||
| 75 | DT_MACHINE_START(IMX27_DT, "Freescale i.MX27 (Device Tree Support)") | 64 | DT_MACHINE_START(IMX27_DT, "Freescale i.MX27 (Device Tree Support)") |
| 76 | .map_io = mx27_map_io, | 65 | .map_io = mx27_map_io, |
| 77 | .init_early = imx27_init_early, | 66 | .init_early = imx27_init_early, |
| 78 | .init_irq = mx27_init_irq, | ||
| 79 | .init_late = imx27_pm_init, | 67 | .init_late = imx27_pm_init, |
| 80 | .dt_compat = imx27_dt_board_compat, | 68 | .dt_compat = imx27_dt_board_compat, |
| 81 | MACHINE_END | 69 | MACHINE_END |
| @@ -14,6 +14,5 @@ static const char * const imx31_dt_board_compat[] __initconst = { · 13 unmodified lines | |||
| 14 | DT_MACHINE_START(IMX31_DT, "Freescale i.MX31 (Device Tree Support)") | 14 | DT_MACHINE_START(IMX31_DT, "Freescale i.MX31 (Device Tree Support)") |
| 15 | .map_io = mx31_map_io, | 15 | .map_io = mx31_map_io, |
| 16 | .init_early = imx31_init_early, | 16 | .init_early = imx31_init_early, |
| 17 | .init_irq = mx31_init_irq, | ||
| 18 | .dt_compat = imx31_dt_board_compat, | 17 | .dt_compat = imx31_dt_board_compat, |
| 19 | MACHINE_END | 18 | MACHINE_END |
| @@ -27,6 +27,5 @@ DT_MACHINE_START(IMX35_DT, "Freescale i.MX35 (Device Tree Support)") · 26 unmodified lines | |||
| 27 | .l2c_aux_mask = ~0, | 27 | .l2c_aux_mask = ~0, |
| 28 | .map_io = mx35_map_io, | 28 | .map_io = mx35_map_io, |
| 29 | .init_early = imx35_init_early, | 29 | .init_early = imx35_init_early, |
| 30 | .init_irq = mx35_init_irq, | ||
| 31 | .dt_compat = imx35_dt_board_compat, | 30 | .dt_compat = imx35_dt_board_compat, |
| 32 | MACHINE_END | 31 | MACHINE_END |
| @@ -109,18 +109,6 @@ void __init imx31_init_early(void) · 108 unmodified lines | |||
| 109 | mx3_ccm_base = of_iomap(np, 0); | 109 | mx3_ccm_base = of_iomap(np, 0); |
| 110 | BUG_ON(!mx3_ccm_base); | 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 | #endif /* ifdef CONFIG_SOC_IMX31 */ | 112 | #endif /* ifdef CONFIG_SOC_IMX31 */ |
| 125 | 113 | ||
| 126 | #ifdef CONFIG_SOC_IMX35 | 114 | #ifdef CONFIG_SOC_IMX35 |
| @@ -158,16 +146,4 @@ void __init imx35_init_early(void) · 31 unmodified lines | |||
| 158 | mx3_ccm_base = of_iomap(np, 0); | 146 | mx3_ccm_base = of_iomap(np, 0); |
| 159 | BUG_ON(!mx3_ccm_base); | 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 | #endif /* ifdef CONFIG_SOC_IMX35 */ | 149 | #endif /* ifdef CONFIG_SOC_IMX35 */ |
| @@ -65,7 +65,7 @@ static void __init keystone_init(void) · 64 unmodified lines | |||
| 65 | static long long __init keystone_pv_fixup(void) | 65 | static long long __init keystone_pv_fixup(void) |
| 66 | { | 66 | { |
| 67 | long long offset; | 67 | long long offset; |
| 68 | phys_addr_t mem_start, mem_end; | 68 | u64 mem_start, mem_end; |
| 69 | 69 | ||
| 70 | mem_start = memblock_start_of_DRAM(); | 70 | mem_start = memblock_start_of_DRAM(); |
| 71 | mem_end = memblock_end_of_DRAM(); | 71 | mem_end = memblock_end_of_DRAM(); |
| @@ -78,7 +78,7 @@ static long long __init keystone_pv_fixup(void) · 6 unmodified lines | |||
| 78 | if (mem_start < KEYSTONE_HIGH_PHYS_START || | 78 | if (mem_start < KEYSTONE_HIGH_PHYS_START || |
| 79 | mem_end > KEYSTONE_HIGH_PHYS_END) { | 79 | mem_end > KEYSTONE_HIGH_PHYS_END) { |
| 80 | pr_crit("Invalid address space for memory (%08llx-%08llx)\n", | 80 | pr_crit("Invalid address space for memory (%08llx-%08llx)\n", |
| 81 | (u64)mem_start, (u64)mem_end); | 81 | mem_start, mem_end); |
| 82 | return 0; | 82 | return 0; |
| 83 | } | 83 | } |
| 84 | 84 | ||
| @@ -15,6 +15,7 @@ · 14 unmodified lines | |||
| 15 | #include <linux/platform_data/gpio-omap.h> | 15 | #include <linux/platform_data/gpio-omap.h> |
| 16 | 16 | ||
| 17 | #include <asm/assembler.h> | 17 | #include <asm/assembler.h> |
| 18 | #include <asm/irq.h> | ||
| 18 | 19 | ||
| 19 | #include "ams-delta-fiq.h" | 20 | #include "ams-delta-fiq.h" |
| 20 | #include "board-ams-delta.h" | 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 | /* Clocks are needed early, see drivers/clocksource for the rest */ | 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 | omap_clk_init(); | 38 | omap_clk_init(); |
| 39 | timer_probe(); | 39 | timer_probe(); |
| @@ -9,6 +9,7 @@ · 8 unmodified lines | |||
| 9 | */ | 9 | */ |
| 10 | 10 | ||
| 11 | #include <linux/arm-smccc.h> | 11 | #include <linux/arm-smccc.h> |
| 12 | #include <linux/cpu_pm.h> | ||
| 12 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
| 13 | #include <linux/init.h> | 14 | #include <linux/init.h> |
| 14 | #include <linux/io.h> | 15 | #include <linux/io.h> |
| @@ -20,6 +21,7 @@ · 5 unmodified lines | |||
| 20 | 21 | ||
| 21 | #include "common.h" | 22 | #include "common.h" |
| 22 | #include "omap-secure.h" | 23 | #include "omap-secure.h" |
| 24 | #include "soc.h" | ||
| 23 | 25 | ||
| 24 | static phys_addr_t omap_secure_memblock_base; | 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 | omap_optee_init_check(); | 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 | #define OMAP5_DRA7_MON_SET_ACR_INDEX 0x107 | 50 | #define OMAP5_DRA7_MON_SET_ACR_INDEX 0x107 |
| 51 | 51 | ||
| 52 | /* Secure PPA(Primary Protected Application) APIs */ | 52 | /* Secure PPA(Primary Protected Application) APIs */ |
| 53 | #define OMAP4_PPA_SERVICE_0 0x21 | ||
| 53 | #define OMAP4_PPA_L2_POR_INDEX 0x23 | 54 | #define OMAP4_PPA_L2_POR_INDEX 0x23 |
| 54 | #define OMAP4_PPA_CPU_ACTRL_SMP_INDEX 0x25 | 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 | omap_voltage_register_pmic(voltdm, &omap443x_max8952_mpu); | 246 | omap_voltage_register_pmic(voltdm, &omap443x_max8952_mpu); |
| 247 | 247 | ||
| 248 | if (of_machine_is_compatible("motorola,droid-bionic")) { | 248 | if (of_machine_is_compatible("motorola,droid-bionic")) { |
| 249 | voltdm = voltdm_lookup("mpu"); | 249 | voltdm = voltdm_lookup("core"); |
| 250 | omap_voltage_register_pmic(voltdm, &omap_cpcap_core); | 250 | omap_voltage_register_pmic(voltdm, &omap_cpcap_core); |
| 251 | 251 | ||
| 252 | voltdm = voltdm_lookup("mpu"); | 252 | voltdm = voltdm_lookup("iva"); |
| 253 | omap_voltage_register_pmic(voltdm, &omap_cpcap_iva); | 253 | omap_voltage_register_pmic(voltdm, &omap_cpcap_iva); |
| 254 | } else { | 254 | } else { |
| 255 | voltdm = voltdm_lookup("core"); | 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 | extern struct omap_sr_data omap_sr_pdata[]; | 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 | struct omap_sr_data *sr_data = NULL; | 93 | struct omap_sr_data *sr_data = NULL; |
| 94 | struct omap_volt_data *volt_data; | 94 | struct omap_volt_data *volt_data; |
| 95 | struct omap_smartreflex_dev_attr *sr_dev_attr; | ||
| 96 | static int i; | 95 | static int i; |
| 97 | 96 | ||
| 98 | if (!strncmp(oh->name, "smartreflex_mpu_iva", 20) || | 97 | if (!strncmp(name, "smartreflex_mpu_iva", 20) || |
| 99 | !strncmp(oh->name, "smartreflex_mpu", 16)) | 98 | !strncmp(name, "smartreflex_mpu", 16)) |
| 100 | sr_data = &omap_sr_pdata[OMAP_SR_MPU]; | 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 | sr_data = &omap_sr_pdata[OMAP_SR_CORE]; | 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 | sr_data = &omap_sr_pdata[OMAP_SR_IVA]; | 103 | sr_data = &omap_sr_pdata[OMAP_SR_IVA]; |
| 105 | 104 | ||
| 106 | if (!sr_data) { | 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 | return -EINVAL; | 107 | return -EINVAL; |
| 109 | } | 108 | } |
| 110 | 109 | ||
| 111 | sr_dev_attr = (struct omap_smartreflex_dev_attr *)oh->dev_attr; | 110 | sr_data->name = name; |
| 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; | ||
| 119 | if (cpu_is_omap343x()) | 111 | if (cpu_is_omap343x()) |
| 120 | sr_data->ip_type = 1; | 112 | sr_data->ip_type = 1; |
| 121 | else | 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 | if (!sr_data->voltdm) { | 132 | if (!sr_data->voltdm) { |
| 141 | pr_err("%s: Unable to get voltage domain pointer for VDD %s\n", | 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 | goto exit; | 135 | goto exit; |
| 144 | } | 136 | } |
| 145 | 137 | ||
| @@ -160,6 +152,20 @@ exit: · 14 unmodified lines | |||
| 160 | return 0; | 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 | * API to be called from board files to enable smartreflex | 170 | * API to be called from board files to enable smartreflex |
| 165 | * autocompensation at init. | 171 | * autocompensation at init. |
| @@ -169,7 +175,42 @@ void __init omap_enable_smartreflex_on_init(void) · 3 unmodified lines | |||
| 169 | sr_enable_on_init = true; | 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 | int __init omap_devinit_smartreflex(void) | 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 | return omap_hwmod_for_each_by_class("smartreflex", sr_dev_init, NULL); | 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 | #endif | 502 | #endif |
| 503 | 503 | ||
| 504 | static int mst_pcmcia0_irqs[11] = { | 504 | static int mst_pcmcia0_irqs[11] = { |
| 505 | [0 ... 10] = -1, | 505 | [0 ... 4] = -1, |
| 506 | [5] = MAINSTONE_S0_CD_IRQ, | 506 | [5] = MAINSTONE_S0_CD_IRQ, |
| 507 | [6 ... 7] = -1, | ||
| 507 | [8] = MAINSTONE_S0_STSCHG_IRQ, | 508 | [8] = MAINSTONE_S0_STSCHG_IRQ, |
| 509 | [9] = -1, | ||
| 508 | [10] = MAINSTONE_S0_IRQ, | 510 | [10] = MAINSTONE_S0_IRQ, |
| 509 | }; | 511 | }; |
| 510 | 512 | ||
| 511 | static int mst_pcmcia1_irqs[11] = { | 513 | static int mst_pcmcia1_irqs[11] = { |
| 512 | [0 ... 10] = -1, | 514 | [0 ... 4] = -1, |
| 513 | [5] = MAINSTONE_S1_CD_IRQ, | 515 | [5] = MAINSTONE_S1_CD_IRQ, |
| 516 | [6 ... 7] = -1, | ||
| 514 | [8] = MAINSTONE_S1_STSCHG_IRQ, | 517 | [8] = MAINSTONE_S1_STSCHG_IRQ, |
| 518 | [9] = -1, | ||
| 515 | [10] = MAINSTONE_S1_IRQ, | 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 | pte_t *pte = pte_offset_fixmap(pmd_off_k(vaddr), vaddr); | 387 | pte_t *pte = pte_offset_fixmap(pmd_off_k(vaddr), vaddr); |
| 388 | 388 | ||
| 389 | /* Make sure fixmap region does not exceed available allocation. */ | 389 | /* Make sure fixmap region does not exceed available allocation. */ |
| 390 | BUILD_BUG_ON(FIXADDR_START + (__end_of_fixed_addresses * PAGE_SIZE) > | 390 | BUILD_BUG_ON(__fix_to_virt(__end_of_fixed_addresses) < FIXADDR_START); |
| 391 | FIXADDR_END); | ||
| 392 | BUG_ON(idx >= __end_of_fixed_addresses); | 391 | BUG_ON(idx >= __end_of_fixed_addresses); |
| 393 | 392 | ||
| 394 | /* we only support device mappings until pgprot_kernel has been set */ | 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 | phys_addr_t mem_end; | 235 | phys_addr_t mem_end; |
| 236 | phys_addr_t reg_start, reg_end; | 236 | phys_addr_t reg_start, reg_end; |
| 237 | unsigned int mem_max_regions; | 237 | unsigned int mem_max_regions; |
| 238 | bool first = true; | ||
| 238 | int num; | 239 | int num; |
| 239 | u64 i; | 240 | u64 i; |
| 240 | 241 | ||
| @@ -263,7 +264,7 @@ void __init pmsav7_adjust_lowmem_bounds(void) · 22 unmodified lines | |||
| 263 | #endif | 264 | #endif |
| 264 | 265 | ||
| 265 | for_each_mem_range(i, ®_start, ®_end) { | 266 | for_each_mem_range(i, ®_start, ®_end) { |
| 266 | if (i == 0) { | 267 | if (first) { |
| 267 | phys_addr_t phys_offset = PHYS_OFFSET; | 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 | mem_start = reg_start; | 276 | mem_start = reg_start; |
| 276 | mem_end = reg_end; | 277 | mem_end = reg_end; |
| 277 | specified_mem_size = mem_end - mem_start; | 278 | specified_mem_size = mem_end - mem_start; |
| 279 | first = false; | ||
| 278 | } else { | 280 | } else { |
| 279 | /* | 281 | /* |
| 280 | * memblock auto merges contiguous blocks, remove | 282 | * memblock auto merges contiguous blocks, remove |
| @@ -95,10 +95,11 @@ void __init pmsav8_adjust_lowmem_bounds(void) · 94 unmodified lines | |||
| 95 | { | 95 | { |
| 96 | phys_addr_t mem_end; | 96 | phys_addr_t mem_end; |
| 97 | phys_addr_t reg_start, reg_end; | 97 | phys_addr_t reg_start, reg_end; |
| 98 | bool first = true; | ||
| 98 | u64 i; | 99 | u64 i; |
| 99 | 100 | ||
| 100 | for_each_mem_range(i, ®_start, ®_end) { | 101 | for_each_mem_range(i, ®_start, ®_end) { |
| 101 | if (i == 0) { | 102 | if (first) { |
| 102 | phys_addr_t phys_offset = PHYS_OFFSET; | 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 | if (reg_start != phys_offset) | 108 | if (reg_start != phys_offset) |
| 108 | panic("First memory bank must be contiguous from PHYS_OFFSET"); | 109 | panic("First memory bank must be contiguous from PHYS_OFFSET"); |
| 109 | mem_end = reg_end; | 110 | mem_end = reg_end; |
| 111 | first = false; | ||
| 110 | } else { | 112 | } else { |
| 111 | /* | 113 | /* |
| 112 | * memblock auto merges contiguous blocks, remove | 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 | static struct undef_hook uprobes_arm_break_hook = { | 204 | static struct undef_hook uprobes_arm_break_hook = { |
| 205 | .instr_mask = 0x0fffffff, | 205 | .instr_mask = 0x0fffffff, |
| 206 | .instr_val = (UPROBE_SWBP_ARM_INSN & 0x0fffffff), | 206 | .instr_val = (UPROBE_SWBP_ARM_INSN & 0x0fffffff), |
| 207 | .cpsr_mask = MODE_MASK, | 207 | .cpsr_mask = (PSR_T_BIT | MODE_MASK), |
| 208 | .cpsr_val = USR_MODE, | 208 | .cpsr_val = USR_MODE, |
| 209 | .fn = uprobe_trap_handler, | 209 | .fn = uprobe_trap_handler, |
| 210 | }; | 210 | }; |
| @@ -212,7 +212,7 @@ static struct undef_hook uprobes_arm_break_hook = { · 1 unmodified line | |||
| 212 | static struct undef_hook uprobes_arm_ss_hook = { | 212 | static struct undef_hook uprobes_arm_ss_hook = { |
| 213 | .instr_mask = 0x0fffffff, | 213 | .instr_mask = 0x0fffffff, |
| 214 | .instr_val = (UPROBE_SS_ARM_INSN & 0x0fffffff), | 214 | .instr_val = (UPROBE_SS_ARM_INSN & 0x0fffffff), |
| 215 | .cpsr_mask = MODE_MASK, | 215 | .cpsr_mask = (PSR_T_BIT | MODE_MASK), |
| 216 | .cpsr_val = USR_MODE, | 216 | .cpsr_val = USR_MODE, |
| 217 | .fn = uprobe_trap_handler, | 217 | .fn = uprobe_trap_handler, |
| 218 | }; | 218 | }; |
| @@ -11,6 +11,7 @@ · 10 unmodified lines | |||
| 11 | 11 | ||
| 12 | #include <xen/xen.h> | 12 | #include <xen/xen.h> |
| 13 | #include <xen/interface/memory.h> | 13 | #include <xen/interface/memory.h> |
| 14 | #include <xen/grant_table.h> | ||
| 14 | #include <xen/page.h> | 15 | #include <xen/page.h> |
| 15 | #include <xen/swiotlb-xen.h> | 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 | map_ops[i].status = GNTST_general_error; | 110 | map_ops[i].status = GNTST_general_error; |
| 110 | unmap.host_addr = map_ops[i].host_addr, | 111 | unmap.host_addr = map_ops[i].host_addr, |
| 111 | unmap.handle = map_ops[i].handle; | 112 | unmap.handle = map_ops[i].handle; |
| 112 | map_ops[i].handle = ~0; | 113 | map_ops[i].handle = INVALID_GRANT_HANDLE; |
| 113 | if (map_ops[i].flags & GNTMAP_device_map) | 114 | if (map_ops[i].flags & GNTMAP_device_map) |
| 114 | unmap.dev_bus_addr = map_ops[i].dev_bus_addr; | 115 | unmap.dev_bus_addr = map_ops[i].dev_bus_addr; |
| 115 | else | 116 | else |
| @@ -130,7 +131,6 @@ int set_foreign_p2m_mapping(struct gnttab_map_grant_ref *map_ops, · 14 unmodified lines | |||
| 130 | 131 | ||
| 131 | return 0; | 132 | return 0; |
| 132 | } | 133 | } |
| 133 | EXPORT_SYMBOL_GPL(set_foreign_p2m_mapping); | ||
| 134 | 134 | ||
| 135 | int clear_foreign_p2m_mapping(struct gnttab_unmap_grant_ref *unmap_ops, | 135 | int clear_foreign_p2m_mapping(struct gnttab_unmap_grant_ref *unmap_ops, |
| 136 | struct gnttab_unmap_grant_ref *kunmap_ops, | 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 | return 0; | 146 | return 0; |
| 147 | } | 147 | } |
| 148 | EXPORT_SYMBOL_GPL(clear_foreign_p2m_mapping); | ||
| 149 | 148 | ||
| 150 | bool __set_phys_to_machine_multi(unsigned long pfn, | 149 | bool __set_phys_to_machine_multi(unsigned long pfn, |
| 151 | unsigned long mfn, unsigned long nr_pages) | 150 | unsigned long mfn, unsigned long nr_pages) |
| @@ -810,6 +810,16 @@ config QCOM_FALKOR_ERRATUM_E1041 · 809 unmodified lines | |||
| 810 | 810 | ||
| 811 | If unsure, say Y. | 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 | config SOCIONEXT_SYNQUACER_PREITS | 823 | config SOCIONEXT_SYNQUACER_PREITS |
| 814 | bool "Socionext Synquacer: Workaround for GICv3 pre-ITS" | 824 | bool "Socionext Synquacer: Workaround for GICv3 pre-ITS" |
| 815 | default y | 825 | default y |
| @@ -1055,8 +1065,6 @@ config HW_PERF_EVENTS · 239 unmodified lines | |||
| 1055 | config SYS_SUPPORTS_HUGETLBFS | 1065 | config SYS_SUPPORTS_HUGETLBFS |
| 1056 | def_bool y | 1066 | def_bool y |
| 1057 | 1067 | ||
| 1058 | config ARCH_WANT_HUGE_PMD_SHARE | ||
| 1059 | |||
| 1060 | config ARCH_HAS_CACHE_LINE_SIZE | 1068 | config ARCH_HAS_CACHE_LINE_SIZE |
| 1061 | def_bool y | 1069 | def_bool y |
| 1062 | 1070 | ||
| @@ -1157,8 +1165,8 @@ config XEN · 94 unmodified lines | |||
| 1157 | 1165 | ||
| 1158 | config FORCE_MAX_ZONEORDER | 1166 | config FORCE_MAX_ZONEORDER |
| 1159 | int | 1167 | int |
| 1160 | default "14" if (ARM64_64K_PAGES && TRANSPARENT_HUGEPAGE) | 1168 | default "14" if ARM64_64K_PAGES |
| 1161 | default "12" if (ARM64_16K_PAGES && TRANSPARENT_HUGEPAGE) | 1169 | default "12" if ARM64_16K_PAGES |
| 1162 | default "11" | 1170 | default "11" |
| 1163 | help | 1171 | help |
| 1164 | The kernel memory allocator divides physically contiguous memory | 1172 | The kernel memory allocator divides physically contiguous memory |
| @@ -1398,10 +1406,13 @@ config ARM64_PAN · 233 unmodified lines | |||
| 1398 | config AS_HAS_LDAPR | 1406 | config AS_HAS_LDAPR |
| 1399 | def_bool $(as-instr,.arch_extension rcpc) | 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 | config ARM64_LSE_ATOMICS | 1412 | config ARM64_LSE_ATOMICS |
| 1402 | bool | 1413 | bool |
| 1403 | default ARM64_USE_LSE_ATOMICS | 1414 | default ARM64_USE_LSE_ATOMICS |
| 1404 | depends on $(as-instr,.arch_extension lse) | 1415 | depends on AS_HAS_LSE_ATOMICS |
| 1405 | 1416 | ||
| 1406 | config ARM64_USE_LSE_ATOMICS | 1417 | config ARM64_USE_LSE_ATOMICS |
| 1407 | bool "Atomic instructions" | 1418 | bool "Atomic instructions" |
| @@ -1658,6 +1669,7 @@ config ARM64_MTE · 250 unmodified lines | |||
| 1658 | default y | 1669 | default y |
| 1659 | depends on ARM64_AS_HAS_MTE && ARM64_TAGGED_ADDR_ABI | 1670 | depends on ARM64_AS_HAS_MTE && ARM64_TAGGED_ADDR_ABI |
| 1660 | depends on AS_HAS_ARMV8_5 | 1671 | depends on AS_HAS_ARMV8_5 |
| 1672 | depends on AS_HAS_LSE_ATOMICS | ||
| 1661 | # Required for tag checking in the uaccess routines | 1673 | # Required for tag checking in the uaccess routines |
| 1662 | depends on ARM64_PAN | 1674 | depends on ARM64_PAN |
| 1663 | select ARCH_USES_HIGH_VMA_FLAGS | 1675 | select ARCH_USES_HIGH_VMA_FLAGS |
| @@ -1855,12 +1867,6 @@ config CMDLINE_FROM_BOOTLOADER · 191 unmodified lines | |||
| 1855 | the boot loader doesn't provide any, the default kernel command | 1867 | the boot loader doesn't provide any, the default kernel command |
| 1856 | string provided in CMDLINE will be used. | 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 | config CMDLINE_FORCE | 1870 | config CMDLINE_FORCE |
| 1865 | bool "Always use the default kernel command string" | 1871 | bool "Always use the default kernel command string" |
| 1866 | help | 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 | vmmc-supply = <®_dcdc1>; | 34 | vmmc-supply = <®_dcdc1>; |
| 35 | disable-wp; | 35 | disable-wp; |
| 36 | bus-width = <4>; | 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 | status = "okay"; | 38 | status = "okay"; |
| 39 | }; | 39 | }; |
| 40 | 40 | ||
| @@ -289,10 +289,6 @@ · 288 unmodified lines | |||
| 289 | vcc-pm-supply = <®_aldo1>; | 289 | vcc-pm-supply = <®_aldo1>; |
| 290 | }; | 290 | }; |
| 291 | 291 | ||
| 292 | &rtc { | ||
| 293 | clocks = <&ext_osc32k>; | ||
| 294 | }; | ||
| 295 | |||
| 296 | &spdif { | 292 | &spdif { |
| 297 | status = "okay"; | 293 | status = "okay"; |
| 298 | }; | 294 | }; |
| @@ -995,9 +995,9 @@ · 994 unmodified lines | |||
| 995 | compatible = "allwinner,sun8i-a23-rsb"; | 995 | compatible = "allwinner,sun8i-a23-rsb"; |
| 996 | reg = <0x07083000 0x400>; | 996 | reg = <0x07083000 0x400>; |
| 997 | interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>; | 997 | interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>; |
| 998 | clocks = <&r_ccu 13>; | 998 | clocks = <&r_ccu CLK_R_APB2_RSB>; |
| 999 | clock-frequency = <3000000>; | 999 | clock-frequency = <3000000>; |
| 1000 | resets = <&r_ccu 7>; | 1000 | resets = <&r_ccu RST_R_APB2_RSB>; |
| 1001 | pinctrl-names = "default"; | 1001 | pinctrl-names = "default"; |
| 1002 | pinctrl-0 = <&r_rsb_pins>; | 1002 | pinctrl-0 = <&r_rsb_pins>; |
| 1003 | status = "disabled"; | 1003 | status = "disabled"; |
| @@ -198,6 +198,7 @@ · 197 unmodified lines | |||
| 198 | ranges = <0x0 0x00 0x1700000 0x100000>; | 198 | ranges = <0x0 0x00 0x1700000 0x100000>; |
| 199 | reg = <0x00 0x1700000 0x0 0x100000>; | 199 | reg = <0x00 0x1700000 0x0 0x100000>; |
| 200 | interrupts = <GIC_SPI 75 IRQ_TYPE_LEVEL_HIGH>; | 200 | interrupts = <GIC_SPI 75 IRQ_TYPE_LEVEL_HIGH>; |
| 201 | dma-coherent; | ||
| 201 | 202 | ||
| 202 | sec_jr0: jr@10000 { | 203 | sec_jr0: jr@10000 { |
| 203 | compatible = "fsl,sec-v5.4-job-ring", | 204 | compatible = "fsl,sec-v5.4-job-ring", |
| @@ -348,6 +348,7 @@ · 347 unmodified lines | |||
| 348 | ranges = <0x0 0x00 0x1700000 0x100000>; | 348 | ranges = <0x0 0x00 0x1700000 0x100000>; |
| 349 | reg = <0x00 0x1700000 0x0 0x100000>; | 349 | reg = <0x00 0x1700000 0x0 0x100000>; |
| 350 | interrupts = <0 75 0x4>; | 350 | interrupts = <0 75 0x4>; |
| 351 | dma-coherent; | ||
| 351 | 352 | ||
| 352 | sec_jr0: jr@10000 { | 353 | sec_jr0: jr@10000 { |
| 353 | compatible = "fsl,sec-v5.4-job-ring", | 354 | compatible = "fsl,sec-v5.4-job-ring", |
| @@ -354,6 +354,7 @@ · 353 unmodified lines | |||
| 354 | ranges = <0x0 0x00 0x1700000 0x100000>; | 354 | ranges = <0x0 0x00 0x1700000 0x100000>; |
| 355 | reg = <0x00 0x1700000 0x0 0x100000>; | 355 | reg = <0x00 0x1700000 0x0 0x100000>; |
| 356 | interrupts = <GIC_SPI 75 IRQ_TYPE_LEVEL_HIGH>; | 356 | interrupts = <GIC_SPI 75 IRQ_TYPE_LEVEL_HIGH>; |
| 357 | dma-coherent; | ||
| 357 | 358 | ||
| 358 | sec_jr0: jr@10000 { | 359 | sec_jr0: jr@10000 { |
| 359 | compatible = "fsl,sec-v5.4-job-ring", | 360 | compatible = "fsl,sec-v5.4-job-ring", |
| @@ -124,7 +124,7 @@ · 123 unmodified lines | |||
| 124 | #define MX8MM_IOMUXC_SD1_CMD_USDHC1_CMD 0x0A4 0x30C 0x000 0x0 0x0 | 124 | #define MX8MM_IOMUXC_SD1_CMD_USDHC1_CMD 0x0A4 0x30C 0x000 0x0 0x0 |
| 125 | #define MX8MM_IOMUXC_SD1_CMD_GPIO2_IO1 0x0A4 0x30C 0x000 0x5 0x0 | 125 | #define MX8MM_IOMUXC_SD1_CMD_GPIO2_IO1 0x0A4 0x30C 0x000 0x5 0x0 |
| 126 | #define MX8MM_IOMUXC_SD1_DATA0_USDHC1_DATA0 0x0A8 0x310 0x000 0x0 0x0 | 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 | #define MX8MM_IOMUXC_SD1_DATA1_USDHC1_DATA1 0x0AC 0x314 0x000 0x0 0x0 | 128 | #define MX8MM_IOMUXC_SD1_DATA1_USDHC1_DATA1 0x0AC 0x314 0x000 0x0 0x0 |
| 129 | #define MX8MM_IOMUXC_SD1_DATA1_GPIO2_IO3 0x0AC 0x314 0x000 0x5 0x0 | 129 | #define MX8MM_IOMUXC_SD1_DATA1_GPIO2_IO3 0x0AC 0x314 0x000 0x5 0x0 |
| 130 | #define MX8MM_IOMUXC_SD1_DATA2_USDHC1_DATA2 0x0B0 0x318 0x000 0x0 0x0 | 130 | #define MX8MM_IOMUXC_SD1_DATA2_USDHC1_DATA2 0x0B0 0x318 0x000 0x0 0x0 |
| @@ -35,7 +35,7 @@ · 34 unmodified lines | |||
| 35 | 35 | ||
| 36 | &i2c2 { | 36 | &i2c2 { |
| 37 | clock-frequency = <400000>; | 37 | clock-frequency = <400000>; |
| 38 | pinctrl-names = "default"; | 38 | pinctrl-names = "default", "gpio"; |
| 39 | pinctrl-0 = <&pinctrl_i2c2>; | 39 | pinctrl-0 = <&pinctrl_i2c2>; |
| 40 | pinctrl-1 = <&pinctrl_i2c2_gpio>; | 40 | pinctrl-1 = <&pinctrl_i2c2_gpio>; |
| 41 | sda-gpios = <&gpio5 17 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; | 41 | sda-gpios = <&gpio5 17 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; |
| @@ -67,7 +67,7 @@ · 66 unmodified lines | |||
| 67 | 67 | ||
| 68 | &i2c1 { | 68 | &i2c1 { |
| 69 | clock-frequency = <400000>; | 69 | clock-frequency = <400000>; |
| 70 | pinctrl-names = "default"; | 70 | pinctrl-names = "default", "gpio"; |
| 71 | pinctrl-0 = <&pinctrl_i2c1>; | 71 | pinctrl-0 = <&pinctrl_i2c1>; |
| 72 | pinctrl-1 = <&pinctrl_i2c1_gpio>; | 72 | pinctrl-1 = <&pinctrl_i2c1_gpio>; |
| 73 | sda-gpios = <&gpio5 15 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; | 73 | sda-gpios = <&gpio5 15 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; |
| @@ -130,7 +130,7 @@ · 129 unmodified lines | |||
| 130 | #define MX8MQ_IOMUXC_SD1_CMD_USDHC1_CMD 0x0A4 0x30C 0x000 0x0 0x0 | 130 | #define MX8MQ_IOMUXC_SD1_CMD_USDHC1_CMD 0x0A4 0x30C 0x000 0x0 0x0 |
| 131 | #define MX8MQ_IOMUXC_SD1_CMD_GPIO2_IO1 0x0A4 0x30C 0x000 0x5 0x0 | 131 | #define MX8MQ_IOMUXC_SD1_CMD_GPIO2_IO1 0x0A4 0x30C 0x000 0x5 0x0 |
| 132 | #define MX8MQ_IOMUXC_SD1_DATA0_USDHC1_DATA0 0x0A8 0x310 0x000 0x0 0x0 | 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 | #define MX8MQ_IOMUXC_SD1_DATA1_USDHC1_DATA1 0x0AC 0x314 0x000 0x0 0x0 | 134 | #define MX8MQ_IOMUXC_SD1_DATA1_USDHC1_DATA1 0x0AC 0x314 0x000 0x0 0x0 |
| 135 | #define MX8MQ_IOMUXC_SD1_DATA1_GPIO2_IO3 0x0AC 0x314 0x000 0x5 0x0 | 135 | #define MX8MQ_IOMUXC_SD1_DATA1_GPIO2_IO3 0x0AC 0x314 0x000 0x5 0x0 |
| 136 | #define MX8MQ_IOMUXC_SD1_DATA2_USDHC1_DATA2 0x0B0 0x318 0x000 0x0 0x0 | 136 | #define MX8MQ_IOMUXC_SD1_DATA2_USDHC1_DATA2 0x0B0 0x318 0x000 0x0 0x0 |
| @@ -1,7 +1,7 @@ | |||
| 1 | // SPDX-License-Identifier: (GPL-2.0+ OR MIT) | 1 | // SPDX-License-Identifier: (GPL-2.0+ OR MIT) |
| 2 | /* | 2 | /* |
| 3 | * Device Tree file for CZ.NIC Turris Mox Board | 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 | /dts-v1/; | 7 | /dts-v1/; |
| @@ -310,9 +310,11 @@ · 309 unmodified lines | |||
| 310 | }; | 310 | }; |
| 311 | 311 | ||
| 312 | CP11X_LABEL(sata0): sata@540000 { | 312 | CP11X_LABEL(sata0): sata@540000 { |
| 313 | compatible = "marvell,armada-8k-ahci"; | 313 | compatible = "marvell,armada-8k-ahci", |
| 314 | "generic-ahci"; | ||
| 314 | reg = <0x540000 0x30000>; | 315 | reg = <0x540000 0x30000>; |
| 315 | dma-coherent; | 316 | dma-coherent; |
| 317 | interrupts = <107 IRQ_TYPE_LEVEL_HIGH>; | ||
| 316 | clocks = <&CP11X_LABEL(clk) 1 15>, | 318 | clocks = <&CP11X_LABEL(clk) 1 15>, |
| 317 | <&CP11X_LABEL(clk) 1 16>; | 319 | <&CP11X_LABEL(clk) 1 16>; |
| 318 | #address-cells = <1>; | 320 | #address-cells = <1>; |
| @@ -320,12 +322,10 @@ · 1 unmodified line | |||
| 320 | status = "disabled"; | 322 | status = "disabled"; |
| 321 | 323 | ||
| 322 | sata-port@0 { | 324 | sata-port@0 { |
| 323 | interrupts = <109 IRQ_TYPE_LEVEL_HIGH>; | ||
| 324 | reg = <0>; | 325 | reg = <0>; |
| 325 | }; | 326 | }; |
| 326 | 327 | ||
| 327 | sata-port@1 { | 328 | sata-port@1 { |
| 328 | interrupts = <107 IRQ_TYPE_LEVEL_HIGH>; | ||
| 329 | reg = <1>; | 329 | reg = <1>; |
| 330 | }; | 330 | }; |
| 331 | }; | 331 | }; |
| @@ -97,9 +97,9 @@ · 96 unmodified lines | |||
| 97 | .popsection | 97 | .popsection |
| 98 | .subsection 1 | 98 | .subsection 1 |
| 99 | 663: \insn2 | 99 | 663: \insn2 |
| 100 | 664: .previous | 100 | 664: .org . - (664b-663b) + (662b-661b) |
| 101 | .org . - (664b-663b) + (662b-661b) | ||
| 102 | .org . - (662b-661b) + (664b-663b) | 101 | .org . - (662b-661b) + (664b-663b) |
| 102 | .previous | ||
| 103 | .endif | 103 | .endif |
| 104 | .endm | 104 | .endm |
| 105 | 105 | ||
| @@ -169,11 +169,11 @@ · 63 unmodified lines | |||
| 169 | */ | 169 | */ |
| 170 | .macro alternative_endif | 170 | .macro alternative_endif |
| 171 | 664: | 171 | 664: |
| 172 | .org . - (664b-663b) + (662b-661b) | ||
| 173 | .org . - (662b-661b) + (664b-663b) | ||
| 172 | .if .Lasm_alt_mode==0 | 174 | .if .Lasm_alt_mode==0 |
| 173 | .previous | 175 | .previous |
| 174 | .endif | 176 | .endif |
| 175 | .org . - (664b-663b) + (662b-661b) | ||
| 176 | .org . - (662b-661b) + (664b-663b) | ||
| 177 | .endm | 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 | } while (--n > 0); | 37 | } while (--n > 0); |
| 38 | 38 | ||
| 39 | sum += ((sum >> 32) | (sum << 32)); | 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 | #define ip_fast_csum ip_fast_csum | 42 | #define ip_fast_csum ip_fast_csum |
| 43 | 43 | ||
| @@ -66,7 +66,8 @@ · 65 unmodified lines | |||
| 66 | #define ARM64_WORKAROUND_1508412 58 | 66 | #define ARM64_WORKAROUND_1508412 58 |
| 67 | #define ARM64_HAS_LDAPR 59 | 67 | #define ARM64_HAS_LDAPR 59 |
| 68 | #define ARM64_KVM_PROTECTED_MODE 60 | 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 | #endif /* __ASM_CPUCAPS_H */ | 73 | #endif /* __ASM_CPUCAPS_H */ |
| @@ -278,6 +278,7 @@ · 277 unmodified lines | |||
| 278 | #define CPTR_EL2_DEFAULT CPTR_EL2_RES1 | 278 | #define CPTR_EL2_DEFAULT CPTR_EL2_RES1 |
| 279 | 279 | ||
| 280 | /* Hyp Debug Configuration Register bits */ | 280 | /* Hyp Debug Configuration Register bits */ |
| 281 | #define MDCR_EL2_TTRF (1 << 19) | ||
| 281 | #define MDCR_EL2_TPMS (1 << 14) | 282 | #define MDCR_EL2_TPMS (1 << 14) |
| 282 | #define MDCR_EL2_E2PB_MASK (UL(0x3)) | 283 | #define MDCR_EL2_E2PB_MASK (UL(0x3)) |
| 283 | #define MDCR_EL2_E2PB_SHIFT (UL(12)) | 284 | #define MDCR_EL2_E2PB_SHIFT (UL(12)) |
| @@ -47,10 +47,10 @@ · 46 unmodified lines | |||
| 47 | #define __KVM_HOST_SMCCC_FUNC___kvm_flush_vm_context 2 | 47 | #define __KVM_HOST_SMCCC_FUNC___kvm_flush_vm_context 2 |
| 48 | #define __KVM_HOST_SMCCC_FUNC___kvm_tlb_flush_vmid_ipa 3 | 48 | #define __KVM_HOST_SMCCC_FUNC___kvm_tlb_flush_vmid_ipa 3 |
| 49 | #define __KVM_HOST_SMCCC_FUNC___kvm_tlb_flush_vmid 4 | 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 | #define __KVM_HOST_SMCCC_FUNC___kvm_timer_set_cntvoff 6 | 51 | #define __KVM_HOST_SMCCC_FUNC___kvm_timer_set_cntvoff 6 |
| 52 | #define __KVM_HOST_SMCCC_FUNC___kvm_enable_ssbs 7 | 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 | #define __KVM_HOST_SMCCC_FUNC___vgic_v3_read_vmcr 9 | 54 | #define __KVM_HOST_SMCCC_FUNC___vgic_v3_read_vmcr 9 |
| 55 | #define __KVM_HOST_SMCCC_FUNC___vgic_v3_write_vmcr 10 | 55 | #define __KVM_HOST_SMCCC_FUNC___vgic_v3_write_vmcr 10 |
| 56 | #define __KVM_HOST_SMCCC_FUNC___vgic_v3_init_lrs 11 | 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 | #define __bp_harden_hyp_vecs CHOOSE_HYP_SYM(__bp_harden_hyp_vecs) | 183 | #define __bp_harden_hyp_vecs CHOOSE_HYP_SYM(__bp_harden_hyp_vecs) |
| 184 | 184 | ||
| 185 | extern void __kvm_flush_vm_context(void); | 185 | extern void __kvm_flush_vm_context(void); |
| 186 | extern void __kvm_flush_cpu_context(struct kvm_s2_mmu *mmu); | ||
| 186 | extern void __kvm_tlb_flush_vmid_ipa(struct kvm_s2_mmu *mmu, phys_addr_t ipa, | 187 | extern void __kvm_tlb_flush_vmid_ipa(struct kvm_s2_mmu *mmu, phys_addr_t ipa, |
| 187 | int level); | 188 | int level); |
| 188 | extern void __kvm_tlb_flush_vmid(struct kvm_s2_mmu *mmu); | 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 | extern void __kvm_timer_set_cntvoff(u64 cntvoff); | 191 | extern void __kvm_timer_set_cntvoff(u64 cntvoff); |
| 192 | 192 | ||
| 193 | extern int __kvm_vcpu_run(struct kvm_vcpu *vcpu); | 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 | extern u64 __vgic_v3_read_vmcr(void); | 196 | extern u64 __vgic_v3_read_vmcr(void); |
| 197 | extern void __vgic_v3_write_vmcr(u32 vmcr); | 197 | extern void __vgic_v3_write_vmcr(u32 vmcr); |
| 198 | extern void __vgic_v3_init_lrs(void); | 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 | void __debug_switch_to_guest(struct kvm_vcpu *vcpu); | 83 | void __debug_switch_to_guest(struct kvm_vcpu *vcpu); |
| 84 | void __debug_switch_to_host(struct kvm_vcpu *vcpu); | 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 | void __fpsimd_save_state(struct user_fpsimd_state *fp_regs); | 91 | void __fpsimd_save_state(struct user_fpsimd_state *fp_regs); |
| 87 | void __fpsimd_restore_state(struct user_fpsimd_state *fp_regs); | 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 | void __noreturn hyp_panic(void); | 103 | void __noreturn hyp_panic(void); |
| 99 | #ifdef __KVM_NVHE_HYPERVISOR__ | 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 | #endif | 107 | #endif |
| 102 | 108 | ||
| 103 | #endif /* __ARM64_KVM_HYP_H__ */ | 109 | #endif /* __ARM64_KVM_HYP_H__ */ |
| @@ -328,6 +328,11 @@ static inline void *phys_to_virt(phys_addr_t x) · 327 unmodified lines | |||
| 328 | #define ARCH_PFN_OFFSET ((unsigned long)PHYS_PFN_OFFSET) | 328 | #define ARCH_PFN_OFFSET ((unsigned long)PHYS_PFN_OFFSET) |
| 329 | 329 | ||
| 330 | #if !defined(CONFIG_SPARSEMEM_VMEMMAP) || defined(CONFIG_DEBUG_VIRTUAL) | 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 | #define virt_to_page(x) pfn_to_page(virt_to_pfn(x)) | 336 | #define virt_to_page(x) pfn_to_page(virt_to_pfn(x)) |
| 332 | #else | 337 | #else |
| 333 | #define page_to_virt(x) ({ \ | 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 | extern u64 idmap_t0sz; | 63 | extern u64 idmap_t0sz; |
| 64 | extern u64 idmap_ptrs_per_pgd; | 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 | * Ensure TCR.T0SZ is set to the provided value. | 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 | #define _PAGE_DEFAULT (_PROT_DEFAULT | PTE_ATTRINDX(MT_NORMAL)) | 66 | #define _PAGE_DEFAULT (_PROT_DEFAULT | PTE_ATTRINDX(MT_NORMAL)) |
| 67 | 67 | ||
| 68 | #define PAGE_KERNEL __pgprot(PROT_NORMAL) | 68 | #define PAGE_KERNEL __pgprot(PROT_NORMAL) |
| 69 | #define PAGE_KERNEL_TAGGED __pgprot(PROT_NORMAL_TAGGED) | ||
| 70 | #define PAGE_KERNEL_RO __pgprot((PROT_NORMAL & ~PTE_WRITE) | PTE_RDONLY) | 69 | #define PAGE_KERNEL_RO __pgprot((PROT_NORMAL & ~PTE_WRITE) | PTE_RDONLY) |
| 71 | #define PAGE_KERNEL_ROX __pgprot((PROT_NORMAL & ~(PTE_WRITE | PTE_PXN)) | PTE_RDONLY) | 70 | #define PAGE_KERNEL_ROX __pgprot((PROT_NORMAL & ~(PTE_WRITE | PTE_PXN)) | PTE_RDONLY) |
| 72 | #define PAGE_KERNEL_EXEC __pgprot(PROT_NORMAL & ~PTE_PXN) | 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 | __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_NORMAL_NC) | PTE_PXN | PTE_UXN) | 486 | __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_NORMAL_NC) | PTE_PXN | PTE_UXN) |
| 487 | #define pgprot_device(prot) \ | 487 | #define pgprot_device(prot) \ |
| 488 | __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_DEVICE_nGnRE) | PTE_PXN | PTE_UXN) | 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 | * DMA allocations for non-coherent devices use what the Arm architecture calls | 493 | * DMA allocations for non-coherent devices use what the Arm architecture calls |
| 491 | * "Normal non-cacheable" memory, which permits speculation, unaligned accesses | 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 | extern struct task_struct *cpu_switch_to(struct task_struct *prev, | 251 | extern struct task_struct *cpu_switch_to(struct task_struct *prev, |
| 252 | struct task_struct *next); | 252 | struct task_struct *next); |
| 253 | 253 | ||
| 254 | asmlinkage void arm64_preempt_schedule_irq(void); | ||
| 255 | |||
| 254 | #define task_pt_regs(p) \ | 256 | #define task_pt_regs(p) \ |
| 255 | ((struct pt_regs *)(THREAD_SIZE + task_stack_page(p)) - 1) | 257 | ((struct pt_regs *)(THREAD_SIZE + task_stack_page(p)) - 1) |
| 256 | 258 | ||
| @@ -796,6 +796,11 @@ · 795 unmodified lines | |||
| 796 | #define ID_AA64MMFR0_PARANGE_48 0x5 | 796 | #define ID_AA64MMFR0_PARANGE_48 0x5 |
| 797 | #define ID_AA64MMFR0_PARANGE_52 0x6 | 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 | #ifdef CONFIG_ARM64_PA_BITS_52 | 804 | #ifdef CONFIG_ARM64_PA_BITS_52 |
| 800 | #define ID_AA64MMFR0_PARANGE_MAX ID_AA64MMFR0_PARANGE_52 | 805 | #define ID_AA64MMFR0_PARANGE_MAX ID_AA64MMFR0_PARANGE_52 |
| 801 | #else | 806 | #else |
| @@ -961,14 +966,17 @@ · 159 unmodified lines | |||
| 961 | #define ID_PFR1_PROGMOD_SHIFT 0 | 966 | #define ID_PFR1_PROGMOD_SHIFT 0 |
| 962 | 967 | ||
| 963 | #if defined(CONFIG_ARM64_4K_PAGES) | 968 | #if defined(CONFIG_ARM64_4K_PAGES) |
| 964 | #define ID_AA64MMFR0_TGRAN_SHIFT ID_AA64MMFR0_TGRAN4_SHIFT | 969 | #define ID_AA64MMFR0_TGRAN_SHIFT ID_AA64MMFR0_TGRAN4_SHIFT |
| 965 | #define ID_AA64MMFR0_TGRAN_SUPPORTED ID_AA64MMFR0_TGRAN4_SUPPORTED | 970 | #define ID_AA64MMFR0_TGRAN_SUPPORTED_MIN ID_AA64MMFR0_TGRAN4_SUPPORTED |
| 971 | #define ID_AA64MMFR0_TGRAN_SUPPORTED_MAX 0x7 | ||
| 966 | #elif defined(CONFIG_ARM64_16K_PAGES) | 972 | #elif defined(CONFIG_ARM64_16K_PAGES) |
| 967 | #define ID_AA64MMFR0_TGRAN_SHIFT ID_AA64MMFR0_TGRAN16_SHIFT | 973 | #define ID_AA64MMFR0_TGRAN_SHIFT ID_AA64MMFR0_TGRAN16_SHIFT |
| 968 | #define ID_AA64MMFR0_TGRAN_SUPPORTED ID_AA64MMFR0_TGRAN16_SUPPORTED | 974 | #define ID_AA64MMFR0_TGRAN_SUPPORTED_MIN ID_AA64MMFR0_TGRAN16_SUPPORTED |
| 975 | #define ID_AA64MMFR0_TGRAN_SUPPORTED_MAX 0xF | ||
| 969 | #elif defined(CONFIG_ARM64_64K_PAGES) | 976 | #elif defined(CONFIG_ARM64_64K_PAGES) |
| 970 | #define ID_AA64MMFR0_TGRAN_SHIFT ID_AA64MMFR0_TGRAN64_SHIFT | 977 | #define ID_AA64MMFR0_TGRAN_SHIFT ID_AA64MMFR0_TGRAN64_SHIFT |
| 971 | #define ID_AA64MMFR0_TGRAN_SUPPORTED ID_AA64MMFR0_TGRAN64_SUPPORTED | 978 | #define ID_AA64MMFR0_TGRAN_SUPPORTED_MIN ID_AA64MMFR0_TGRAN64_SUPPORTED |
| 979 | #define ID_AA64MMFR0_TGRAN_SUPPORTED_MAX 0x7 | ||
| 972 | #endif | 980 | #endif |
| 973 | 981 | ||
| 974 | #define MVFR2_FPMISC_SHIFT 4 | 982 | #define MVFR2_FPMISC_SHIFT 4 |
| @@ -55,6 +55,8 @@ void arch_setup_new_exec(void); · 54 unmodified lines | |||
| 55 | #define arch_setup_new_exec arch_setup_new_exec | 55 | #define arch_setup_new_exec arch_setup_new_exec |
| 56 | 56 | ||
| 57 | void arch_release_task_struct(struct task_struct *tsk); | 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 | #endif | 61 | #endif |
| 60 | 62 | ||
| @@ -53,7 +53,7 @@ static inline unsigned long find_zero(unsigned long mask) · 52 unmodified lines | |||
| 53 | */ | 53 | */ |
| 54 | static inline unsigned long load_unaligned_zeropad(const void *addr) | 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 | /* Load word from unaligned pointer addr */ | 58 | /* Load word from unaligned pointer addr */ |
| 59 | asm( | 59 | asm( |
| @@ -61,9 +61,9 @@ static inline unsigned long load_unaligned_zeropad(const void *addr) · 1 unmodified line | |||
| 61 | "2:\n" | 61 | "2:\n" |
| 62 | " .pushsection .fixup,\"ax\"\n" | 62 | " .pushsection .fixup,\"ax\"\n" |
| 63 | " .align 2\n" | 63 | " .align 2\n" |
| 64 | "3: and %1, %2, #0x7\n" | 64 | "3: bic %1, %2, #0x7\n" |
| 65 | " bic %2, %2, #0x7\n" | 65 | " ldr %0, [%1]\n" |
| 66 | " ldr %0, [%2]\n" | 66 | " and %1, %2, #0x7\n" |
| 67 | " lsl %1, %1, #0x3\n" | 67 | " lsl %1, %1, #0x3\n" |
| 68 | #ifndef __AARCH64EB__ | 68 | #ifndef __AARCH64EB__ |
| 69 | " lsr %0, %0, %1\n" | 69 | " lsr %0, %0, %1\n" |
| @@ -73,7 +73,7 @@ static inline unsigned long load_unaligned_zeropad(const void *addr) · 3 unmodified lines | |||
| 73 | " b 2b\n" | 73 | " b 2b\n" |
| 74 | " .popsection\n" | 74 | " .popsection\n" |
| 75 | _ASM_EXTABLE(1b, 3b) | 75 | _ASM_EXTABLE(1b, 3b) |
| 76 | : "=&r" (ret), "=&r" (offset) | 76 | : "=&r" (ret), "=&r" (tmp) |
| 77 | : "r" (addr), "Q" (*(unsigned long *)addr)); | 77 | : "r" (addr), "Q" (*(unsigned long *)addr)); |
| 78 | 78 | ||
| 79 | return ret; | 79 | return ret; |
| @@ -525,6 +525,14 @@ const struct arm64_cpu_capabilities arm64_errata[] = { · 524 unmodified lines | |||
| 525 | 0, 0, | 525 | 0, 0, |
| 526 | 1, 0), | 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 | #endif | 536 | #endif |
| 529 | { | 537 | { |
| 530 | } | 538 | } |
| @@ -383,7 +383,6 @@ static const struct arm64_ftr_bits ftr_id_aa64dfr0[] = { · 382 unmodified lines | |||
| 383 | * of support. | 383 | * of support. |
| 384 | */ | 384 | */ |
| 385 | S_ARM64_FTR_BITS(FTR_HIDDEN, FTR_NONSTRICT, FTR_EXACT, ID_AA64DFR0_PMUVER_SHIFT, 4, 0), | 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 | ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_EXACT, ID_AA64DFR0_DEBUGVER_SHIFT, 4, 0x6), | 386 | ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_EXACT, ID_AA64DFR0_DEBUGVER_SHIFT, 4, 0x6), |
| 388 | ARM64_FTR_END, | 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 | * may share TLB entries with a CPU stuck in the crashed | 1320 | * may share TLB entries with a CPU stuck in the crashed |
| 1322 | * kernel. | 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 | return false; | 1327 | return false; |
| 1326 | 1328 | ||
| 1327 | return has_cpuid_feature(entry, scope); | 1329 | return has_cpuid_feature(entry, scope); |
| @@ -353,7 +353,7 @@ static void __cpuinfo_store_cpu(struct cpuinfo_arm64 *info) · 352 unmodified lines | |||
| 353 | * with the CLIDR_EL1 fields to avoid triggering false warnings | 353 | * with the CLIDR_EL1 fields to avoid triggering false warnings |
| 354 | * when there is a mismatch across the CPUs. Keep track of the | 354 | * when there is a mismatch across the CPUs. Keep track of the |
| 355 | * effective value of the CTR_EL0 in our internal records for | 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 | info->reg_ctr = read_cpuid_effective_cachetype(); | 358 | info->reg_ctr = read_cpuid_effective_cachetype(); |
| 359 | info->reg_dczid = read_cpuid(DCZID_EL0); | 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 | ssize_t elfcorehdr_read(char *buf, size_t count, u64 *ppos) | 64 | ssize_t elfcorehdr_read(char *buf, size_t count, u64 *ppos) |
| 65 | { | 65 | { |
| 66 | memcpy(buf, phys_to_virt((phys_addr_t)*ppos), count); | 66 | memcpy(buf, phys_to_virt((phys_addr_t)*ppos), count); |
| 67 | *ppos += count; | ||
| 68 | |||
| 67 | return count; | 69 | return count; |
| 68 | } | 70 | } |
| @@ -148,16 +148,18 @@ alternative_cb_end · 147 unmodified lines | |||
| 148 | .endm | 148 | .endm |
| 149 | 149 | ||
| 150 | /* Check for MTE asynchronous tag check faults */ | 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 | #ifdef CONFIG_ARM64_MTE | 152 | #ifdef CONFIG_ARM64_MTE |
| 153 | .arch_extension lse | ||
| 153 | alternative_if_not ARM64_MTE | 154 | alternative_if_not ARM64_MTE |
| 154 | b 1f | 155 | b 1f |
| 155 | alternative_else_nop_endif | 156 | alternative_else_nop_endif |
| 156 | mrs_s \tmp, SYS_TFSRE0_EL1 | 157 | mrs_s \tmp, SYS_TFSRE0_EL1 |
| 157 | tbz \tmp, #SYS_TFSR_EL1_TF0_SHIFT, 1f | 158 | tbz \tmp, #SYS_TFSR_EL1_TF0_SHIFT, 1f |
| 158 | /* Asynchronous TCF occurred for TTBR0 access, set the TI flag */ | 159 | /* Asynchronous TCF occurred for TTBR0 access, set the TI flag */ |
| 159 | orr \flgs, \flgs, #_TIF_MTE_ASYNC_FAULT | 160 | mov \tmp, #_TIF_MTE_ASYNC_FAULT |
| 160 | str \flgs, [tsk, #TSK_TI_FLAGS] | 161 | add \ti_flags, tsk, #TSK_TI_FLAGS |
| 162 | stset \tmp, [\ti_flags] | ||
| 161 | msr_s SYS_TFSRE0_EL1, xzr | 163 | msr_s SYS_TFSRE0_EL1, xzr |
| 162 | 1: | 164 | 1: |
| 163 | #endif | 165 | #endif |
| @@ -244,7 +246,7 @@ alternative_else_nop_endif · 80 unmodified lines | |||
| 244 | disable_step_tsk x19, x20 | 246 | disable_step_tsk x19, x20 |
| 245 | 247 | ||
| 246 | /* Check for asynchronous tag check faults in user space */ | 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 | apply_ssbd 1, x22, x23 | 250 | apply_ssbd 1, x22, x23 |
| 249 | 251 | ||
| 250 | ptrauth_keys_install_kernel tsk, x20, x22, x23 | 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 | adrp x5, __idmap_text_end | 320 | adrp x5, __idmap_text_end |
| 321 | clz x5, x5 | 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 | b.ge 1f // .. then skip VA range extension | 323 | b.ge 1f // .. then skip VA range extension |
| 324 | 324 | ||
| 325 | adr_l x6, idmap_t0sz | 325 | adr_l x6, idmap_t0sz |
| @@ -655,8 +655,10 @@ SYM_FUNC_END(__secondary_too_slow) · 329 unmodified lines | |||
| 655 | SYM_FUNC_START(__enable_mmu) | 655 | SYM_FUNC_START(__enable_mmu) |
| 656 | mrs x2, ID_AA64MMFR0_EL1 | 656 | mrs x2, ID_AA64MMFR0_EL1 |
| 657 | ubfx x2, x2, #ID_AA64MMFR0_TGRAN_SHIFT, 4 | 657 | ubfx x2, x2, #ID_AA64MMFR0_TGRAN_SHIFT, 4 |
| 658 | cmp x2, #ID_AA64MMFR0_TGRAN_SUPPORTED | 658 | cmp x2, #ID_AA64MMFR0_TGRAN_SUPPORTED_MIN |
| 659 | b.ne __no_granule_support | 659 | b.lt __no_granule_support |
| 660 | cmp x2, #ID_AA64MMFR0_TGRAN_SUPPORTED_MAX | ||
| 661 | b.gt __no_granule_support | ||
| 660 | update_early_cpu_boot_status 0, x2, x3 | 662 | update_early_cpu_boot_status 0, x2, x3 |
| 661 | adrp x2, idmap_pg_dir | 663 | adrp x2, idmap_pg_dir |
| 662 | phys_to_ttbr x1, x1 | 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 | } while (1); | 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)) { | 168 | const u8 *prop; |
| 169 | const u8 *prop; | 169 | void *fdt; |
| 170 | void *fdt; | 170 | int node; |
| 171 | int node; | ||
| 172 | 171 | ||
| 173 | fdt = get_early_fdt_ptr(); | 172 | fdt = get_early_fdt_ptr(); |
| 174 | if (!fdt) | 173 | if (!fdt) |
| 175 | goto out; | 174 | return NULL; |
| 176 | 175 | ||
| 177 | node = fdt_path_offset(fdt, "/chosen"); | 176 | node = fdt_path_offset(fdt, "/chosen"); |
| 178 | if (node < 0) | 177 | if (node < 0) |
| 179 | goto out; | 178 | return NULL; |
| 180 | 179 | ||
| 181 | prop = fdt_getprop(fdt, node, "bootargs", NULL); | 180 | prop = fdt_getprop(fdt, node, "bootargs", NULL); |
| 182 | if (!prop) | 181 | if (!prop) |
| 183 | goto out; | 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)) | 187 | static __init void parse_cmdline(void) |
| 188 | return; | 188 | { |
| 189 | } | 189 | const u8 *prop = get_bootargs_cmdline(); |
| 190 | 190 | ||
| 191 | out: | 191 | if (IS_ENABLED(CONFIG_CMDLINE_FORCE) || !prop) |
| 192 | __parse_cmdline(CONFIG_CMDLINE, true); | 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 | /* Keep checkers quiet */ | 198 | /* Keep checkers quiet */ |
| @@ -101,6 +101,9 @@ KVM_NVHE_ALIAS(__stop___kvm_ex_table); · 100 unmodified lines | |||
| 101 | /* Array containing bases of nVHE per-CPU memory regions. */ | 101 | /* Array containing bases of nVHE per-CPU memory regions. */ |
| 102 | KVM_NVHE_ALIAS(kvm_arm_hyp_percpu_base); | 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 | #endif /* CONFIG_KVM */ | 107 | #endif /* CONFIG_KVM */ |
| 105 | 108 | ||
| 106 | #endif /* __ARM64_KERNEL_IMAGE_VARS_H */ | 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 | return pmnc & BIT(ARMV8_IDX_TO_COUNTER(idx)); | 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 | u32 counter = ARMV8_IDX_TO_COUNTER(idx); | 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 | if (!instruction_pointer(regs)) | 267 | if (!instruction_pointer(regs)) |
| 268 | BUG(); | 268 | BUG(); |
| 269 | 269 | ||
| 270 | if (kcb->kprobe_status == KPROBE_REENTER) | 270 | if (kcb->kprobe_status == KPROBE_REENTER) { |
| 271 | restore_previous_kprobe(kcb); | 271 | restore_previous_kprobe(kcb); |
| 272 | else | 272 | } else { |
| 273 | kprobes_restore_local_irqflag(kcb, regs); | ||
| 273 | reset_current_kprobe(); | 274 | reset_current_kprobe(); |
| 275 | } | ||
| 274 | 276 | ||
| 275 | break; | 277 | break; |
| 276 | case KPROBE_HIT_ACTIVE: | 278 | case KPROBE_HIT_ACTIVE: |
| @@ -57,6 +57,8 @@ · 56 unmodified lines | |||
| 57 | #include <asm/processor.h> | 57 | #include <asm/processor.h> |
| 58 | #include <asm/pointer_auth.h> | 58 | #include <asm/pointer_auth.h> |
| 59 | #include <asm/stacktrace.h> | 59 | #include <asm/stacktrace.h> |
| 60 | #include <asm/switch_to.h> | ||
| 61 | #include <asm/system_misc.h> | ||
| 60 | 62 | ||
| 61 | #if defined(CONFIG_STACKPROTECTOR) && !defined(CONFIG_STACKPROTECTOR_PER_TASK) | 63 | #if defined(CONFIG_STACKPROTECTOR) && !defined(CONFIG_STACKPROTECTOR_PER_TASK) |
| 62 | #include <linux/stackprotector.h> | 64 | #include <linux/stackprotector.h> |
| @@ -134,7 +134,7 @@ SYM_FUNC_START(_cpu_resume) · 133 unmodified lines | |||
| 134 | */ | 134 | */ |
| 135 | bl cpu_do_resume | 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 | mov x0, sp | 138 | mov x0, sp |
| 139 | bl kasan_unpoison_task_stack_below | 139 | bl kasan_unpoison_task_stack_below |
| 140 | #endif | 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 | #ifdef CONFIG_STACKTRACE | 195 | #ifdef CONFIG_STACKTRACE |
| 196 | 196 | ||
| 197 | void arch_stack_walk(stack_trace_consume_fn consume_entry, void *cookie, | 197 | noinline void arch_stack_walk(stack_trace_consume_fn consume_entry, |
| 198 | struct task_struct *task, struct pt_regs *regs) | 198 | void *cookie, struct task_struct *task, |
| 199 | struct pt_regs *regs) | ||
| 199 | { | 200 | { |
| 200 | struct stackframe frame; | 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 | start_backtrace(&frame, regs->regs[29], regs->pc); | 204 | start_backtrace(&frame, regs->regs[29], regs->pc); |
| 204 | else if (task == current) | 205 | else if (task == current) |
| 205 | start_backtrace(&frame, | 206 | start_backtrace(&frame, |
| 206 | (unsigned long)__builtin_frame_address(0), | 207 | (unsigned long)__builtin_frame_address(1), |
| 207 | (unsigned long)arch_stack_walk); | 208 | (unsigned long)__builtin_return_address(0)); |
| 208 | else | 209 | else |
| 209 | start_backtrace(&frame, thread_saved_fp(task), | 210 | start_backtrace(&frame, thread_saved_fp(task), |
| 210 | thread_saved_pc(task)); | 211 | thread_saved_pc(task)); |
| @@ -385,11 +385,16 @@ void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu) · 384 unmodified lines | |||
| 385 | last_ran = this_cpu_ptr(mmu->last_vcpu_ran); | 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 | * We might get preempted before the vCPU actually runs, but | 393 | * We might get preempted before the vCPU actually runs, but |
| 389 | * over-invalidation doesn't affect correctness. | 394 | * over-invalidation doesn't affect correctness. |
| 390 | */ | 395 | */ |
| 391 | if (*last_ran != vcpu->vcpu_id) { | 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 | *last_ran = vcpu->vcpu_id; | 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 | * - Debug ROM Address (MDCR_EL2_TDRA) | 89 | * - Debug ROM Address (MDCR_EL2_TDRA) |
| 90 | * - OS related registers (MDCR_EL2_TDOSA) | 90 | * - OS related registers (MDCR_EL2_TDOSA) |
| 91 | * - Statistical profiler (MDCR_EL2_TPMS/MDCR_EL2_E2PB) | 91 | * - Statistical profiler (MDCR_EL2_TPMS/MDCR_EL2_E2PB) |
| 92 | * - Self-hosted Trace Filter controls (MDCR_EL2_TTRF) | ||
| 92 | * | 93 | * |
| 93 | * Additionally, KVM only traps guest accesses to the debug registers if | 94 | * Additionally, KVM only traps guest accesses to the debug registers if |
| 94 | * the guest is not actively using them (see the KVM_ARM64_DEBUG_DIRTY | 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 | vcpu->arch.mdcr_el2 = __this_cpu_read(mdcr_el2) & MDCR_EL2_HPMN_MASK; | 113 | vcpu->arch.mdcr_el2 = __this_cpu_read(mdcr_el2) & MDCR_EL2_HPMN_MASK; |
| 113 | vcpu->arch.mdcr_el2 |= (MDCR_EL2_TPM | | 114 | vcpu->arch.mdcr_el2 |= (MDCR_EL2_TPM | |
| 114 | MDCR_EL2_TPMS | | 115 | MDCR_EL2_TPMS | |
| 116 | MDCR_EL2_TTRF | | ||
| 115 | MDCR_EL2_TPMCR | | 117 | MDCR_EL2_TPMCR | |
| 116 | MDCR_EL2_TDRA | | 118 | MDCR_EL2_TDRA | |
| 117 | MDCR_EL2_TDOSA); | 119 | MDCR_EL2_TDOSA); |
| @@ -85,8 +85,10 @@ SYM_INNER_LABEL(__guest_exit_panic, SYM_L_GLOBAL) · 84 unmodified lines | |||
| 85 | 85 | ||
| 86 | // If the hyp context is loaded, go straight to hyp_panic | 86 | // If the hyp context is loaded, go straight to hyp_panic |
| 87 | get_loaded_vcpu x0, x1 | 87 | get_loaded_vcpu x0, x1 |
| 88 | cbz x0, hyp_panic | 88 | cbnz x0, 1f |
| 89 | b hyp_panic | ||
| 89 | 90 | ||
| 91 | 1: | ||
| 90 | // The hyp context is saved so make sure it is restored to allow | 92 | // The hyp context is saved so make sure it is restored to allow |
| 91 | // hyp_panic to run at hyp and, subsequently, panic to run in the host. | 93 | // hyp_panic to run at hyp and, subsequently, panic to run in the host. |
| 92 | // This makes use of __guest_exit to avoid duplication but sets the | 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 | // current state is saved to the guest context but it will only be | 96 | // current state is saved to the guest context but it will only be |
| 95 | // accurate if the guest had been completely restored. | 97 | // accurate if the guest had been completely restored. |
| 96 | adr_this_cpu x0, kvm_hyp_ctxt, x1 | 98 | adr_this_cpu x0, kvm_hyp_ctxt, x1 |
| 97 | adr x1, hyp_panic | 99 | adr_l x1, hyp_panic |
| 98 | str x1, [x0, #CPU_XREG_OFFSET(30)] | 100 | str x1, [x0, #CPU_XREG_OFFSET(30)] |
| 99 | 101 | ||
| 100 | get_vcpu_ptr x1, x0 | 102 | get_vcpu_ptr x1, x0 |
| @@ -146,7 +148,7 @@ SYM_INNER_LABEL(__guest_exit, SYM_L_GLOBAL) · 45 unmodified lines | |||
| 146 | // Now restore the hyp regs | 148 | // Now restore the hyp regs |
| 147 | restore_callee_saved_regs x2 | 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 | alternative_if ARM64_HAS_RAS_EXTN | 153 | alternative_if ARM64_HAS_RAS_EXTN |
| 152 | // If we have the RAS extensions we can consume a pending error | 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 | * counter, which could make a PMXEVCNTR_EL0 access UNDEF at | 90 | * counter, which could make a PMXEVCNTR_EL0 access UNDEF at |
| 91 | * EL1 instead of being trapped to EL2. | 91 | * EL1 instead of being trapped to EL2. |
| 92 | */ | 92 | */ |
| 93 | write_sysreg(0, pmselr_el0); | 93 | if (kvm_arm_support_pmu_v3()) { |
| 94 | write_sysreg(ARMV8_PMU_USERENR_MASK, pmuserenr_el0); | 94 | write_sysreg(0, pmselr_el0); |
| 95 | write_sysreg(ARMV8_PMU_USERENR_MASK, pmuserenr_el0); | ||
| 96 | } | ||
| 95 | write_sysreg(vcpu->arch.mdcr_el2, mdcr_el2); | 97 | write_sysreg(vcpu->arch.mdcr_el2, mdcr_el2); |
| 96 | } | 98 | } |
| 97 | 99 | ||
| 98 | static inline void __deactivate_traps_common(void) | 100 | static inline void __deactivate_traps_common(void) |
| 99 | { | 101 | { |
| 100 | write_sysreg(0, hstr_el2); | 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 | static inline void ___activate_traps(struct kvm_vcpu *vcpu) | 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 | write_sysreg_s(pmscr_el1, SYS_PMSCR_EL1); | 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 | /* Disable and flush SPE data generation */ | 63 | /* Disable and flush SPE data generation */ |
| 64 | __debug_save_spe(&vcpu->arch.host_debug_state.pmscr_el1); | 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 | __debug_switch_to_guest_common(vcpu); | 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 | __debug_restore_spe(vcpu->arch.host_debug_state.pmscr_el1); | 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 | __debug_switch_to_host_common(vcpu); | 79 | __debug_switch_to_host_common(vcpu); |
| 72 | } | 80 | } |
| 73 | 81 | ||
| @@ -71,7 +71,8 @@ SYM_FUNC_START(__host_enter) · 70 unmodified lines | |||
| 71 | SYM_FUNC_END(__host_enter) | 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 | SYM_FUNC_START(__hyp_do_panic) | 77 | SYM_FUNC_START(__hyp_do_panic) |
| 77 | /* Prepare and exit to the host's panic funciton. */ | 78 | /* Prepare and exit to the host's panic funciton. */ |
| @@ -82,9 +83,11 @@ SYM_FUNC_START(__hyp_do_panic) · 4 unmodified lines | |||
| 82 | hyp_kimg_va lr, x6 | 83 | hyp_kimg_va lr, x6 |
| 83 | msr elr_el2, lr | 84 | msr elr_el2, lr |
| 84 | 85 | ||
| 85 | /* Set the panic format string. Use the, now free, LR as scratch. */ | 86 | mov x29, x0 |
| 86 | ldr lr, =__hyp_panic_string | 87 | |
| 87 | hyp_kimg_va lr, x6 | 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 | /* Load the format arguments into x1-7. */ | 92 | /* Load the format arguments into x1-7. */ |
| 90 | mov x6, x3 | 93 | mov x6, x3 |
| @@ -94,9 +97,7 @@ SYM_FUNC_START(__hyp_do_panic) · 3 unmodified lines | |||
| 94 | mrs x5, hpfar_el2 | 97 | mrs x5, hpfar_el2 |
| 95 | 98 | ||
| 96 | /* Enter the host, conditionally restoring the host context. */ | 99 | /* Enter the host, conditionally restoring the host context. */ |
| 97 | cmp x0, xzr | 100 | cbz x29, __host_enter_without_restoring |
| 98 | mov x0, lr | ||
| 99 | b.eq __host_enter_without_restoring | ||
| 100 | b __host_enter_for_panic | 101 | b __host_enter_for_panic |
| 101 | SYM_FUNC_END(__hyp_do_panic) | 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 | __kvm_tlb_flush_vmid(kern_hyp_va(mmu)); | 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 | DECLARE_REG(struct kvm_s2_mmu *, mmu, host_ctxt, 1); | 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 | static void handle___kvm_timer_set_cntvoff(struct kvm_cpu_context *host_ctxt) | 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 | write_sysreg_el2(tmp, SYS_SCTLR); | 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 | static void handle___vgic_v3_read_vmcr(struct kvm_cpu_context *host_ctxt) | 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 | HANDLE_FUNC(__kvm_flush_vm_context), | 115 | HANDLE_FUNC(__kvm_flush_vm_context), |
| 116 | HANDLE_FUNC(__kvm_tlb_flush_vmid_ipa), | 116 | HANDLE_FUNC(__kvm_tlb_flush_vmid_ipa), |
| 117 | HANDLE_FUNC(__kvm_tlb_flush_vmid), | 117 | HANDLE_FUNC(__kvm_tlb_flush_vmid), |
| 118 | HANDLE_FUNC(__kvm_tlb_flush_local_vmid), | 118 | HANDLE_FUNC(__kvm_flush_cpu_context), |
| 119 | HANDLE_FUNC(__kvm_timer_set_cntvoff), | 119 | HANDLE_FUNC(__kvm_timer_set_cntvoff), |
| 120 | HANDLE_FUNC(__kvm_enable_ssbs), | 120 | HANDLE_FUNC(__kvm_enable_ssbs), |
| 121 | HANDLE_FUNC(__vgic_v3_get_ich_vtr_el2), | 121 | HANDLE_FUNC(__vgic_v3_get_gic_config), |
| 122 | HANDLE_FUNC(__vgic_v3_read_vmcr), | 122 | HANDLE_FUNC(__vgic_v3_read_vmcr), |
| 123 | HANDLE_FUNC(__vgic_v3_write_vmcr), | 123 | HANDLE_FUNC(__vgic_v3_write_vmcr), |
| 124 | HANDLE_FUNC(__vgic_v3_init_lrs), | 124 | HANDLE_FUNC(__vgic_v3_init_lrs), |
| @@ -192,6 +192,14 @@ int __kvm_vcpu_run(struct kvm_vcpu *vcpu) · 191 unmodified lines | |||
| 192 | pmu_switch_needed = __pmu_switch_to_guest(host_ctxt); | 192 | pmu_switch_needed = __pmu_switch_to_guest(host_ctxt); |
| 193 | 193 | ||
| 194 | __sysreg_save_state_nvhe(host_ctxt); | 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 | __adjust_pc(vcpu); | 204 | __adjust_pc(vcpu); |
| 197 | 205 | ||
| @@ -234,11 +242,12 @@ int __kvm_vcpu_run(struct kvm_vcpu *vcpu) · 36 unmodified lines | |||
| 234 | if (vcpu->arch.flags & KVM_ARM64_FP_ENABLED) | 242 | if (vcpu->arch.flags & KVM_ARM64_FP_ENABLED) |
| 235 | __fpsimd_save_fpexc32(vcpu); | 243 | __fpsimd_save_fpexc32(vcpu); |
| 236 | 244 | ||
| 245 | __debug_switch_to_host(vcpu); | ||
| 237 | /* | 246 | /* |
| 238 | * This must come after restoring the host sysregs, since a non-VHE | 247 | * This must come after restoring the host sysregs, since a non-VHE |
| 239 | * system may enable SPE here and make use of the TTBRs. | 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 | if (pmu_switch_needed) | 252 | if (pmu_switch_needed) |
| 244 | __pmu_switch_to_host(host_ctxt); | 253 | __pmu_switch_to_host(host_ctxt); |
| @@ -257,7 +266,6 @@ void __noreturn hyp_panic(void) · 12 unmodified lines | |||
| 257 | u64 spsr = read_sysreg_el2(SYS_SPSR); | 266 | u64 spsr = read_sysreg_el2(SYS_SPSR); |
| 258 | u64 elr = read_sysreg_el2(SYS_ELR); | 267 | u64 elr = read_sysreg_el2(SYS_ELR); |
| 259 | u64 par = read_sysreg_par(); | 268 | u64 par = read_sysreg_par(); |
| 260 | bool restore_host = true; | ||
| 261 | struct kvm_cpu_context *host_ctxt; | 269 | struct kvm_cpu_context *host_ctxt; |
| 262 | struct kvm_vcpu *vcpu; | 270 | struct kvm_vcpu *vcpu; |
| 263 | 271 | ||
| @@ -271,7 +279,7 @@ void __noreturn hyp_panic(void) · 7 unmodified lines | |||
| 271 | __sysreg_restore_state_nvhe(host_ctxt); | 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 | unreachable(); | 283 | unreachable(); |
| 276 | } | 284 | } |
| 277 | 285 | ||
| @@ -123,7 +123,7 @@ void __kvm_tlb_flush_vmid(struct kvm_s2_mmu *mmu) · 122 unmodified lines | |||
| 123 | __tlb_switch_to_host(&cxt); | 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 | struct tlb_inv_context cxt; | 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 | __tlb_switch_to_guest(mmu, &cxt); | 131 | __tlb_switch_to_guest(mmu, &cxt); |
| 132 | 132 | ||
| 133 | __tlbi(vmalle1); | 133 | __tlbi(vmalle1); |
| 134 | asm volatile("ic iallu"); | ||
| 134 | dsb(nsh); | 135 | dsb(nsh); |
| 135 | isb(); | 136 | isb(); |
| 136 | 137 | ||
| @@ -223,6 +223,7 @@ static inline int __kvm_pgtable_visit(struct kvm_pgtable_walk_data *data, · 222 unmodified lines | |||
| 223 | goto out; | 223 | goto out; |
| 224 | 224 | ||
| 225 | if (!table) { | 225 | if (!table) { |
| 226 | data->addr = ALIGN_DOWN(data->addr, kvm_granule_size(level)); | ||
| 226 | data->addr += kvm_granule_size(level); | 227 | data->addr += kvm_granule_size(level); |
| 227 | goto out; | 228 | goto out; |
| 228 | } | 229 | } |
| @@ -405,9 +405,54 @@ void __vgic_v3_init_lrs(void) · 404 unmodified lines | |||
| 405 | __gic_v3_set_lr(0, i); | 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 | u64 __vgic_v3_read_vmcr(void) | 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 | __tlb_switch_to_host(&cxt); | 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 | struct tlb_inv_context cxt; | 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 | __tlb_switch_to_guest(mmu, &cxt); | 135 | __tlb_switch_to_guest(mmu, &cxt); |
| 136 | 136 | ||
| 137 | __tlbi(vmalle1); | 137 | __tlbi(vmalle1); |
| 138 | asm volatile("ic iallu"); | ||
| 138 | dsb(nsh); | 139 | dsb(nsh); |
| 139 | isb(); | 140 | isb(); |
| 140 | 141 | ||
| @@ -1312,8 +1312,7 @@ int kvm_arch_prepare_memory_region(struct kvm *kvm, · 1311 unmodified lines | |||
| 1312 | * Prevent userspace from creating a memory region outside of the IPA | 1312 | * Prevent userspace from creating a memory region outside of the IPA |
| 1313 | * space addressable by the KVM guest IPA space. | 1313 | * space addressable by the KVM guest IPA space. |
| 1314 | */ | 1314 | */ |
| 1315 | if (memslot->base_gfn + memslot->npages >= | 1315 | if ((memslot->base_gfn + memslot->npages) > (kvm_phys_size(kvm) >> PAGE_SHIFT)) |
| 1316 | (kvm_phys_size(kvm) >> PAGE_SHIFT)) | ||
| 1317 | return -EFAULT; | 1316 | return -EFAULT; |
| 1318 | 1317 | ||
| 1319 | mmap_read_lock(current->mm); | 1318 | mmap_read_lock(current->mm); |
| @@ -11,6 +11,8 @@ · 10 unmodified lines | |||
| 11 | 11 | ||
| 12 | #include <asm/kvm_emulate.h> | 12 | #include <asm/kvm_emulate.h> |
| 13 | 13 | ||
| 14 | DEFINE_STATIC_KEY_FALSE(kvm_arm_pmu_available); | ||
| 15 | |||
| 14 | static int kvm_is_in_guest(void) | 16 | static int kvm_is_in_guest(void) |
| 15 | { | 17 | { |
| 16 | return kvm_get_running_vcpu() != NULL; | 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 | int kvm_perf_init(void) | 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 | return perf_register_guest_info_callbacks(&kvm_guest_cbs); | 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 | return val & mask; | 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 | int kvm_arm_pmu_v3_enable(struct kvm_vcpu *vcpu) | 826 | int kvm_arm_pmu_v3_enable(struct kvm_vcpu *vcpu) |
| 837 | { | 827 | { |
| 838 | if (!kvm_vcpu_has_pmu(vcpu)) | 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 | switch (cpuid_feature_extract_unsigned_field(mmfr0, tgran_2)) { | 313 | switch (cpuid_feature_extract_unsigned_field(mmfr0, tgran_2)) { |
| 314 | default: | 314 | case ID_AA64MMFR0_TGRAN_2_SUPPORTED_NONE: |
| 315 | case 1: | ||
| 316 | kvm_err("PAGE_SIZE not supported at Stage-2, giving up\n"); | 315 | kvm_err("PAGE_SIZE not supported at Stage-2, giving up\n"); |
| 317 | return -EINVAL; | 316 | return -EINVAL; |
| 318 | case 0: | 317 | case ID_AA64MMFR0_TGRAN_2_SUPPORTED_DEFAULT: |
| 319 | kvm_debug("PAGE_SIZE supported at Stage-2 (default)\n"); | 318 | kvm_debug("PAGE_SIZE supported at Stage-2 (default)\n"); |
| 320 | break; | 319 | break; |
| 321 | case 2: | 320 | case ID_AA64MMFR0_TGRAN_2_SUPPORTED_MIN ... ID_AA64MMFR0_TGRAN_2_SUPPORTED_MAX: |
| 322 | kvm_debug("PAGE_SIZE supported at Stage-2 (advertised)\n"); | 321 | kvm_debug("PAGE_SIZE supported at Stage-2 (advertised)\n"); |
| 323 | break; | 322 | break; |
| 323 | default: | ||
| 324 | kvm_err("Unsupported value for TGRAN_2, giving up\n"); | ||
| 325 | return -EINVAL; | ||
| 324 | } | 326 | } |
| 325 | 327 | ||
| 326 | kvm_ipa_limit = id_aa64mmfr0_parange_to_phys_shift(parange); | 328 | kvm_ipa_limit = id_aa64mmfr0_parange_to_phys_shift(parange); |
| 327 | WARN(kvm_ipa_limit < KVM_PHYS_SHIFT, | 329 | kvm_info("IPA Size Limit: %d bits%s\n", kvm_ipa_limit, |
| 328 | "KVM IPA Size Limit (%d bits) is smaller than default size\n", | 330 | ((kvm_ipa_limit < KVM_PHYS_SHIFT) ? |
| 329 | kvm_ipa_limit); | 331 | " (Reduced IPA size, limited VM/VMM compatibility)" : "")); |
| 330 | kvm_info("IPA Size Limit: %d bits\n", kvm_ipa_limit); | ||
| 331 | 332 | ||
| 332 | return 0; | 333 | return 0; |
| 333 | } | 334 | } |
| @@ -356,6 +357,11 @@ int kvm_arm_setup_stage2(struct kvm *kvm, unsigned long type) · 22 unmodified lines | |||
| 356 | return -EINVAL; | 357 | return -EINVAL; |
| 357 | } else { | 358 | } else { |
| 358 | phys_shift = KVM_PHYS_SHIFT; | 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 | mmfr0 = read_sanitised_ftr_reg(SYS_ID_AA64MMFR0_EL1); | 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 | int vgic_v3_probe(const struct gic_kvm_info *info) | 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 | int ret; | 579 | int ret; |
| 579 | 580 | ||
| 581 | has_v2 = ich_vtr_el2 >> 63; | ||
| 582 | ich_vtr_el2 = (u32)ich_vtr_el2; | ||
| 583 | |||
| 580 | /* | 584 | /* |
| 581 | * The ListRegs field is 5 bits, but there is an architectural | 585 | * The ListRegs field is 5 bits, but there is an architectural |
| 582 | * maximum of 16 list registers. Just ignore bit 4... | 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 | gicv4_enable ? "en" : "dis"); | 598 | gicv4_enable ? "en" : "dis"); |
| 595 | } | 599 | } |
| 596 | 600 | ||
| 601 | kvm_vgic_global_state.vcpu_base = 0; | ||
| 602 | |||
| 597 | if (!info->vcpu.start) { | 603 | if (!info->vcpu.start) { |
| 598 | kvm_info("GICv3: no GICV resource entry\n"); | 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 | } else if (!PAGE_ALIGNED(info->vcpu.start)) { | 607 | } else if (!PAGE_ALIGNED(info->vcpu.start)) { |
| 601 | pr_warn("GICV physical address 0x%llx not page aligned\n", | 608 | pr_warn("GICV physical address 0x%llx not page aligned\n", |
| 602 | (unsigned long long)info->vcpu.start); | 609 | (unsigned long long)info->vcpu.start); |
| 603 | kvm_vgic_global_state.vcpu_base = 0; | ||
| 604 | } else { | 610 | } else { |
| 605 | kvm_vgic_global_state.vcpu_base = info->vcpu.start; | 611 | kvm_vgic_global_state.vcpu_base = info->vcpu.start; |
| 606 | kvm_vgic_global_state.can_emulate_gicv2 = true; | 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 | int pfn_valid(unsigned long pfn) | 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 | return 0; | 231 | return 0; |
| 226 | 232 | ||
| 227 | #ifdef CONFIG_SPARSEMEM | 233 | #ifdef CONFIG_SPARSEMEM |
| 234 | { | ||
| 235 | struct mem_section *ms; | ||
| 236 | |||
| 228 | if (pfn_to_section_nr(pfn) >= NR_MEM_SECTIONS) | 237 | if (pfn_to_section_nr(pfn) >= NR_MEM_SECTIONS) |
| 229 | return 0; | 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 | return 0; | 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 | #endif | 256 | #endif |
| 234 | return memblock_is_map_memory(addr); | 257 | return memblock_is_map_memory(addr); |
| 235 | } | 258 | } |
| @@ -40,7 +40,7 @@ · 39 unmodified lines | |||
| 40 | #define NO_BLOCK_MAPPINGS BIT(0) | 40 | #define NO_BLOCK_MAPPINGS BIT(0) |
| 41 | #define NO_CONT_MAPPINGS BIT(1) | 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 | u64 idmap_ptrs_per_pgd = PTRS_PER_PGD; | 44 | u64 idmap_ptrs_per_pgd = PTRS_PER_PGD; |
| 45 | 45 | ||
| 46 | u64 __section(".mmuoff.data.write") vabits_actual; | 46 | u64 __section(".mmuoff.data.write") vabits_actual; |
| @@ -512,7 +512,8 @@ static void __init map_mem(pgd_t *pgdp) · 465 unmodified lines | |||
| 512 | * if MTE is present. Otherwise, it has the same attributes as | 512 | * if MTE is present. Otherwise, it has the same attributes as |
| 513 | * PAGE_KERNEL. | 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 | struct range arch_get_mappable_range(void) | 1448 | struct range arch_get_mappable_range(void) |
| 1448 | { | 1449 | { |
| 1449 | struct range mhp_range; | 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 | * Linear mapping region is the range [PAGE_OFFSET..(PAGE_END - 1)] | 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 | * range which can be mapped inside this linear mapping range, must | 1471 | * range which can be mapped inside this linear mapping range, must |
| 1455 | * also be derived from its end points. | 1472 | * also be derived from its end points. |
| 1456 | */ | 1473 | */ |
| 1457 | mhp_range.start = __pa(_PAGE_OFFSET(vabits_actual)); | 1474 | mhp_range.start = start_linear_pa; |
| 1458 | mhp_range.end = __pa(PAGE_END - 1); | 1475 | mhp_range.end = end_linear_pa; |
| 1476 | |||
| 1459 | return mhp_range; | 1477 | return mhp_range; |
| 1460 | } | 1478 | } |
| 1461 | 1479 | ||
| @@ -314,7 +314,7 @@ config FORCE_MAX_ZONEORDER · 313 unmodified lines | |||
| 314 | int "Maximum zone order" | 314 | int "Maximum zone order" |
| 315 | default "11" | 315 | default "11" |
| 316 | 316 | ||
| 317 | config RAM_BASE | 317 | config DRAM_BASE |
| 318 | hex "DRAM start addr (the same with memory-section in dts)" | 318 | hex "DRAM start addr (the same with memory-section in dts)" |
| 319 | default 0x0 | 319 | default 0x0 |
| 320 | 320 | ||
| @@ -28,7 +28,7 @@ · 27 unmodified lines | |||
| 28 | #define SSEG_SIZE 0x20000000 | 28 | #define SSEG_SIZE 0x20000000 |
| 29 | #define LOWMEM_LIMIT (SSEG_SIZE * 2) | 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 | #ifndef __ASSEMBLY__ | 33 | #ifndef __ASSEMBLY__ |
| 34 | 34 | ||
| @@ -9,7 +9,7 @@ int arch_check_ftrace_location(struct kprobe *p) · 8 unmodified lines | |||
| 9 | return 0; | 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 | void kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip, | 13 | void kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip, |
| 14 | struct ftrace_ops *ops, struct ftrace_regs *fregs) | 14 | struct ftrace_ops *ops, struct ftrace_regs *fregs) |
| 15 | { | 15 | { |
| @@ -55,8 +55,6 @@ CONFIG_CHR_DEV_SG=m · 54 unmodified lines | |||
| 55 | CONFIG_SCSI_FC_ATTRS=y | 55 | CONFIG_SCSI_FC_ATTRS=y |
| 56 | CONFIG_SCSI_SYM53C8XX_2=y | 56 | CONFIG_SCSI_SYM53C8XX_2=y |
| 57 | CONFIG_SCSI_QLOGIC_1280=y | 57 | CONFIG_SCSI_QLOGIC_1280=y |
| 58 | CONFIG_ATA=y | ||
| 59 | CONFIG_ATA_PIIX=y | ||
| 60 | CONFIG_SATA_VITESSE=y | 58 | CONFIG_SATA_VITESSE=y |
| 61 | CONFIG_MD=y | 59 | CONFIG_MD=y |
| 62 | CONFIG_BLK_DEV_MD=m | 60 | CONFIG_BLK_DEV_MD=m |
| @@ -54,8 +54,7 @@ · 53 unmodified lines | |||
| 54 | 54 | ||
| 55 | static inline unsigned long user_stack_pointer(struct pt_regs *regs) | 55 | static inline unsigned long user_stack_pointer(struct pt_regs *regs) |
| 56 | { | 56 | { |
| 57 | /* FIXME: should this be bspstore + nr_dirty regs? */ | 57 | return regs->r12; |
| 58 | return regs->ar_bspstore; | ||
| 59 | } | 58 | } |
| 60 | 59 | ||
| 61 | static inline int is_syscall_success(struct pt_regs *regs) | 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 | unsigned long __ip = instruction_pointer(regs); \ | 78 | unsigned long __ip = instruction_pointer(regs); \ |
| 80 | (__ip & ~3UL) + ((__ip & 3UL) << 2); \ | 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 | /* given a pointer to a task_struct, return the user's pt_regs */ | 82 | /* given a pointer to a task_struct, return the user's pt_regs */ |
| 89 | # define task_pt_regs(t) (((struct pt_regs *) ((char *) (t) + IA64_STK_OFFSET)) - 1) | 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 | static inline long syscall_get_error(struct task_struct *task, | 32 | static inline long syscall_get_error(struct task_struct *task, |
| 33 | struct pt_regs *regs) | 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 | static inline long syscall_get_return_value(struct task_struct *task, | 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 | char *buf) \ | 59 | char *buf) \ |
| 60 | { \ | 60 | { \ |
| 61 | u32 cpu=dev->id; \ | 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 | #define store(name) \ | 65 | #define store(name) \ |
| @@ -86,9 +86,9 @@ store_call_start(struct device *dev, struct device_attribute *attr, · 20 unmodified lines | |||
| 86 | 86 | ||
| 87 | #ifdef ERR_INJ_DEBUG | 87 | #ifdef ERR_INJ_DEBUG |
| 88 | printk(KERN_DEBUG "pal_mc_err_inject for cpu%d:\n", cpu); | 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]); | 89 | printk(KERN_DEBUG "err_type_info=%llx,\n", err_type_info[cpu]); |
| 90 | printk(KERN_DEBUG "err_struct_info=%lx,\n", err_struct_info[cpu]); | 90 | printk(KERN_DEBUG "err_struct_info=%llx,\n", err_struct_info[cpu]); |
| 91 | printk(KERN_DEBUG "err_data_buffer=%lx, %lx, %lx.\n", | 91 | printk(KERN_DEBUG "err_data_buffer=%llx, %llx, %llx.\n", |
| 92 | err_data_buffer[cpu].data1, | 92 | err_data_buffer[cpu].data1, |
| 93 | err_data_buffer[cpu].data2, | 93 | err_data_buffer[cpu].data2, |
| 94 | err_data_buffer[cpu].data3); | 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 | #ifdef ERR_INJ_DEBUG | 118 | #ifdef ERR_INJ_DEBUG |
| 119 | printk(KERN_DEBUG "Returns: status=%d,\n", (int)status[cpu]); | 119 | printk(KERN_DEBUG "Returns: status=%d,\n", (int)status[cpu]); |
| 120 | printk(KERN_DEBUG "capabilities=%lx,\n", capabilities[cpu]); | 120 | printk(KERN_DEBUG "capabilities=%llx,\n", capabilities[cpu]); |
| 121 | printk(KERN_DEBUG "resources=%lx\n", resources[cpu]); | 121 | printk(KERN_DEBUG "resources=%llx\n", resources[cpu]); |
| 122 | #endif | 122 | #endif |
| 123 | return size; | 123 | return size; |
| 124 | } | 124 | } |
| @@ -131,7 +131,7 @@ show_virtual_to_phys(struct device *dev, struct device_attribute *attr, · 6 unmodified lines | |||
| 131 | char *buf) | 131 | char *buf) |
| 132 | { | 132 | { |
| 133 | unsigned int cpu=dev->id; | 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 | static ssize_t | 137 | static ssize_t |
| @@ -145,7 +145,7 @@ store_virtual_to_phys(struct device *dev, struct device_attribute *attr, · 7 unmodified lines | |||
| 145 | ret = get_user_pages_fast(virt_addr, 1, FOLL_WRITE, NULL); | 145 | ret = get_user_pages_fast(virt_addr, 1, FOLL_WRITE, NULL); |
| 146 | if (ret<=0) { | 146 | if (ret<=0) { |
| 147 | #ifdef ERR_INJ_DEBUG | 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 | #endif | 149 | #endif |
| 150 | return -EINVAL; | 150 | return -EINVAL; |
| 151 | } | 151 | } |
| @@ -163,7 +163,7 @@ show_err_data_buffer(struct device *dev, · 11 unmodified lines | |||
| 163 | { | 163 | { |
| 164 | unsigned int cpu=dev->id; | 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 | err_data_buffer[cpu].data1, | 167 | err_data_buffer[cpu].data1, |
| 168 | err_data_buffer[cpu].data2, | 168 | err_data_buffer[cpu].data2, |
| 169 | err_data_buffer[cpu].data3); | 169 | err_data_buffer[cpu].data3); |
| @@ -178,13 +178,13 @@ store_err_data_buffer(struct device *dev, · 8 unmodified lines | |||
| 178 | int ret; | 178 | int ret; |
| 179 | 179 | ||
| 180 | #ifdef ERR_INJ_DEBUG | 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 | err_data_buffer[cpu].data1, | 182 | err_data_buffer[cpu].data1, |
| 183 | err_data_buffer[cpu].data2, | 183 | err_data_buffer[cpu].data2, |
| 184 | err_data_buffer[cpu].data3, | 184 | err_data_buffer[cpu].data3, |
| 185 | cpu); | 185 | cpu); |
| 186 | #endif | 186 | #endif |
| 187 | ret=sscanf(buf, "%lx, %lx, %lx", | 187 | ret = sscanf(buf, "%llx, %llx, %llx", |
| 188 | &err_data_buffer[cpu].data1, | 188 | &err_data_buffer[cpu].data1, |
| 189 | &err_data_buffer[cpu].data2, | 189 | &err_data_buffer[cpu].data2, |
| 190 | &err_data_buffer[cpu].data3); | 190 | &err_data_buffer[cpu].data3); |
| @@ -1824,7 +1824,7 @@ ia64_mca_cpu_init(void *cpu_data) · 1823 unmodified lines | |||
| 1824 | data = mca_bootmem(); | 1824 | data = mca_bootmem(); |
| 1825 | first_time = 0; | 1825 | first_time = 0; |
| 1826 | } else | 1826 | } else |
| 1827 | data = (void *)__get_free_pages(GFP_KERNEL, | 1827 | data = (void *)__get_free_pages(GFP_ATOMIC, |
| 1828 | get_order(sz)); | 1828 | get_order(sz)); |
| 1829 | if (!data) | 1829 | if (!data) |
| 1830 | panic("Could not allocate MCA memory for cpu %d\n", | 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 | struct syscall_get_set_args *args = data; | 2014 | struct syscall_get_set_args *args = data; |
| 2015 | struct pt_regs *pt = args->regs; | 2015 | struct pt_regs *pt = args->regs; |
| 2016 | unsigned long *krbs, cfm, ndirty; | 2016 | unsigned long *krbs, cfm, ndirty, nlocals, nouts; |
| 2017 | int i, count; | 2017 | int i, count; |
| 2018 | 2018 | ||
| 2019 | if (unw_unwind_to_user(info) < 0) | 2019 | if (unw_unwind_to_user(info) < 0) |
| 2020 | return; | 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 | cfm = pt->cr_ifs; | 2032 | cfm = pt->cr_ifs; |
| 2033 | nlocals = (cfm >> 7) & 0x7f; /* aka sol */ | ||
| 2034 | nouts = (cfm & 0x7f) - nlocals; /* aka sof - sol */ | ||
| 2023 | krbs = (unsigned long *)info->task + IA64_RBS_OFFSET/8; | 2035 | krbs = (unsigned long *)info->task + IA64_RBS_OFFSET/8; |
| 2024 | ndirty = ia64_rse_num_regs(krbs, krbs + (pt->loadrs >> 19)); | 2036 | ndirty = ia64_rse_num_regs(krbs, krbs + (pt->loadrs >> 19)); |
| 2025 | 2037 | ||
| 2026 | count = 0; | 2038 | count = 0; |
| 2027 | if (in_syscall(pt)) | 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 | for (i = 0; i < count; i++) { | 2043 | for (i = 0; i < count; i++) { |
| 2044 | int j = ndirty + nlocals + i + args->i; | ||
| 2031 | if (args->rw) | 2045 | if (args->rw) |
| 2032 | *ia64_rse_skip_regs(krbs, ndirty + i + args->i) = | 2046 | *ia64_rse_skip_regs(krbs, j) = args->args[i]; |
| 2033 | args->args[i]; | ||
| 2034 | else | 2047 | else |
| 2035 | args->args[i] = *ia64_rse_skip_regs(krbs, | 2048 | args->args[i] = *ia64_rse_skip_regs(krbs, j); |
| 2036 | ndirty + i + args->i); | ||
| 2037 | } | 2049 | } |
| 2038 | 2050 | ||
| 2039 | if (!args->rw) { | 2051 | if (!args->rw) { |
| @@ -95,7 +95,7 @@ static int __init build_node_maps(unsigned long start, unsigned long len, · 94 unmodified lines | |||
| 95 | * acpi_boot_init() (which builds the node_to_cpu_mask array) hasn't been | 95 | * acpi_boot_init() (which builds the node_to_cpu_mask array) hasn't been |
| 96 | * called yet. Note that node 0 will also count all non-existent cpus. | 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 | int cpu, n = 0; | 100 | int cpu, n = 0; |
| 101 | 101 | ||
| @@ -110,7 +110,7 @@ static int __meminit early_nr_cpus_node(int node) · 8 unmodified lines | |||
| 110 | * compute_pernodesize - compute size of pernode data | 110 | * compute_pernodesize - compute size of pernode data |
| 111 | * @node: the node id. | 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 | unsigned long pernodesize = 0, cpus; | 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 | pg_data_t **dst; | 372 | pg_data_t **dst; |
| 373 | int node; | 373 | int node; |
| @@ -167,11 +167,11 @@ static inline __attribute_const__ int __virt_to_node_shift(void) · 166 unmodified lines | |||
| 167 | ((__p) - pgdat->node_mem_map) + pgdat->node_start_pfn; \ | 167 | ((__p) - pgdat->node_mem_map) + pgdat->node_start_pfn; \ |
| 168 | }) | 168 | }) |
| 169 | #else | 169 | #else |
| 170 | #define ARCH_PFN_OFFSET (m68k_memory[0].addr) | 170 | #define ARCH_PFN_OFFSET (m68k_memory[0].addr >> PAGE_SHIFT) |
| 171 | #include <asm-generic/memory_model.h> | 171 | #include <asm-generic/memory_model.h> |
| 172 | #endif | 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 | #define pfn_valid(pfn) virt_addr_valid(pfn_to_virt(pfn)) | 175 | #define pfn_valid(pfn) virt_addr_valid(pfn_to_virt(pfn)) |
| 176 | 176 | ||
| 177 | #endif /* __ASSEMBLY__ */ | 177 | #endif /* __ASSEMBLY__ */ |
| @@ -30,8 +30,8 @@ extern unsigned long memory_end; · 29 unmodified lines | |||
| 30 | #define page_to_pfn(page) virt_to_pfn(page_to_virt(page)) | 30 | #define page_to_pfn(page) virt_to_pfn(page_to_virt(page)) |
| 31 | #define pfn_valid(pfn) ((pfn) < max_mapnr) | 31 | #define pfn_valid(pfn) ((pfn) < max_mapnr) |
| 32 | 32 | ||
| 33 | #define virt_addr_valid(kaddr) (((void *)(kaddr) >= (void *)PAGE_OFFSET) && \ | 33 | #define virt_addr_valid(kaddr) (((unsigned long)(kaddr) >= PAGE_OFFSET) && \ |
| 34 | ((void *)(kaddr) < (void *)memory_end)) | 34 | ((unsigned long)(kaddr) < memory_end)) |
| 35 | 35 | ||
| 36 | #endif /* __ASSEMBLY__ */ | 36 | #endif /* __ASSEMBLY__ */ |
| 37 | 37 | ||
| @@ -14,6 +14,7 @@ · 13 unmodified lines | |||
| 14 | 14 | ||
| 15 | #include <asm/addrspace.h> | 15 | #include <asm/addrspace.h> |
| 16 | #include <asm/unaligned.h> | 16 | #include <asm/unaligned.h> |
| 17 | #include <asm-generic/vmlinux.lds.h> | ||
| 17 | 18 | ||
| 18 | /* | 19 | /* |
| 19 | * These two variables specify the free mem region | 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 | /* last four bytes is always image size in little endian */ | 121 | /* last four bytes is always image size in little endian */ |
| 121 | image_size = get_unaligned_le32((void *)&__image_end - 4); | 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 | /* copy dtb to where the booted kernel will expect it */ | 131 | /* copy dtb to where the booted kernel will expect it */ |
| 124 | memcpy((void *)VMLINUX_LOAD_ADDRESS_ULL + image_size, | 132 | memcpy((void *)VMLINUX_LOAD_ADDRESS_ULL + image_size, |
| 125 | __appended_dtb, dtb_size); | 133 | __appended_dtb, dtb_size); |
| @@ -12,8 +12,8 @@ AFLAGS_chacha-core.o += -O2 # needed to fill branch delay slots · 11 unmodified lines | |||
| 12 | obj-$(CONFIG_CRYPTO_POLY1305_MIPS) += poly1305-mips.o | 12 | obj-$(CONFIG_CRYPTO_POLY1305_MIPS) += poly1305-mips.o |
| 13 | poly1305-mips-y := poly1305-core.o poly1305-glue.o | 13 | poly1305-mips-y := poly1305-core.o poly1305-glue.o |
| 14 | 14 | ||
| 15 | perlasm-flavour-$(CONFIG_CPU_MIPS32) := o32 | 15 | perlasm-flavour-$(CONFIG_32BIT) := o32 |
| 16 | perlasm-flavour-$(CONFIG_CPU_MIPS64) := 64 | 16 | perlasm-flavour-$(CONFIG_64BIT) := 64 |
| 17 | 17 | ||
| 18 | quiet_cmd_perlasm = PERLASM $@ | 18 | quiet_cmd_perlasm = PERLASM $@ |
| 19 | cmd_perlasm = $(PERL) $(<) $(perlasm-flavour-y) $(@) | 19 | cmd_perlasm = $(PERL) $(<) $(perlasm-flavour-y) $(@) |
| @@ -24,8 +24,11 @@ extern void (*board_ebase_setup)(void); · 23 unmodified lines | |||
| 24 | extern void (*board_cache_error_setup)(void); | 24 | extern void (*board_cache_error_setup)(void); |
| 25 | 25 | ||
| 26 | extern int register_nmi_notifier(struct notifier_block *nb); | 26 | extern int register_nmi_notifier(struct notifier_block *nb); |
| 27 | extern void reserve_exception_space(phys_addr_t addr, unsigned long size); | ||
| 27 | extern char except_vec_nmi[]; | 28 | extern char except_vec_nmi[]; |
| 28 | 29 | ||
| 30 | #define VECTORSPACING 0x100 /* for EI/VI mode */ | ||
| 31 | |||
| 29 | #define nmi_notifier(fn, pri) \ | 32 | #define nmi_notifier(fn, pri) \ |
| 30 | ({ \ | 33 | ({ \ |
| 31 | static struct notifier_block fn##_nb = { \ | 34 | static struct notifier_block fn##_nb = { \ |
| @@ -26,6 +26,7 @@ · 25 unmodified lines | |||
| 26 | #include <asm/elf.h> | 26 | #include <asm/elf.h> |
| 27 | #include <asm/pgtable-bits.h> | 27 | #include <asm/pgtable-bits.h> |
| 28 | #include <asm/spram.h> | 28 | #include <asm/spram.h> |
| 29 | #include <asm/traps.h> | ||
| 29 | #include <linux/uaccess.h> | 30 | #include <linux/uaccess.h> |
| 30 | 31 | ||
| 31 | #include "fpu-probe.h" | 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 | c->cputype = CPU_BMIPS3300; | 1629 | c->cputype = CPU_BMIPS3300; |
| 1629 | __cpu_name[cpu] = "Broadcom BMIPS3300"; | 1630 | __cpu_name[cpu] = "Broadcom BMIPS3300"; |
| 1630 | set_elf_platform(cpu, "bmips3300"); | 1631 | set_elf_platform(cpu, "bmips3300"); |
| 1632 | reserve_exception_space(0x400, VECTORSPACING * 64); | ||
| 1631 | break; | 1633 | break; |
| 1632 | case PRID_IMP_BMIPS43XX: { | 1634 | case PRID_IMP_BMIPS43XX: { |
| 1633 | int rev = c->processor_id & PRID_REV_MASK; | 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 | __cpu_name[cpu] = "Broadcom BMIPS4380"; | 1640 | __cpu_name[cpu] = "Broadcom BMIPS4380"; |
| 1639 | set_elf_platform(cpu, "bmips4380"); | 1641 | set_elf_platform(cpu, "bmips4380"); |
| 1640 | c->options |= MIPS_CPU_RIXI; | 1642 | c->options |= MIPS_CPU_RIXI; |
| 1643 | reserve_exception_space(0x400, VECTORSPACING * 64); | ||
| 1641 | } else { | 1644 | } else { |
| 1642 | c->cputype = CPU_BMIPS4350; | 1645 | c->cputype = CPU_BMIPS4350; |
| 1643 | __cpu_name[cpu] = "Broadcom BMIPS4350"; | 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 | __cpu_name[cpu] = "Broadcom BMIPS5000"; | 1657 | __cpu_name[cpu] = "Broadcom BMIPS5000"; |
| 1655 | set_elf_platform(cpu, "bmips5000"); | 1658 | set_elf_platform(cpu, "bmips5000"); |
| 1656 | c->options |= MIPS_CPU_ULRI | MIPS_CPU_RIXI; | 1659 | c->options |= MIPS_CPU_ULRI | MIPS_CPU_RIXI; |
| 1660 | reserve_exception_space(0x1000, VECTORSPACING * 64); | ||
| 1657 | break; | 1661 | break; |
| 1658 | } | 1662 | } |
| 1659 | } | 1663 | } |
| @@ -2133,6 +2137,8 @@ void cpu_probe(void) · 473 unmodified lines | |||
| 2133 | if (cpu == 0) | 2137 | if (cpu == 0) |
| 2134 | __ua_limit = ~((1ull << cpu_vmbits) - 1); | 2138 | __ua_limit = ~((1ull << cpu_vmbits) - 1); |
| 2135 | #endif | 2139 | #endif |
| 2140 | |||
| 2141 | reserve_exception_space(0, 0x1000); | ||
| 2136 | } | 2142 | } |
| 2137 | 2143 | ||
| 2138 | void cpu_report(void) | 2144 | void cpu_report(void) |
| @@ -21,6 +21,7 @@ · 20 unmodified lines | |||
| 21 | #include <asm/fpu.h> | 21 | #include <asm/fpu.h> |
| 22 | #include <asm/mipsregs.h> | 22 | #include <asm/mipsregs.h> |
| 23 | #include <asm/elf.h> | 23 | #include <asm/elf.h> |
| 24 | #include <asm/traps.h> | ||
| 24 | 25 | ||
| 25 | #include "fpu-probe.h" | 26 | #include "fpu-probe.h" |
| 26 | 27 | ||
| @@ -158,6 +159,8 @@ void cpu_probe(void) · 131 unmodified lines | |||
| 158 | cpu_set_fpu_opts(c); | 159 | cpu_set_fpu_opts(c); |
| 159 | else | 160 | else |
| 160 | cpu_set_nofpu_opts(c); | 161 | cpu_set_nofpu_opts(c); |
| 162 | |||
| 163 | reserve_exception_space(0, 0x400); | ||
| 161 | } | 164 | } |
| 162 | 165 | ||
| 163 | void cpu_report(void) | 166 | void cpu_report(void) |
| @@ -43,7 +43,7 @@ · 42 unmodified lines | |||
| 43 | #include <asm/prom.h> | 43 | #include <asm/prom.h> |
| 44 | 44 | ||
| 45 | #ifdef CONFIG_MIPS_ELF_APPENDED_DTB | 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 | #endif /* CONFIG_MIPS_ELF_APPENDED_DTB */ | 47 | #endif /* CONFIG_MIPS_ELF_APPENDED_DTB */ |
| 48 | 48 | ||
| 49 | struct cpuinfo_mips cpu_data[NR_CPUS] __read_mostly; | 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 | nmi_exit(); | 2009 | nmi_exit(); |
| 2010 | } | 2010 | } |
| 2011 | 2011 | ||
| 2012 | #define VECTORSPACING 0x100 /* for EI/VI mode */ | ||
| 2013 | |||
| 2014 | unsigned long ebase; | 2012 | unsigned long ebase; |
| 2015 | EXPORT_SYMBOL_GPL(ebase); | 2013 | EXPORT_SYMBOL_GPL(ebase); |
| 2016 | unsigned long exception_handlers[32]; | 2014 | unsigned long exception_handlers[32]; |
| 2017 | unsigned long vi_handlers[64]; | 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 | void __init *set_except_vector(int n, void *addr) | 2022 | void __init *set_except_vector(int n, void *addr) |
| 2020 | { | 2023 | { |
| 2021 | unsigned long handler = (unsigned long) addr; | 2024 | unsigned long handler = (unsigned long) addr; |
| @@ -2367,10 +2370,7 @@ void __init trap_init(void) · 345 unmodified lines | |||
| 2367 | 2370 | ||
| 2368 | if (!cpu_has_mips_r2_r6) { | 2371 | if (!cpu_has_mips_r2_r6) { |
| 2369 | ebase = CAC_BASE; | 2372 | ebase = CAC_BASE; |
| 2370 | ebase_pa = virt_to_phys((void *)ebase); | ||
| 2371 | vec_size = 0x400; | 2373 | vec_size = 0x400; |
| 2372 | |||
| 2373 | memblock_reserve(ebase_pa, vec_size); | ||
| 2374 | } else { | 2374 | } else { |
| 2375 | if (cpu_has_veic || cpu_has_vint) | 2375 | if (cpu_has_veic || cpu_has_vint) |
| 2376 | vec_size = 0x200 + VECTORSPACING*64; | 2376 | vec_size = 0x200 + VECTORSPACING*64; |
| @@ -145,6 +145,7 @@ SECTIONS · 144 unmodified lines | |||
| 145 | } | 145 | } |
| 146 | 146 | ||
| 147 | #ifdef CONFIG_MIPS_ELF_APPENDED_DTB | 147 | #ifdef CONFIG_MIPS_ELF_APPENDED_DTB |
| 148 | STRUCT_ALIGN(); | ||
| 148 | .appended_dtb : AT(ADDR(.appended_dtb) - LOAD_OFFSET) { | 149 | .appended_dtb : AT(ADDR(.appended_dtb) - LOAD_OFFSET) { |
| 149 | *(.appended_dtb) | 150 | *(.appended_dtb) |
| 150 | KEEP(*(.appended_dtb)) | 151 | KEEP(*(.appended_dtb)) |
| @@ -172,6 +173,11 @@ SECTIONS · 21 unmodified lines | |||
| 172 | #endif | 173 | #endif |
| 173 | 174 | ||
| 174 | #ifdef CONFIG_MIPS_RAW_APPENDED_DTB | 175 | #ifdef CONFIG_MIPS_RAW_APPENDED_DTB |
| 176 | .fill : { | ||
| 177 | FILL(0); | ||
| 178 | BYTE(0); | ||
| 179 | STRUCT_ALIGN(); | ||
| 180 | } | ||
| 175 | __appended_dtb = .; | 181 | __appended_dtb = .; |
| 176 | /* leave space for appended DTB */ | 182 | /* leave space for appended DTB */ |
| 177 | . += 0x100000; | 183 | . += 0x100000; |
| @@ -238,7 +238,7 @@ void flush_dcache_page(struct page *page) · 237 unmodified lines | |||
| 238 | { | 238 | { |
| 239 | struct address_space *mapping; | 239 | struct address_space *mapping; |
| 240 | 240 | ||
| 241 | mapping = page_mapping(page); | 241 | mapping = page_mapping_file(page); |
| 242 | if (mapping && !mapping_mapped(mapping)) | 242 | if (mapping && !mapping_mapped(mapping)) |
| 243 | set_bit(PG_dcache_dirty, &page->flags); | 243 | set_bit(PG_dcache_dirty, &page->flags); |
| 244 | else { | 244 | else { |
| @@ -203,9 +203,12 @@ config PREFETCH · 202 unmodified lines | |||
| 203 | def_bool y | 203 | def_bool y |
| 204 | depends on PA8X00 || PA7200 | 204 | depends on PA8X00 || PA7200 |
| 205 | 205 | ||
| 206 | config PARISC_HUGE_KERNEL | ||
| 207 | def_bool y if !MODULES || UBSAN || FTRACE || COMPILE_TEST | ||
| 208 | |||
| 206 | config MLONGCALLS | 209 | config MLONGCALLS |
| 207 | def_bool y if !MODULES || UBSAN || FTRACE | 210 | def_bool y if PARISC_HUGE_KERNEL |
| 208 | bool "Enable the -mlong-calls compiler option for big kernels" if MODULES && !UBSAN && !FTRACE | 211 | bool "Enable the -mlong-calls compiler option for big kernels" if !PARISC_HUGE_KERNEL |
| 209 | depends on PA8X00 | 212 | depends on PA8X00 |
| 210 | help | 213 | help |
| 211 | If you configure the kernel to include many drivers built-in instead | 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 | #endif | 72 | #endif |
| 73 | case 4: return __cmpxchg_u32((unsigned int *)ptr, | 73 | case 4: return __cmpxchg_u32((unsigned int *)ptr, |
| 74 | (unsigned int)old, (unsigned int)new_); | 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 | __cmpxchg_called_with_bad_pointer(); | 77 | __cmpxchg_called_with_bad_pointer(); |
| 78 | return old; | 78 | return old; |
| @@ -272,7 +272,6 @@ on downward growing arches, it looks like this: · 271 unmodified lines | |||
| 272 | regs->gr[23] = 0; \ | 272 | regs->gr[23] = 0; \ |
| 273 | } while(0) | 273 | } while(0) |
| 274 | 274 | ||
| 275 | struct task_struct; | ||
| 276 | struct mm_struct; | 275 | struct mm_struct; |
| 277 | 276 | ||
| 278 | /* Free all resources held by a thread. */ | 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 | #ifdef CONFIG_64BIT | 569 | #ifdef CONFIG_64BIT |
| 570 | #include <linux/compat.h> | ||
| 571 | |||
| 572 | static int gpr32_get(struct task_struct *target, | 570 | static int gpr32_get(struct task_struct *target, |
| 573 | const struct user_regset *regset, | 571 | const struct user_regset *regset, |
| 574 | struct membuf to) | 572 | struct membuf to) |
| @@ -5,34 +5,10 @@ · 4 unmodified lines | |||
| 5 | * Floating-point emulation code | 5 | * Floating-point emulation code |
| 6 | * Copyright (C) 2001 Hewlett-Packard (Paul Bame) <bame@debian.org> | 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 | #ifndef _MACHINE_FPU_INCLUDED /* allows multiple inclusion */ | 9 | #ifndef _MACHINE_FPU_INCLUDED /* allows multiple inclusion */ |
| 27 | #define _MACHINE_FPU_INCLUDED | 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 | #define PA83_FPU_FLAG 0x00000001 | 12 | #define PA83_FPU_FLAG 0x00000001 |
| 37 | #define PA89_FPU_FLAG 0x00000002 | 13 | #define PA89_FPU_FLAG 0x00000002 |
| 38 | #define PA2_0_FPU_FLAG 0x00000010 | 14 | #define PA2_0_FPU_FLAG 0x00000010 |
| @@ -43,21 +19,19 @@ · 4 unmodified lines | |||
| 43 | #define COPR_FP 0x00000080 /* Floating point -- Coprocessor 0 */ | 19 | #define COPR_FP 0x00000080 /* Floating point -- Coprocessor 0 */ |
| 44 | #define SFU_MPY_DIVIDE 0x00008000 /* Multiply/Divide __ SFU 0 */ | 20 | #define SFU_MPY_DIVIDE 0x00008000 /* Multiply/Divide __ SFU 0 */ |
| 45 | 21 | ||
| 46 | |||
| 47 | #define EM_FPU_TYPE_OFFSET 272 | 22 | #define EM_FPU_TYPE_OFFSET 272 |
| 48 | 23 | ||
| 49 | /* version of EMULATION software for COPR,0,0 instruction */ | 24 | /* version of EMULATION software for COPR,0,0 instruction */ |
| 50 | #define EMULATION_VERSION 4 | 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) | 28 | * The only way to differentiate between TIMEX and ROLEX (or PCX-S and PCX-T) |
| 54 | * is thorough the potential type field from the PDC_MODEL call. The | 29 | * is through the potential type field from the PDC_MODEL call. |
| 55 | * following flags are used at assist this differeniation. | 30 | * The following flags are used to assist this differentiation. |
| 56 | */ | 31 | */ |
| 57 | 32 | ||
| 58 | #define ROLEX_POTENTIAL_KEY_FLAGS PDC_MODEL_CPU_KEY_WORD_TO_IO | 33 | #define ROLEX_POTENTIAL_KEY_FLAGS PDC_MODEL_CPU_KEY_WORD_TO_IO |
| 59 | #define TIMEX_POTENTIAL_KEY_FLAGS (PDC_MODEL_CPU_KEY_QUAD_STORE | \ | 34 | #define TIMEX_POTENTIAL_KEY_FLAGS (PDC_MODEL_CPU_KEY_QUAD_STORE | \ |
| 60 | PDC_MODEL_CPU_KEY_RECIP_SQRT) | 35 | PDC_MODEL_CPU_KEY_RECIP_SQRT) |
| 61 | 36 | ||
| 62 | |||
| 63 | #endif /* ! _MACHINE_FPU_INCLUDED */ | 37 | #endif /* ! _MACHINE_FPU_INCLUDED */ |
| @@ -73,9 +73,10 @@ void __patch_exception(int exc, unsigned long addr); · 72 unmodified lines | |||
| 73 | #endif | 73 | #endif |
| 74 | 74 | ||
| 75 | #define OP_RT_RA_MASK 0xffff0000UL | 75 | #define OP_RT_RA_MASK 0xffff0000UL |
| 76 | #define LIS_R2 0x3c020000UL | 76 | #define LIS_R2 (PPC_INST_ADDIS | __PPC_RT(R2)) |
| 77 | #define ADDIS_R2_R12 0x3c4c0000UL | 77 | #define ADDIS_R2_R12 (PPC_INST_ADDIS | __PPC_RT(R2) | __PPC_RA(R12)) |
| 78 | #define ADDI_R2_R2 0x38420000UL | 78 | #define ADDI_R2_R2 (PPC_INST_ADDI | __PPC_RT(R2) | __PPC_RA(R2)) |
| 79 | |||
| 79 | 80 | ||
| 80 | static inline unsigned long ppc_function_entry(void *func) | 81 | static inline unsigned long ppc_function_entry(void *func) |
| 81 | { | 82 | { |
| @@ -7,7 +7,7 @@ · 6 unmodified lines | |||
| 7 | #include <linux/bug.h> | 7 | #include <linux/bug.h> |
| 8 | #include <asm/cputable.h> | 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 | return !!((CPU_FTRS_ALWAYS & feature) || | 12 | return !!((CPU_FTRS_ALWAYS & feature) || |
| 13 | (CPU_FTRS_POSSIBLE & cur_cpu_spec->cpu_features & feature)); | 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 | return static_branch_likely(&cpu_feature_keys[i]); | 46 | return static_branch_likely(&cpu_feature_keys[i]); |
| 47 | } | 47 | } |
| 48 | #else | 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 | return early_cpu_has_feature(feature); | 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 | #define mfdcr(rn) \ | 53 | #define mfdcr(rn) \ |
| 54 | ({unsigned int rval; \ | 54 | ({unsigned int rval; \ |
| 55 | if (__builtin_constant_p(rn) && rn < 1024) \ | 55 | if (__builtin_constant_p(rn) && rn < 1024) \ |
| 56 | asm volatile("mfdcr %0," __stringify(rn) \ | 56 | asm volatile("mfdcr %0, %1" : "=r" (rval) \ |
| 57 | : "=r" (rval)); \ | 57 | : "n" (rn)); \ |
| 58 | else if (likely(cpu_has_feature(CPU_FTR_INDEXED_DCR))) \ | 58 | else if (likely(cpu_has_feature(CPU_FTR_INDEXED_DCR))) \ |
| 59 | rval = mfdcrx(rn); \ | 59 | rval = mfdcrx(rn); \ |
| 60 | else \ | 60 | else \ |
| @@ -64,8 +64,8 @@ static inline void mtdcrx(unsigned int reg, unsigned int val) · 3 unmodified lines | |||
| 64 | #define mtdcr(rn, v) \ | 64 | #define mtdcr(rn, v) \ |
| 65 | do { \ | 65 | do { \ |
| 66 | if (__builtin_constant_p(rn) && rn < 1024) \ | 66 | if (__builtin_constant_p(rn) && rn < 1024) \ |
| 67 | asm volatile("mtdcr " __stringify(rn) ",%0" \ | 67 | asm volatile("mtdcr %0, %1" \ |
| 68 | : : "r" (v)); \ | 68 | : : "n" (rn), "r" (v)); \ |
| 69 | else if (likely(cpu_has_feature(CPU_FTR_INDEXED_DCR))) \ | 69 | else if (likely(cpu_has_feature(CPU_FTR_INDEXED_DCR))) \ |
| 70 | mtdcrx(rn, v); \ | 70 | mtdcrx(rn, v); \ |
| 71 | else \ | 71 | else \ |
| @@ -410,7 +410,6 @@ DECLARE_INTERRUPT_HANDLER(altivec_assist_exception); · 409 unmodified lines | |||
| 410 | DECLARE_INTERRUPT_HANDLER(CacheLockingException); | 410 | DECLARE_INTERRUPT_HANDLER(CacheLockingException); |
| 411 | DECLARE_INTERRUPT_HANDLER(SPEFloatingPointException); | 411 | DECLARE_INTERRUPT_HANDLER(SPEFloatingPointException); |
| 412 | DECLARE_INTERRUPT_HANDLER(SPEFloatingPointRoundException); | 412 | DECLARE_INTERRUPT_HANDLER(SPEFloatingPointRoundException); |
| 413 | DECLARE_INTERRUPT_HANDLER(unrecoverable_exception); | ||
| 414 | DECLARE_INTERRUPT_HANDLER(WatchdogException); | 413 | DECLARE_INTERRUPT_HANDLER(WatchdogException); |
| 415 | DECLARE_INTERRUPT_HANDLER(kernel_bad_stack); | 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 | DECLARE_INTERRUPT_HANDLER_ASYNC(TAUException); | 437 | DECLARE_INTERRUPT_HANDLER_ASYNC(TAUException); |
| 439 | 438 | ||
| 439 | void unrecoverable_exception(struct pt_regs *regs); | ||
| 440 | |||
| 440 | void replay_system_reset(void); | 441 | void replay_system_reset(void); |
| 441 | void replay_soft_interrupts(void); | 442 | void replay_soft_interrupts(void); |
| 442 | 443 | ||
| @@ -228,7 +228,7 @@ enum { · 227 unmodified lines | |||
| 228 | #define MMU_FTRS_ALWAYS 0 | 228 | #define MMU_FTRS_ALWAYS 0 |
| 229 | #endif | 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 | if (MMU_FTRS_ALWAYS & feature) | 233 | if (MMU_FTRS_ALWAYS & feature) |
| 234 | return true; | 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 | return early_mmu_has_feature(feature); | 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 | #define TRAP_FLAGS_MASK 0x11 | 195 | #define TRAP_FLAGS_MASK 0x11 |
| 196 | #define TRAP(regs) ((regs)->trap & ~TRAP_FLAGS_MASK) | 196 | #define TRAP(regs) ((regs)->trap & ~TRAP_FLAGS_MASK) |
| 197 | #define FULL_REGS(regs) (((regs)->trap & 1) == 0) | 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 | #endif | 199 | #endif |
| 200 | #define CHECK_FULL_REGS(regs) BUG_ON(!FULL_REGS(regs)) | 200 | #define CHECK_FULL_REGS(regs) BUG_ON(!FULL_REGS(regs)) |
| 201 | #define NV_REG_POISON 0xdeadbeefdeadbeefUL | 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 | #define TRAP_FLAGS_MASK 0x1F | 210 | #define TRAP_FLAGS_MASK 0x1F |
| 211 | #define TRAP(regs) ((regs)->trap & ~TRAP_FLAGS_MASK) | 211 | #define TRAP(regs) ((regs)->trap & ~TRAP_FLAGS_MASK) |
| 212 | #define FULL_REGS(regs) (((regs)->trap & 1) == 0) | 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 | #define IS_CRITICAL_EXC(regs) (((regs)->trap & 2) != 0) | 214 | #define IS_CRITICAL_EXC(regs) (((regs)->trap & 2) != 0) |
| 215 | #define IS_MCHECK_EXC(regs) (((regs)->trap & 4) != 0) | 215 | #define IS_MCHECK_EXC(regs) (((regs)->trap & 4) != 0) |
| 216 | #define IS_DEBUG_EXC(regs) (((regs)->trap & 8) != 0) | 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 | msr_check_and_clear(MSR_FP|MSR_VEC|MSR_VSX); | 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 | #endif | 84 | #endif |
| 75 | 85 | ||
| 76 | #ifdef CONFIG_SPE | 86 | #ifdef CONFIG_SPE |
| @@ -113,7 +113,7 @@ struct vio_driver { · 112 unmodified lines | |||
| 113 | const char *name; | 113 | const char *name; |
| 114 | const struct vio_device_id *id_table; | 114 | const struct vio_device_id *id_table; |
| 115 | int (*probe)(struct vio_dev *dev, const struct vio_device_id *id); | 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 | /* A driver must have a get_desired_dma() function to | 117 | /* A driver must have a get_desired_dma() function to |
| 118 | * be loaded in a CMO environment if it uses DMA. | 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 | targets += prom_init_check | 191 | targets += prom_init_check |
| 192 | 192 | ||
| 193 | clean-files := vmlinux.lds | 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 | ld r10,PACAKMSR(r13) /* get MSR value for kernel */ | 467 | ld r10,PACAKMSR(r13) /* get MSR value for kernel */ |
| 468 | /* MSR[RI] is clear iff using SRR regs */ | 468 | /* MSR[RI] is clear iff using SRR regs */ |
| 469 | .if IHSRR == EXC_HV_OR_STD | 469 | .if IHSRR_IF_HVMODE |
| 470 | BEGIN_FTR_SECTION | 470 | BEGIN_FTR_SECTION |
| 471 | xori r10,r10,MSR_RI | 471 | xori r10,r10,MSR_RI |
| 472 | END_FTR_SECTION_IFCLR(CPU_FTR_HVMODE) | 472 | END_FTR_SECTION_IFCLR(CPU_FTR_HVMODE) |
| @@ -457,11 +457,12 @@ InstructionTLBMiss: · 456 unmodified lines | |||
| 457 | cmplw 0,r1,r3 | 457 | cmplw 0,r1,r3 |
| 458 | #endif | 458 | #endif |
| 459 | mfspr r2, SPRN_SDR1 | 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 | rlwinm r2, r2, 28, 0xfffff000 | 461 | rlwinm r2, r2, 28, 0xfffff000 |
| 462 | #ifdef CONFIG_MODULES | 462 | #ifdef CONFIG_MODULES |
| 463 | bgt- 112f | 463 | bgt- 112f |
| 464 | lis r2, (swapper_pg_dir - PAGE_OFFSET)@ha /* if kernel address, use */ | 464 | lis r2, (swapper_pg_dir - PAGE_OFFSET)@ha /* if kernel address, use */ |
| 465 | li r1,_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_EXEC | ||
| 465 | addi r2, r2, (swapper_pg_dir - PAGE_OFFSET)@l /* kernel page table */ | 466 | addi r2, r2, (swapper_pg_dir - PAGE_OFFSET)@l /* kernel page table */ |
| 466 | #endif | 467 | #endif |
| 467 | 112: rlwimi r2,r3,12,20,29 /* insert top 10 bits of address */ | 468 | 112: rlwimi r2,r3,12,20,29 /* insert top 10 bits of address */ |
| @@ -520,10 +521,11 @@ DataLoadTLBMiss: · 52 unmodified lines | |||
| 520 | lis r1, TASK_SIZE@h /* check if kernel address */ | 521 | lis r1, TASK_SIZE@h /* check if kernel address */ |
| 521 | cmplw 0,r1,r3 | 522 | cmplw 0,r1,r3 |
| 522 | mfspr r2, SPRN_SDR1 | 523 | mfspr r2, SPRN_SDR1 |
| 523 | li r1, _PAGE_PRESENT | _PAGE_ACCESSED | 524 | li r1, _PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_USER |
| 524 | rlwinm r2, r2, 28, 0xfffff000 | 525 | rlwinm r2, r2, 28, 0xfffff000 |
| 525 | bgt- 112f | 526 | bgt- 112f |
| 526 | lis r2, (swapper_pg_dir - PAGE_OFFSET)@ha /* if kernel address, use */ | 527 | lis r2, (swapper_pg_dir - PAGE_OFFSET)@ha /* if kernel address, use */ |
| 528 | li r1, _PAGE_PRESENT | _PAGE_ACCESSED | ||
| 527 | addi r2, r2, (swapper_pg_dir - PAGE_OFFSET)@l /* kernel page table */ | 529 | addi r2, r2, (swapper_pg_dir - PAGE_OFFSET)@l /* kernel page table */ |
| 528 | 112: rlwimi r2,r3,12,20,29 /* insert top 10 bits of address */ | 530 | 112: rlwimi r2,r3,12,20,29 /* insert top 10 bits of address */ |
| 529 | lwz r2,0(r2) /* get pmd entry */ | 531 | lwz r2,0(r2) /* get pmd entry */ |
| @@ -597,10 +599,11 @@ DataStoreTLBMiss: · 67 unmodified lines | |||
| 597 | lis r1, TASK_SIZE@h /* check if kernel address */ | 599 | lis r1, TASK_SIZE@h /* check if kernel address */ |
| 598 | cmplw 0,r1,r3 | 600 | cmplw 0,r1,r3 |
| 599 | mfspr r2, SPRN_SDR1 | 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 | rlwinm r2, r2, 28, 0xfffff000 | 603 | rlwinm r2, r2, 28, 0xfffff000 |
| 602 | bgt- 112f | 604 | bgt- 112f |
| 603 | lis r2, (swapper_pg_dir - PAGE_OFFSET)@ha /* if kernel address, use */ | 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 | addi r2, r2, (swapper_pg_dir - PAGE_OFFSET)@l /* kernel page table */ | 607 | addi r2, r2, (swapper_pg_dir - PAGE_OFFSET)@l /* kernel page table */ |
| 605 | 112: rlwimi r2,r3,12,20,29 /* insert top 10 bits of address */ | 608 | 112: rlwimi r2,r3,12,20,29 /* insert top 10 bits of address */ |
| 606 | lwz r2,0(r2) /* get pmd entry */ | 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 | * enabled when the interrupt handler returns (indicating a process-context / | 149 | * enabled when the interrupt handler returns (indicating a process-context / |
| 150 | * synchronous interrupt) then irqs_enabled should be true. | 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 | /* This must be done with RI=1 because tracing may touch vmaps */ | 154 | /* This must be done with RI=1 because tracing may touch vmaps */ |
| 155 | trace_hardirqs_on(); | 155 | trace_hardirqs_on(); |
| @@ -436,7 +436,6 @@ again: · 280 unmodified lines | |||
| 436 | return ret; | 436 | return ret; |
| 437 | } | 437 | } |
| 438 | 438 | ||
| 439 | void unrecoverable_exception(struct pt_regs *regs); | ||
| 440 | void preempt_schedule_irq(void); | 439 | void preempt_schedule_irq(void); |
| 441 | 440 | ||
| 442 | notrace unsigned long interrupt_exit_kernel_prepare(struct pt_regs *regs, unsigned long msr) | 441 | notrace unsigned long interrupt_exit_kernel_prepare(struct pt_regs *regs, unsigned long msr) |
| @@ -6,11 +6,11 @@ · 5 unmodified lines | |||
| 6 | CFLAGS_ptrace-view.o += -DUTS_MACHINE='"$(UTS_MACHINE)"' | 6 | CFLAGS_ptrace-view.o += -DUTS_MACHINE='"$(UTS_MACHINE)"' |
| 7 | 7 | ||
| 8 | obj-y += ptrace.o ptrace-view.o | 8 | obj-y += ptrace.o ptrace-view.o |
| 9 | obj-$(CONFIG_PPC_FPU_REGS) += ptrace-fpu.o | 9 | obj-y += ptrace-fpu.o |
| 10 | obj-$(CONFIG_COMPAT) += ptrace32.o | 10 | obj-$(CONFIG_COMPAT) += ptrace32.o |
| 11 | obj-$(CONFIG_VSX) += ptrace-vsx.o | 11 | obj-$(CONFIG_VSX) += ptrace-vsx.o |
| 12 | ifneq ($(CONFIG_VSX),y) | 12 | ifneq ($(CONFIG_VSX),y) |
| 13 | obj-$(CONFIG_PPC_FPU_REGS) += ptrace-novsx.o | 13 | obj-y += ptrace-novsx.o |
| 14 | endif | 14 | endif |
| 15 | obj-$(CONFIG_ALTIVEC) += ptrace-altivec.o | 15 | obj-$(CONFIG_ALTIVEC) += ptrace-altivec.o |
| 16 | obj-$(CONFIG_SPE) += ptrace-spe.o | 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 | extern const struct user_regset_view user_ppc_native_view; | 165 | extern const struct user_regset_view user_ppc_native_view; |
| 166 | 166 | ||
| 167 | /* ptrace-fpu */ | 167 | /* ptrace-fpu */ |
| 168 | #ifdef CONFIG_PPC_FPU_REGS | ||
| 169 | int ptrace_get_fpr(struct task_struct *child, int index, unsigned long *data); | 168 | int ptrace_get_fpr(struct task_struct *child, int index, unsigned long *data); |
| 170 | int ptrace_put_fpr(struct task_struct *child, int index, unsigned long data); | 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 | /* ptrace-(no)adv */ | 171 | /* ptrace-(no)adv */ |
| 186 | void ppc_gethwdinfo(struct ppc_debug_info *dbginfo); | 172 | void ppc_gethwdinfo(struct ppc_debug_info *dbginfo); |
| @@ -8,32 +8,42 @@ · 7 unmodified lines | |||
| 8 | 8 | ||
| 9 | int ptrace_get_fpr(struct task_struct *child, int index, unsigned long *data) | 9 | int ptrace_get_fpr(struct task_struct *child, int index, unsigned long *data) |
| 10 | { | 10 | { |
| 11 | #ifdef CONFIG_PPC_FPU_REGS | ||
| 11 | unsigned int fpidx = index - PT_FPR0; | 12 | unsigned int fpidx = index - PT_FPR0; |
| 13 | #endif | ||
| 12 | 14 | ||
| 13 | if (index > PT_FPSCR) | 15 | if (index > PT_FPSCR) |
| 14 | return -EIO; | 16 | return -EIO; |
| 15 | 17 | ||
| 18 | #ifdef CONFIG_PPC_FPU_REGS | ||
| 16 | flush_fp_to_thread(child); | 19 | flush_fp_to_thread(child); |
| 17 | if (fpidx < (PT_FPSCR - PT_FPR0)) | 20 | if (fpidx < (PT_FPSCR - PT_FPR0)) |
| 18 | memcpy(data, &child->thread.TS_FPR(fpidx), sizeof(long)); | 21 | memcpy(data, &child->thread.TS_FPR(fpidx), sizeof(long)); |
| 19 | else | 22 | else |
| 20 | *data = child->thread.fp_state.fpscr; | 23 | *data = child->thread.fp_state.fpscr; |
| 24 | #else | ||
| 25 | *data = 0; | ||
| 26 | #endif | ||
| 21 | 27 | ||
| 22 | return 0; | 28 | return 0; |
| 23 | } | 29 | } |
| 24 | 30 | ||
| 25 | int ptrace_put_fpr(struct task_struct *child, int index, unsigned long data) | 31 | int ptrace_put_fpr(struct task_struct *child, int index, unsigned long data) |
| 26 | { | 32 | { |
| 33 | #ifdef CONFIG_PPC_FPU_REGS | ||
| 27 | unsigned int fpidx = index - PT_FPR0; | 34 | unsigned int fpidx = index - PT_FPR0; |
| 35 | #endif | ||
| 28 | 36 | ||
| 29 | if (index > PT_FPSCR) | 37 | if (index > PT_FPSCR) |
| 30 | return -EIO; | 38 | return -EIO; |
| 31 | 39 | ||
| 40 | #ifdef CONFIG_PPC_FPU_REGS | ||
| 32 | flush_fp_to_thread(child); | 41 | flush_fp_to_thread(child); |
| 33 | if (fpidx < (PT_FPSCR - PT_FPR0)) | 42 | if (fpidx < (PT_FPSCR - PT_FPR0)) |
| 34 | memcpy(&child->thread.TS_FPR(fpidx), &data, sizeof(long)); | 43 | memcpy(&child->thread.TS_FPR(fpidx), &data, sizeof(long)); |
| 35 | else | 44 | else |
| 36 | child->thread.fp_state.fpscr = data; | 45 | child->thread.fp_state.fpscr = data; |
| 46 | #endif | ||
| 37 | 47 | ||
| 38 | return 0; | 48 | return 0; |
| 39 | } | 49 | } |
| @@ -21,12 +21,16 @@ · 20 unmodified lines | |||
| 21 | int fpr_get(struct task_struct *target, const struct user_regset *regset, | 21 | int fpr_get(struct task_struct *target, const struct user_regset *regset, |
| 22 | struct membuf to) | 22 | struct membuf to) |
| 23 | { | 23 | { |
| 24 | #ifdef CONFIG_PPC_FPU_REGS | ||
| 24 | BUILD_BUG_ON(offsetof(struct thread_fp_state, fpscr) != | 25 | BUILD_BUG_ON(offsetof(struct thread_fp_state, fpscr) != |
| 25 | offsetof(struct thread_fp_state, fpr[32])); | 26 | offsetof(struct thread_fp_state, fpr[32])); |
| 26 | 27 | ||
| 27 | flush_fp_to_thread(target); | 28 | flush_fp_to_thread(target); |
| 28 | 29 | ||
| 29 | return membuf_write(&to, &target->thread.fp_state, 33 * sizeof(u64)); | 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 | unsigned int pos, unsigned int count, | 50 | unsigned int pos, unsigned int count, |
| 47 | const void *kbuf, const void __user *ubuf) | 51 | const void *kbuf, const void __user *ubuf) |
| 48 | { | 52 | { |
| 53 | #ifdef CONFIG_PPC_FPU_REGS | ||
| 49 | BUILD_BUG_ON(offsetof(struct thread_fp_state, fpscr) != | 54 | BUILD_BUG_ON(offsetof(struct thread_fp_state, fpscr) != |
| 50 | offsetof(struct thread_fp_state, fpr[32])); | 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 | return user_regset_copyin(&pos, &count, &kbuf, &ubuf, | 59 | return user_regset_copyin(&pos, &count, &kbuf, &ubuf, |
| 55 | &target->thread.fp_state, 0, -1); | 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 | .size = sizeof(long), .align = sizeof(long), | 522 | .size = sizeof(long), .align = sizeof(long), |
| 523 | .regset_get = gpr_get, .set = gpr_set | 523 | .regset_get = gpr_get, .set = gpr_set |
| 524 | }, | 524 | }, |
| 525 | #ifdef CONFIG_PPC_FPU_REGS | ||
| 526 | [REGSET_FPR] = { | 525 | [REGSET_FPR] = { |
| 527 | .core_note_type = NT_PRFPREG, .n = ELF_NFPREG, | 526 | .core_note_type = NT_PRFPREG, .n = ELF_NFPREG, |
| 528 | .size = sizeof(double), .align = sizeof(double), | 527 | .size = sizeof(double), .align = sizeof(double), |
| 529 | .regset_get = fpr_get, .set = fpr_set | 528 | .regset_get = fpr_get, .set = fpr_set |
| 530 | }, | 529 | }, |
| 531 | #endif | ||
| 532 | #ifdef CONFIG_ALTIVEC | 530 | #ifdef CONFIG_ALTIVEC |
| 533 | [REGSET_VMX] = { | 531 | [REGSET_VMX] = { |
| 534 | .core_note_type = NT_PPC_VMX, .n = 34, | 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 | else | 775 | else |
| 776 | prepare_save_user_regs(1); | 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 | goto badframe; | 779 | goto badframe; |
| 780 | 780 | ||
| 781 | /* Put the siginfo & fill in most of the ucontext */ | 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 | unsafe_put_user(PPC_INST_ADDI + __NR_rt_sigreturn, &mctx->mc_pad[0], | 809 | unsafe_put_user(PPC_INST_ADDI + __NR_rt_sigreturn, &mctx->mc_pad[0], |
| 810 | failed); | 810 | failed); |
| 811 | unsafe_put_user(PPC_INST_SC, &mctx->mc_pad[1], failed); | 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 | unsafe_put_sigset_t(&frame->uc.uc_sigmask, oldset, failed); | 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 | if (copy_siginfo_to_user(&frame->info, &ksig->info)) | 818 | if (copy_siginfo_to_user(&frame->info, &ksig->info)) |
| 818 | goto badframe; | 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 | regs->link = tramp; | 821 | regs->link = tramp; |
| 824 | 822 | ||
| 825 | #ifdef CONFIG_PPC_FPU_REGS | 823 | #ifdef CONFIG_PPC_FPU_REGS |
| @@ -844,7 +842,7 @@ int handle_rt_signal32(struct ksignal *ksig, sigset_t *oldset, · 18 unmodified lines | |||
| 844 | return 0; | 842 | return 0; |
| 845 | 843 | ||
| 846 | failed: | 844 | failed: |
| 847 | user_write_access_end(); | 845 | user_access_end(); |
| 848 | 846 | ||
| 849 | badframe: | 847 | badframe: |
| 850 | signal_fault(tsk, regs, "handle_rt_signal32", frame); | 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 | else | 877 | else |
| 880 | prepare_save_user_regs(1); | 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 | goto badframe; | 881 | goto badframe; |
| 884 | sc = (struct sigcontext __user *) &frame->sctx; | 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 | /* Set up the sigreturn trampoline: li r0,sigret; sc */ | 906 | /* Set up the sigreturn trampoline: li r0,sigret; sc */ |
| 909 | unsafe_put_user(PPC_INST_ADDI + __NR_sigreturn, &mctx->mc_pad[0], failed); | 907 | unsafe_put_user(PPC_INST_ADDI + __NR_sigreturn, &mctx->mc_pad[0], failed); |
| 910 | unsafe_put_user(PPC_INST_SC, &mctx->mc_pad[1], failed); | 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(); | 911 | user_access_end(); |
| 913 | |||
| 914 | if (tramp == (unsigned long)mctx->mc_pad) | ||
| 915 | flush_icache_range(tramp, tramp + 2 * sizeof(unsigned long)); | ||
| 916 | 912 | ||
| 917 | regs->link = tramp; | 913 | regs->link = tramp; |
| 918 | 914 | ||
| @@ -935,7 +931,7 @@ int handle_signal32(struct ksignal *ksig, sigset_t *oldset, · 16 unmodified lines | |||
| 935 | return 0; | 931 | return 0; |
| 936 | 932 | ||
| 937 | failed: | 933 | failed: |
| 938 | user_write_access_end(); | 934 | user_access_end(); |
| 939 | 935 | ||
| 940 | badframe: | 936 | badframe: |
| 941 | signal_fault(tsk, regs, "handle_signal32", frame); | 937 | signal_fault(tsk, regs, "handle_signal32", frame); |
| @@ -2170,7 +2170,7 @@ DEFINE_INTERRUPT_HANDLER(SPEFloatingPointRoundException) · 2169 unmodified lines | |||
| 2170 | * in the MSR is 0. This indicates that SRR0/1 are live, and that | 2170 | * in the MSR is 0. This indicates that SRR0/1 are live, and that |
| 2171 | * we therefore lost state by taking this exception. | 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 | pr_emerg("Unrecoverable exception %lx at %lx (msr=%lx)\n", | 2175 | pr_emerg("Unrecoverable exception %lx at %lx (msr=%lx)\n", |
| 2176 | regs->trap, regs->nip, regs->msr); | 2176 | regs->trap, regs->nip, regs->msr); |
| @@ -65,3 +65,14 @@ V_FUNCTION_END(__kernel_clock_getres) · 64 unmodified lines | |||
| 65 | V_FUNCTION_BEGIN(__kernel_time) | 65 | V_FUNCTION_BEGIN(__kernel_time) |
| 66 | cvdso_call_time __c_kernel_time | 66 | cvdso_call_time __c_kernel_time |
| 67 | V_FUNCTION_END(__kernel_time) | 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 | if (!address_ok(regs, ea, size) || copy_mem_in(mem, ea, size, regs)) | 904 | if (!address_ok(regs, ea, size) || copy_mem_in(mem, ea, size, regs)) |
| 905 | return -EFAULT; | 905 | return -EFAULT; |
| 906 | 906 | ||
| 907 | nr_vsx_regs = size / sizeof(__vector128); | 907 | nr_vsx_regs = max(1ul, size / sizeof(__vector128)); |
| 908 | emulate_vsx_load(op, buf, mem, cross_endian); | 908 | emulate_vsx_load(op, buf, mem, cross_endian); |
| 909 | preempt_disable(); | 909 | preempt_disable(); |
| 910 | if (reg < 32) { | 910 | if (reg < 32) { |
| @@ -951,7 +951,7 @@ static nokprobe_inline int do_vsx_store(struct instruction_op *op, · 40 unmodified lines | |||
| 951 | if (!address_ok(regs, ea, size)) | 951 | if (!address_ok(regs, ea, size)) |
| 952 | return -EFAULT; | 952 | return -EFAULT; |
| 953 | 953 | ||
| 954 | nr_vsx_regs = size / sizeof(__vector128); | 954 | nr_vsx_regs = max(1ul, size / sizeof(__vector128)); |
| 955 | preempt_disable(); | 955 | preempt_disable(); |
| 956 | if (reg < 32) { | 956 | if (reg < 32) { |
| 957 | /* FP regs + extensions */ | 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 | if (!(mmcra & MMCRA_SAMPLE_ENABLE) || sdar_valid) | 222 | if (!(mmcra & MMCRA_SAMPLE_ENABLE) || sdar_valid) |
| 223 | *addrp = mfspr(SPRN_SDAR); | 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 | *addrp = 0; | 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 | * addresses, hence include a check before filtering code | 507 | * addresses, hence include a check before filtering code |
| 508 | */ | 508 | */ |
| 509 | if (!(ppmu->flags & PPMU_ARCH_31) && | 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 | continue; | 511 | continue; |
| 512 | 512 | ||
| 513 | /* Branches are read most recent first (ie. mfbhrb 0 is | 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 | want_v = hpte_encode_avpn(vpn, psize, ssize); | 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 | if (mmu_has_feature(MMU_FTR_KERNEL_RO)) | 892 | if (mmu_has_feature(MMU_FTR_KERNEL_RO)) |
| 892 | /* Move pp0 into bit 8 (IBM 55) */ | 893 | /* Move pp0 into bit 8 (IBM 55) */ |
| 893 | flags |= (newpp & HPTE_R_PP0) >> 55; | 894 | flags |= (newpp & HPTE_R_PP0) >> 55; |
| @@ -452,12 +452,28 @@ static int do_suspend(void) · 451 unmodified lines | |||
| 452 | return ret; | 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 | static int do_join(void *arg) | 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 | long hvrc; | 473 | long hvrc; |
| 459 | int ret; | 474 | int ret; |
| 460 | 475 | ||
| 476 | retry: | ||
| 461 | /* Must ensure MSR.EE off for H_JOIN. */ | 477 | /* Must ensure MSR.EE off for H_JOIN. */ |
| 462 | hard_irq_disable(); | 478 | hard_irq_disable(); |
| 463 | hvrc = plpar_hcall_norets(H_JOIN); | 479 | hvrc = plpar_hcall_norets(H_JOIN); |
| @@ -473,8 +489,20 @@ static int do_join(void *arg) · 9 unmodified lines | |||
| 473 | case H_SUCCESS: | 489 | case H_SUCCESS: |
| 474 | /* | 490 | /* |
| 475 | * The suspend is complete and this cpu has received a | 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 | ret = 0; | 506 | ret = 0; |
| 479 | break; | 507 | break; |
| 480 | case H_BAD_MODE: | 508 | case H_BAD_MODE: |
| @@ -488,6 +516,13 @@ static int do_join(void *arg) · 7 unmodified lines | |||
| 488 | 516 | ||
| 489 | if (atomic_inc_return(counter) == 1) { | 517 | if (atomic_inc_return(counter) == 1) { |
| 490 | pr_info("CPU %u waking all threads\n", smp_processor_id()); | 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 | prod_others(); | 526 | prod_others(); |
| 492 | } | 527 | } |
| 493 | /* | 528 | /* |
| @@ -535,11 +570,16 @@ static int pseries_suspend(u64 handle) · 41 unmodified lines | |||
| 535 | int ret; | 570 | int ret; |
| 536 | 571 | ||
| 537 | while (true) { | 572 | while (true) { |
| 538 | atomic_t counter = ATOMIC_INIT(0); | 573 | struct pseries_suspend_info info; |
| 539 | unsigned long vasi_state; | 574 | unsigned long vasi_state; |
| 540 | int vasi_err; | 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 | if (ret == 0) | 583 | if (ret == 0) |
| 544 | break; | 584 | break; |
| 545 | /* | 585 | /* |
| @@ -4,6 +4,7 @@ · 3 unmodified lines | |||
| 4 | * Copyright 2006-2007 Michael Ellerman, IBM Corp. | 4 | * Copyright 2006-2007 Michael Ellerman, IBM Corp. |
| 5 | */ | 5 | */ |
| 6 | 6 | ||
| 7 | #include <linux/crash_dump.h> | ||
| 7 | #include <linux/device.h> | 8 | #include <linux/device.h> |
| 8 | #include <linux/irq.h> | 9 | #include <linux/irq.h> |
| 9 | #include <linux/msi.h> | 10 | #include <linux/msi.h> |
| @@ -458,8 +459,28 @@ again: · 448 unmodified lines | |||
| 458 | return hwirq; | 459 | return hwirq; |
| 459 | } | 460 | } |
| 460 | 461 | ||
| 461 | virq = irq_create_mapping_affinity(NULL, hwirq, | 462 | /* |
| 462 | entry->affinity); | 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 | if (!virq) { | 485 | if (!virq) { |
| 465 | pr_debug("rtas_msi: Failed mapping hwirq %d\n", hwirq); | 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 | struct vio_dev *viodev = to_vio_dev(dev); | 1261 | struct vio_dev *viodev = to_vio_dev(dev); |
| 1262 | struct vio_driver *viodrv = to_vio_driver(dev->driver); | 1262 | struct vio_driver *viodrv = to_vio_driver(dev->driver); |
| 1263 | struct device *devptr; | 1263 | struct device *devptr; |
| 1264 | int ret = 1; | ||
| 1265 | 1264 | ||
| 1266 | /* | 1265 | /* |
| 1267 | * Hold a reference to the device after the remove function is called | 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 | devptr = get_device(dev); | 1269 | devptr = get_device(dev); |
| 1271 | 1270 | ||
| 1272 | if (viodrv->remove) | 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 | vio_cmo_bus_remove(viodev); | 1275 | vio_cmo_bus_remove(viodev); |
| 1277 | 1276 | ||
| 1278 | put_device(devptr); | 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 | select PCI_MSI if PCI | 93 | select PCI_MSI if PCI |
| 94 | select RISCV_INTC | 94 | select RISCV_INTC |
| 95 | select RISCV_TIMER if RISCV_SBI | 95 | select RISCV_TIMER if RISCV_SBI |
| 96 | select SPARSEMEM_STATIC if 32BIT | ||
| 97 | select SPARSE_IRQ | 96 | select SPARSE_IRQ |
| 98 | select SYSCTL_EXCEPTION_TRACE | 97 | select SYSCTL_EXCEPTION_TRACE |
| 99 | select THREAD_INFO_IN_TASK | 98 | select THREAD_INFO_IN_TASK |
| @@ -154,7 +153,8 @@ config ARCH_FLATMEM_ENABLE · 54 unmodified lines | |||
| 154 | config ARCH_SPARSEMEM_ENABLE | 153 | config ARCH_SPARSEMEM_ENABLE |
| 155 | def_bool y | 154 | def_bool y |
| 156 | depends on MMU | 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 | config ARCH_SELECT_MEMORY_MODEL | 159 | config ARCH_SELECT_MEMORY_MODEL |
| 160 | def_bool ARCH_SPARSEMEM_ENABLE | 160 | def_bool ARCH_SPARSEMEM_ENABLE |
| @@ -314,7 +314,7 @@ endchoice · 153 unmodified lines | |||
| 314 | # Common NUMA Features | 314 | # Common NUMA Features |
| 315 | config NUMA | 315 | config NUMA |
| 316 | bool "NUMA Memory Allocation and Scheduler Support" | 316 | bool "NUMA Memory Allocation and Scheduler Support" |
| 317 | depends on SMP | 317 | depends on SMP && MMU |
| 318 | select GENERIC_ARCH_NUMA | 318 | select GENERIC_ARCH_NUMA |
| 319 | select OF_NUMA | 319 | select OF_NUMA |
| 320 | select ARCH_SUPPORTS_NUMA_BALANCING | 320 | select ARCH_SUPPORTS_NUMA_BALANCING |
| @@ -31,6 +31,8 @@ config SOC_CANAAN · 30 unmodified lines | |||
| 31 | select SIFIVE_PLIC | 31 | select SIFIVE_PLIC |
| 32 | select ARCH_HAS_RESET_CONTROLLER | 32 | select ARCH_HAS_RESET_CONTROLLER |
| 33 | select PINCTRL | 33 | select PINCTRL |
| 34 | select COMMON_CLK | ||
| 35 | select COMMON_CLK_K210 | ||
| 34 | help | 36 | help |
| 35 | This enables support for Canaan Kendryte K210 SoC platform hardware. | 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 | long long __ashrti3(long long a, int b); | 9 | long long __ashrti3(long long a, int b); |
| 10 | long long __ashlti3(long long a, int b); | 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 | #endif /* _ASM_RISCV_PROTOTYPES_H */ | 28 | #endif /* _ASM_RISCV_PROTOTYPES_H */ |
| @@ -12,4 +12,6 @@ · 11 unmodified lines | |||
| 12 | 12 | ||
| 13 | #include <asm-generic/irq.h> | 13 | #include <asm-generic/irq.h> |
| 14 | 14 | ||
| 15 | extern void __init init_IRQ(void); | ||
| 16 | |||
| 15 | #endif /* _ASM_RISCV_IRQ_H */ | 17 | #endif /* _ASM_RISCV_IRQ_H */ |
| @@ -71,6 +71,7 @@ int riscv_of_processor_hartid(struct device_node *node); · 70 unmodified lines | |||
| 71 | int riscv_of_parent_hartid(struct device_node *node); | 71 | int riscv_of_parent_hartid(struct device_node *node); |
| 72 | 72 | ||
| 73 | extern void riscv_fill_hwcap(void); | 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 | #endif /* __ASSEMBLY__ */ | 76 | #endif /* __ASSEMBLY__ */ |
| 76 | 77 | ||
| @@ -119,6 +119,11 @@ extern int regs_query_register_offset(const char *name); · 118 unmodified lines | |||
| 119 | extern unsigned long regs_get_kernel_stack_nth(struct pt_regs *regs, | 119 | extern unsigned long regs_get_kernel_stack_nth(struct pt_regs *regs, |
| 120 | unsigned int n); | 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 | * regs_get_register() - get register value from its offset | 128 | * regs_get_register() - get register value from its offset |
| 124 | * @regs: pt_regs from which register value is gotten | 129 | * @regs: pt_regs from which register value is gotten |
| @@ -51,10 +51,10 @@ enum sbi_ext_rfence_fid { · 50 unmodified lines | |||
| 51 | SBI_EXT_RFENCE_REMOTE_FENCE_I = 0, | 51 | SBI_EXT_RFENCE_REMOTE_FENCE_I = 0, |
| 52 | SBI_EXT_RFENCE_REMOTE_SFENCE_VMA, | 52 | SBI_EXT_RFENCE_REMOTE_SFENCE_VMA, |
| 53 | SBI_EXT_RFENCE_REMOTE_SFENCE_VMA_ASID, | 53 | SBI_EXT_RFENCE_REMOTE_SFENCE_VMA_ASID, |
| 54 | SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA, | ||
| 55 | SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA_VMID, | 54 | SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA_VMID, |
| 56 | SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA, | 55 | SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA, |
| 57 | SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA_ASID, | 56 | SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA_ASID, |
| 57 | SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA, | ||
| 58 | }; | 58 | }; |
| 59 | 59 | ||
| 60 | enum sbi_ext_hsm_fid { | 60 | enum sbi_ext_hsm_fid { |
| @@ -88,4 +88,6 @@ static inline int read_current_timer(unsigned long *timer_val) · 87 unmodified lines | |||
| 88 | return 0; | 88 | return 0; |
| 89 | } | 89 | } |
| 90 | 90 | ||
| 91 | extern void time_init(void); | ||
| 92 | |||
| 91 | #endif /* _ASM_RISCV_TIMEX_H */ | 93 | #endif /* _ASM_RISCV_TIMEX_H */ |
| @@ -306,7 +306,9 @@ do { \ · 305 unmodified lines | |||
| 306 | * data types like structures or arrays. | 306 | * data types like structures or arrays. |
| 307 | * | 307 | * |
| 308 | * @ptr must have pointer-to-simple-variable type, and @x must be assignable | 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 | * Caller must check the pointer with access_ok() before calling this | 313 | * Caller must check the pointer with access_ok() before calling this |
| 312 | * function. | 314 | * function. |
| @@ -316,12 +318,13 @@ do { \ · 3 unmodified lines | |||
| 316 | #define __put_user(x, ptr) \ | 318 | #define __put_user(x, ptr) \ |
| 317 | ({ \ | 319 | ({ \ |
| 318 | __typeof__(*(ptr)) __user *__gu_ptr = (ptr); \ | 320 | __typeof__(*(ptr)) __user *__gu_ptr = (ptr); \ |
| 321 | __typeof__(*__gu_ptr) __val = (x); \ | ||
| 319 | long __pu_err = 0; \ | 322 | long __pu_err = 0; \ |
| 320 | \ | 323 | \ |
| 321 | __chk_user_ptr(__gu_ptr); \ | 324 | __chk_user_ptr(__gu_ptr); \ |
| 322 | \ | 325 | \ |
| 323 | __enable_user_access(); \ | 326 | __enable_user_access(); \ |
| 324 | __put_user_nocheck(x, __gu_ptr, __pu_err); \ | 327 | __put_user_nocheck(__val, __gu_ptr, __pu_err); \ |
| 325 | __disable_user_access(); \ | 328 | __disable_user_access(); \ |
| 326 | \ | 329 | \ |
| 327 | __pu_err; \ | 330 | __pu_err; \ |
| @@ -8,6 +8,7 @@ CFLAGS_REMOVE_ftrace.o = $(CC_FLAGS_FTRACE) · 7 unmodified lines | |||
| 8 | CFLAGS_REMOVE_patch.o = $(CC_FLAGS_FTRACE) | 8 | CFLAGS_REMOVE_patch.o = $(CC_FLAGS_FTRACE) |
| 9 | CFLAGS_REMOVE_sbi.o = $(CC_FLAGS_FTRACE) | 9 | CFLAGS_REMOVE_sbi.o = $(CC_FLAGS_FTRACE) |
| 10 | endif | 10 | endif |
| 11 | CFLAGS_syscall_table.o += $(call cc-option,-Wno-override-init,) | ||
| 11 | 12 | ||
| 12 | extra-y += head.o | 13 | extra-y += head.o |
| 13 | extra-y += vmlinux.lds | 14 | extra-y += vmlinux.lds |
| @@ -130,6 +130,9 @@ skip_context_tracking: · 129 unmodified lines | |||
| 130 | */ | 130 | */ |
| 131 | andi t0, s1, SR_PIE | 131 | andi t0, s1, SR_PIE |
| 132 | beqz t0, 1f | 132 | beqz t0, 1f |
| 133 | /* kprobes, entered via ebreak, must have interrupts disabled. */ | ||
| 134 | li t0, EXC_BREAKPOINT | ||
| 135 | beq s4, t0, 1f | ||
| 133 | #ifdef CONFIG_TRACE_IRQFLAGS | 136 | #ifdef CONFIG_TRACE_IRQFLAGS |
| 134 | call trace_hardirqs_on | 137 | call trace_hardirqs_on |
| 135 | #endif | 138 | #endif |
| @@ -447,6 +450,7 @@ ENDPROC(__switch_to) · 311 unmodified lines | |||
| 447 | #endif | 450 | #endif |
| 448 | 451 | ||
| 449 | .section ".rodata" | 452 | .section ".rodata" |
| 453 | .align LGREG | ||
| 450 | /* Exception vector table */ | 454 | /* Exception vector table */ |
| 451 | ENTRY(excp_vect_table) | 455 | ENTRY(excp_vect_table) |
| 452 | RISCV_PTR do_trap_insn_misaligned | 456 | RISCV_PTR do_trap_insn_misaligned |
| @@ -2,39 +2,47 @@ · 1 unmodified line | |||
| 2 | 2 | ||
| 3 | #include <linux/kprobes.h> | 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 | void kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip, | 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 | struct kprobe *p; | 9 | struct kprobe *p; |
| 10 | struct pt_regs *regs; | ||
| 10 | struct kprobe_ctlblk *kcb; | 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 | p = get_kprobe((kprobe_opcode_t *)ip); | 19 | p = get_kprobe((kprobe_opcode_t *)ip); |
| 13 | if (unlikely(!p) || kprobe_disabled(p)) | 20 | if (unlikely(!p) || kprobe_disabled(p)) |
| 14 | return; | 21 | goto out; |
| 15 | 22 | ||
| 23 | regs = ftrace_get_regs(fregs); | ||
| 16 | kcb = get_kprobe_ctlblk(); | 24 | kcb = get_kprobe_ctlblk(); |
| 17 | if (kprobe_running()) { | 25 | if (kprobe_running()) { |
| 18 | kprobes_inc_nmissed_count(p); | 26 | kprobes_inc_nmissed_count(p); |
| 19 | } else { | 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 | __this_cpu_write(current_kprobe, p); | 32 | __this_cpu_write(current_kprobe, p); |
| 25 | kcb->kprobe_status = KPROBE_HIT_ACTIVE; | 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 | * Emulate singlestep (and also recover regs->pc) | 36 | * Emulate singlestep (and also recover regs->pc) |
| 29 | * as if there is a nop | 37 | * as if there is a nop |
| 30 | */ | 38 | */ |
| 31 | instruction_pointer_set(&(regs->regs), | 39 | instruction_pointer_set(regs, |
| 32 | (unsigned long)p->addr + MCOUNT_INSN_SIZE); | 40 | (unsigned long)p->addr + MCOUNT_INSN_SIZE); |
| 33 | if (unlikely(p->post_handler)) { | 41 | if (unlikely(p->post_handler)) { |
| 34 | kcb->kprobe_status = KPROBE_HIT_SSDONE; | 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 | __this_cpu_write(current_kprobe, NULL); | 52 | __this_cpu_write(current_kprobe, NULL); |
| 45 | } | 53 | } |
| 54 | out: | ||
| 55 | preempt_enable_notrace(); | ||
| 56 | ftrace_test_recursion_unlock(bit); | ||
| 46 | } | 57 | } |
| 47 | NOKPROBE_SYMBOL(kprobe_ftrace_handler); | 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 | * normal page fault. | 256 | * normal page fault. |
| 257 | */ | 257 | */ |
| 258 | regs->epc = (unsigned long) cur->addr; | 258 | regs->epc = (unsigned long) cur->addr; |
| 259 | if (!instruction_pointer(regs)) | 259 | BUG_ON(!instruction_pointer(regs)); |
| 260 | BUG(); | ||
| 261 | 260 | ||
| 262 | if (kcb->kprobe_status == KPROBE_REENTER) | 261 | if (kcb->kprobe_status == KPROBE_REENTER) |
| 263 | restore_previous_kprobe(kcb); | 262 | restore_previous_kprobe(kcb); |
| @@ -10,6 +10,7 @@ · 9 unmodified lines | |||
| 10 | #include <linux/cpu.h> | 10 | #include <linux/cpu.h> |
| 11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
| 12 | #include <linux/sched.h> | 12 | #include <linux/sched.h> |
| 13 | #include <linux/sched/debug.h> | ||
| 13 | #include <linux/sched/task_stack.h> | 14 | #include <linux/sched/task_stack.h> |
| 14 | #include <linux/tick.h> | 15 | #include <linux/tick.h> |
| 15 | #include <linux/ptrace.h> | 16 | #include <linux/ptrace.h> |
| @@ -116,7 +116,7 @@ void sbi_clear_ipi(void) · 115 unmodified lines | |||
| 116 | EXPORT_SYMBOL(sbi_clear_ipi); | 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 | * @stime_value: The value after which next timer event should fire. | 120 | * @stime_value: The value after which next timer event should fire. |
| 121 | * | 121 | * |
| 122 | * Return: None | 122 | * Return: None |
| @@ -147,7 +147,8 @@ static void __init init_resources(void) · 146 unmodified lines | |||
| 147 | bss_res.end = __pa_symbol(__bss_stop) - 1; | 147 | bss_res.end = __pa_symbol(__bss_stop) - 1; |
| 148 | bss_res.flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY; | 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 | mem_res = memblock_alloc(mem_res_sz, SMP_CACHE_BYTES); | 152 | mem_res = memblock_alloc(mem_res_sz, SMP_CACHE_BYTES); |
| 152 | if (!mem_res) | 153 | if (!mem_res) |
| 153 | panic("%s: Failed to allocate %zu bytes\n", __func__, mem_res_sz); | 154 | panic("%s: Failed to allocate %zu bytes\n", __func__, mem_res_sz); |
| @@ -14,7 +14,7 @@ · 13 unmodified lines | |||
| 14 | 14 | ||
| 15 | #include <asm/stacktrace.h> | 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 | #ifdef CONFIG_FRAME_POINTER | 19 | #ifdef CONFIG_FRAME_POINTER |
| 20 | 20 | ||
| @@ -9,6 +9,7 @@ · 8 unmodified lines | |||
| 9 | #include <linux/delay.h> | 9 | #include <linux/delay.h> |
| 10 | #include <asm/sbi.h> | 10 | #include <asm/sbi.h> |
| 11 | #include <asm/processor.h> | 11 | #include <asm/processor.h> |
| 12 | #include <asm/timex.h> | ||
| 12 | 13 | ||
| 13 | unsigned long riscv_timebase; | 14 | unsigned long riscv_timebase; |
| 14 | EXPORT_SYMBOL_GPL(riscv_timebase); | 15 | EXPORT_SYMBOL_GPL(riscv_timebase); |
| @@ -17,6 +17,7 @@ · 16 unmodified lines | |||
| 17 | #include <linux/module.h> | 17 | #include <linux/module.h> |
| 18 | #include <linux/irq.h> | 18 | #include <linux/irq.h> |
| 19 | 19 | ||
| 20 | #include <asm/asm-prototypes.h> | ||
| 20 | #include <asm/bug.h> | 21 | #include <asm/bug.h> |
| 21 | #include <asm/processor.h> | 22 | #include <asm/processor.h> |
| 22 | #include <asm/ptrace.h> | 23 | #include <asm/ptrace.h> |
| @@ -177,6 +178,7 @@ asmlinkage __visible void do_trap_break(struct pt_regs *regs) · 154 unmodified lines | |||
| 177 | else | 178 | else |
| 178 | die(regs, "Kernel BUG"); | 179 | die(regs, "Kernel BUG"); |
| 179 | } | 180 | } |
| 181 | NOKPROBE_SYMBOL(do_trap_break); | ||
| 180 | 182 | ||
| 181 | #ifdef CONFIG_GENERIC_BUG | 183 | #ifdef CONFIG_GENERIC_BUG |
| 182 | int is_valid_bugaddr(unsigned long pc) | 184 | int is_valid_bugaddr(unsigned long pc) |
| @@ -328,3 +328,4 @@ good_area: · 327 unmodified lines | |||
| 328 | } | 328 | } |
| 329 | return; | 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 | memset(start, KASAN_SHADOW_INIT, end - start); | 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 | unsigned long vaddr = (unsigned long)start & PAGE_MASK; | 160 | unsigned long vaddr = (unsigned long)start & PAGE_MASK; |
| 161 | unsigned long vend = PAGE_ALIGN((unsigned long)end); | 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 | vaddr += PAGE_SIZE; | 188 | vaddr += PAGE_SIZE; |
| 189 | } | 189 | } |
| 190 | |||
| 191 | local_flush_tlb_all(); | ||
| 190 | } | 192 | } |
| 191 | 193 | ||
| 192 | void __init kasan_init(void) | 194 | void __init kasan_init(void) |
| @@ -214,7 +216,7 @@ void __init kasan_init(void) · 21 unmodified lines | |||
| 214 | break; | 216 | break; |
| 215 | 217 | ||
| 216 | kasan_populate(kasan_mem_to_shadow(start), kasan_mem_to_shadow(end)); | 218 | kasan_populate(kasan_mem_to_shadow(start), kasan_mem_to_shadow(end)); |
| 217 | }; | 219 | } |
| 218 | 220 | ||
| 219 | for (i = 0; i < PTRS_PER_PTE; i++) | 221 | for (i = 0; i < PTRS_PER_PTE; i++) |
| 220 | set_pte(&kasan_early_shadow_pte[i], | 222 | set_pte(&kasan_early_shadow_pte[i], |
| @@ -275,9 +275,9 @@ CONFIG_IP_VS_DH=m · 274 unmodified lines | |||
| 275 | CONFIG_IP_VS_SH=m | 275 | CONFIG_IP_VS_SH=m |
| 276 | CONFIG_IP_VS_SED=m | 276 | CONFIG_IP_VS_SED=m |
| 277 | CONFIG_IP_VS_NQ=m | 277 | CONFIG_IP_VS_NQ=m |
| 278 | CONFIG_IP_VS_TWOS=m | ||
| 278 | CONFIG_IP_VS_FTP=m | 279 | CONFIG_IP_VS_FTP=m |
| 279 | CONFIG_IP_VS_PE_SIP=m | 280 | CONFIG_IP_VS_PE_SIP=m |
| 280 | CONFIG_NF_TABLES_IPV4=y | ||
| 281 | CONFIG_NFT_FIB_IPV4=m | 281 | CONFIG_NFT_FIB_IPV4=m |
| 282 | CONFIG_NF_TABLES_ARP=y | 282 | CONFIG_NF_TABLES_ARP=y |
| 283 | CONFIG_IP_NF_IPTABLES=m | 283 | CONFIG_IP_NF_IPTABLES=m |
| @@ -298,7 +298,6 @@ CONFIG_IP_NF_SECURITY=m · 14 unmodified lines | |||
| 298 | CONFIG_IP_NF_ARPTABLES=m | 298 | CONFIG_IP_NF_ARPTABLES=m |
| 299 | CONFIG_IP_NF_ARPFILTER=m | 299 | CONFIG_IP_NF_ARPFILTER=m |
| 300 | CONFIG_IP_NF_ARP_MANGLE=m | 300 | CONFIG_IP_NF_ARP_MANGLE=m |
| 301 | CONFIG_NF_TABLES_IPV6=y | ||
| 302 | CONFIG_NFT_FIB_IPV6=m | 301 | CONFIG_NFT_FIB_IPV6=m |
| 303 | CONFIG_IP6_NF_IPTABLES=m | 302 | CONFIG_IP6_NF_IPTABLES=m |
| 304 | CONFIG_IP6_NF_MATCH_AH=m | 303 | CONFIG_IP6_NF_MATCH_AH=m |
| @@ -481,7 +480,6 @@ CONFIG_NLMON=m · 176 unmodified lines | |||
| 481 | # CONFIG_NET_VENDOR_AQUANTIA is not set | 480 | # CONFIG_NET_VENDOR_AQUANTIA is not set |
| 482 | # CONFIG_NET_VENDOR_ARC is not set | 481 | # CONFIG_NET_VENDOR_ARC is not set |
| 483 | # CONFIG_NET_VENDOR_ATHEROS is not set | 482 | # CONFIG_NET_VENDOR_ATHEROS is not set |
| 484 | # CONFIG_NET_VENDOR_AURORA is not set | ||
| 485 | # CONFIG_NET_VENDOR_BROADCOM is not set | 483 | # CONFIG_NET_VENDOR_BROADCOM is not set |
| 486 | # CONFIG_NET_VENDOR_BROCADE is not set | 484 | # CONFIG_NET_VENDOR_BROCADE is not set |
| 487 | # CONFIG_NET_VENDOR_CADENCE is not set | 485 | # CONFIG_NET_VENDOR_CADENCE is not set |
| @@ -581,7 +579,6 @@ CONFIG_VIRTIO_BALLOON=m · 93 unmodified lines | |||
| 581 | CONFIG_VIRTIO_INPUT=y | 579 | CONFIG_VIRTIO_INPUT=y |
| 582 | CONFIG_VHOST_NET=m | 580 | CONFIG_VHOST_NET=m |
| 583 | CONFIG_VHOST_VSOCK=m | 581 | CONFIG_VHOST_VSOCK=m |
| 584 | # CONFIG_SURFACE_PLATFORMS is not set | ||
| 585 | CONFIG_S390_CCW_IOMMU=y | 582 | CONFIG_S390_CCW_IOMMU=y |
| 586 | CONFIG_S390_AP_IOMMU=y | 583 | CONFIG_S390_AP_IOMMU=y |
| 587 | CONFIG_EXT4_FS=y | 584 | CONFIG_EXT4_FS=y |
| @@ -635,6 +632,7 @@ CONFIG_NTFS_RW=y · 47 unmodified lines | |||
| 635 | CONFIG_PROC_KCORE=y | 632 | CONFIG_PROC_KCORE=y |
| 636 | CONFIG_TMPFS=y | 633 | CONFIG_TMPFS=y |
| 637 | CONFIG_TMPFS_POSIX_ACL=y | 634 | CONFIG_TMPFS_POSIX_ACL=y |
| 635 | CONFIG_TMPFS_INODE64=y | ||
| 638 | CONFIG_HUGETLBFS=y | 636 | CONFIG_HUGETLBFS=y |
| 639 | CONFIG_CONFIGFS_FS=m | 637 | CONFIG_CONFIGFS_FS=m |
| 640 | CONFIG_ECRYPT_FS=m | 638 | CONFIG_ECRYPT_FS=m |
| @@ -714,12 +712,8 @@ CONFIG_CRYPTO_VMAC=m · 73 unmodified lines | |||
| 714 | CONFIG_CRYPTO_CRC32=m | 712 | CONFIG_CRYPTO_CRC32=m |
| 715 | CONFIG_CRYPTO_BLAKE2S=m | 713 | CONFIG_CRYPTO_BLAKE2S=m |
| 716 | CONFIG_CRYPTO_MICHAEL_MIC=m | 714 | CONFIG_CRYPTO_MICHAEL_MIC=m |
| 717 | CONFIG_CRYPTO_RMD128=m | ||
| 718 | CONFIG_CRYPTO_RMD160=m | 715 | CONFIG_CRYPTO_RMD160=m |
| 719 | CONFIG_CRYPTO_RMD256=m | ||
| 720 | CONFIG_CRYPTO_RMD320=m | ||
| 721 | CONFIG_CRYPTO_SHA3=m | 716 | CONFIG_CRYPTO_SHA3=m |
| 722 | CONFIG_CRYPTO_TGR192=m | ||
| 723 | CONFIG_CRYPTO_WP512=m | 717 | CONFIG_CRYPTO_WP512=m |
| 724 | CONFIG_CRYPTO_AES_TI=m | 718 | CONFIG_CRYPTO_AES_TI=m |
| 725 | CONFIG_CRYPTO_ANUBIS=m | 719 | CONFIG_CRYPTO_ANUBIS=m |
| @@ -731,7 +725,6 @@ CONFIG_CRYPTO_CAST6=m · 5 unmodified lines | |||
| 731 | CONFIG_CRYPTO_DES=m | 725 | CONFIG_CRYPTO_DES=m |
| 732 | CONFIG_CRYPTO_FCRYPT=m | 726 | CONFIG_CRYPTO_FCRYPT=m |
| 733 | CONFIG_CRYPTO_KHAZAD=m | 727 | CONFIG_CRYPTO_KHAZAD=m |
| 734 | CONFIG_CRYPTO_SALSA20=m | ||
| 735 | CONFIG_CRYPTO_SEED=m | 728 | CONFIG_CRYPTO_SEED=m |
| 736 | CONFIG_CRYPTO_SERPENT=m | 729 | CONFIG_CRYPTO_SERPENT=m |
| 737 | CONFIG_CRYPTO_SM4=m | 730 | CONFIG_CRYPTO_SM4=m |
| @@ -796,12 +789,9 @@ CONFIG_DEBUG_OBJECTS_RCU_HEAD=y · 58 unmodified lines | |||
| 796 | CONFIG_DEBUG_OBJECTS_PERCPU_COUNTER=y | 789 | CONFIG_DEBUG_OBJECTS_PERCPU_COUNTER=y |
| 797 | CONFIG_SLUB_DEBUG_ON=y | 790 | CONFIG_SLUB_DEBUG_ON=y |
| 798 | CONFIG_SLUB_STATS=y | 791 | CONFIG_SLUB_STATS=y |
| 799 | CONFIG_DEBUG_KMEMLEAK=y | ||
| 800 | CONFIG_DEBUG_KMEMLEAK_DEFAULT_OFF=y | ||
| 801 | CONFIG_DEBUG_STACK_USAGE=y | 792 | CONFIG_DEBUG_STACK_USAGE=y |
| 802 | CONFIG_DEBUG_VM=y | 793 | CONFIG_DEBUG_VM=y |
| 803 | CONFIG_DEBUG_VM_VMACACHE=y | 794 | CONFIG_DEBUG_VM_VMACACHE=y |
| 804 | CONFIG_DEBUG_VM_RB=y | ||
| 805 | CONFIG_DEBUG_VM_PGFLAGS=y | 795 | CONFIG_DEBUG_VM_PGFLAGS=y |
| 806 | CONFIG_DEBUG_MEMORY_INIT=y | 796 | CONFIG_DEBUG_MEMORY_INIT=y |
| 807 | CONFIG_MEMORY_NOTIFIER_ERROR_INJECT=m | 797 | CONFIG_MEMORY_NOTIFIER_ERROR_INJECT=m |
| @@ -838,6 +828,7 @@ CONFIG_BPF_KPROBE_OVERRIDE=y · 30 unmodified lines | |||
| 838 | CONFIG_HIST_TRIGGERS=y | 828 | CONFIG_HIST_TRIGGERS=y |
| 839 | CONFIG_FTRACE_STARTUP_TEST=y | 829 | CONFIG_FTRACE_STARTUP_TEST=y |
| 840 | # CONFIG_EVENT_TRACE_STARTUP_TEST is not set | 830 | # CONFIG_EVENT_TRACE_STARTUP_TEST is not set |
| 831 | CONFIG_DEBUG_ENTRY=y | ||
| 841 | CONFIG_NOTIFIER_ERROR_INJECTION=m | 832 | CONFIG_NOTIFIER_ERROR_INJECTION=m |
| 842 | CONFIG_NETDEV_NOTIFIER_ERROR_INJECT=m | 833 | CONFIG_NETDEV_NOTIFIER_ERROR_INJECT=m |
| 843 | CONFIG_FAULT_INJECTION=y | 834 | CONFIG_FAULT_INJECTION=y |
| @@ -861,4 +852,3 @@ CONFIG_PERCPU_TEST=m · 17 unmodified lines | |||
| 861 | CONFIG_ATOMIC64_SELFTEST=y | 852 | CONFIG_ATOMIC64_SELFTEST=y |
| 862 | CONFIG_TEST_BITOPS=m | 853 | CONFIG_TEST_BITOPS=m |
| 863 | CONFIG_TEST_BPF=m | 854 | CONFIG_TEST_BPF=m |
| 864 | CONFIG_DEBUG_ENTRY=y | ||
| @@ -266,9 +266,9 @@ CONFIG_IP_VS_DH=m · 265 unmodified lines | |||
| 266 | CONFIG_IP_VS_SH=m | 266 | CONFIG_IP_VS_SH=m |
| 267 | CONFIG_IP_VS_SED=m | 267 | CONFIG_IP_VS_SED=m |
| 268 | CONFIG_IP_VS_NQ=m | 268 | CONFIG_IP_VS_NQ=m |
| 269 | CONFIG_IP_VS_TWOS=m | ||
| 269 | CONFIG_IP_VS_FTP=m | 270 | CONFIG_IP_VS_FTP=m |
| 270 | CONFIG_IP_VS_PE_SIP=m | 271 | CONFIG_IP_VS_PE_SIP=m |
| 271 | CONFIG_NF_TABLES_IPV4=y | ||
| 272 | CONFIG_NFT_FIB_IPV4=m | 272 | CONFIG_NFT_FIB_IPV4=m |
| 273 | CONFIG_NF_TABLES_ARP=y | 273 | CONFIG_NF_TABLES_ARP=y |
| 274 | CONFIG_IP_NF_IPTABLES=m | 274 | CONFIG_IP_NF_IPTABLES=m |
| @@ -289,7 +289,6 @@ CONFIG_IP_NF_SECURITY=m · 14 unmodified lines | |||
| 289 | CONFIG_IP_NF_ARPTABLES=m | 289 | CONFIG_IP_NF_ARPTABLES=m |
| 290 | CONFIG_IP_NF_ARPFILTER=m | 290 | CONFIG_IP_NF_ARPFILTER=m |
| 291 | CONFIG_IP_NF_ARP_MANGLE=m | 291 | CONFIG_IP_NF_ARP_MANGLE=m |
| 292 | CONFIG_NF_TABLES_IPV6=y | ||
| 293 | CONFIG_NFT_FIB_IPV6=m | 292 | CONFIG_NFT_FIB_IPV6=m |
| 294 | CONFIG_IP6_NF_IPTABLES=m | 293 | CONFIG_IP6_NF_IPTABLES=m |
| 295 | CONFIG_IP6_NF_MATCH_AH=m | 294 | CONFIG_IP6_NF_MATCH_AH=m |
| @@ -473,7 +472,6 @@ CONFIG_NLMON=m · 177 unmodified lines | |||
| 473 | # CONFIG_NET_VENDOR_AQUANTIA is not set | 472 | # CONFIG_NET_VENDOR_AQUANTIA is not set |
| 474 | # CONFIG_NET_VENDOR_ARC is not set | 473 | # CONFIG_NET_VENDOR_ARC is not set |
| 475 | # CONFIG_NET_VENDOR_ATHEROS is not set | 474 | # CONFIG_NET_VENDOR_ATHEROS is not set |
| 476 | # CONFIG_NET_VENDOR_AURORA is not set | ||
| 477 | # CONFIG_NET_VENDOR_BROADCOM is not set | 475 | # CONFIG_NET_VENDOR_BROADCOM is not set |
| 478 | # CONFIG_NET_VENDOR_BROCADE is not set | 476 | # CONFIG_NET_VENDOR_BROCADE is not set |
| 479 | # CONFIG_NET_VENDOR_CADENCE is not set | 477 | # CONFIG_NET_VENDOR_CADENCE is not set |
| @@ -573,7 +571,6 @@ CONFIG_VIRTIO_BALLOON=m · 93 unmodified lines | |||
| 573 | CONFIG_VIRTIO_INPUT=y | 571 | CONFIG_VIRTIO_INPUT=y |
| 574 | CONFIG_VHOST_NET=m | 572 | CONFIG_VHOST_NET=m |
| 575 | CONFIG_VHOST_VSOCK=m | 573 | CONFIG_VHOST_VSOCK=m |
| 576 | # CONFIG_SURFACE_PLATFORMS is not set | ||
| 577 | CONFIG_S390_CCW_IOMMU=y | 574 | CONFIG_S390_CCW_IOMMU=y |
| 578 | CONFIG_S390_AP_IOMMU=y | 575 | CONFIG_S390_AP_IOMMU=y |
| 579 | CONFIG_EXT4_FS=y | 576 | CONFIG_EXT4_FS=y |
| @@ -623,6 +620,7 @@ CONFIG_NTFS_RW=y · 43 unmodified lines | |||
| 623 | CONFIG_PROC_KCORE=y | 620 | CONFIG_PROC_KCORE=y |
| 624 | CONFIG_TMPFS=y | 621 | CONFIG_TMPFS=y |
| 625 | CONFIG_TMPFS_POSIX_ACL=y | 622 | CONFIG_TMPFS_POSIX_ACL=y |
| 623 | CONFIG_TMPFS_INODE64=y | ||
| 626 | CONFIG_HUGETLBFS=y | 624 | CONFIG_HUGETLBFS=y |
| 627 | CONFIG_CONFIGFS_FS=m | 625 | CONFIG_CONFIGFS_FS=m |
| 628 | CONFIG_ECRYPT_FS=m | 626 | CONFIG_ECRYPT_FS=m |
| @@ -703,12 +701,8 @@ CONFIG_CRYPTO_VMAC=m · 74 unmodified lines | |||
| 703 | CONFIG_CRYPTO_CRC32=m | 701 | CONFIG_CRYPTO_CRC32=m |
| 704 | CONFIG_CRYPTO_BLAKE2S=m | 702 | CONFIG_CRYPTO_BLAKE2S=m |
| 705 | CONFIG_CRYPTO_MICHAEL_MIC=m | 703 | CONFIG_CRYPTO_MICHAEL_MIC=m |
| 706 | CONFIG_CRYPTO_RMD128=m | ||
| 707 | CONFIG_CRYPTO_RMD160=m | 704 | CONFIG_CRYPTO_RMD160=m |
| 708 | CONFIG_CRYPTO_RMD256=m | ||
| 709 | CONFIG_CRYPTO_RMD320=m | ||
| 710 | CONFIG_CRYPTO_SHA3=m | 705 | CONFIG_CRYPTO_SHA3=m |
| 711 | CONFIG_CRYPTO_TGR192=m | ||
| 712 | CONFIG_CRYPTO_WP512=m | 706 | CONFIG_CRYPTO_WP512=m |
| 713 | CONFIG_CRYPTO_AES_TI=m | 707 | CONFIG_CRYPTO_AES_TI=m |
| 714 | CONFIG_CRYPTO_ANUBIS=m | 708 | CONFIG_CRYPTO_ANUBIS=m |
| @@ -720,7 +714,6 @@ CONFIG_CRYPTO_CAST6=m · 5 unmodified lines | |||
| 720 | CONFIG_CRYPTO_DES=m | 714 | CONFIG_CRYPTO_DES=m |
| 721 | CONFIG_CRYPTO_FCRYPT=m | 715 | CONFIG_CRYPTO_FCRYPT=m |
| 722 | CONFIG_CRYPTO_KHAZAD=m | 716 | CONFIG_CRYPTO_KHAZAD=m |
| 723 | CONFIG_CRYPTO_SALSA20=m | ||
| 724 | CONFIG_CRYPTO_SEED=m | 717 | CONFIG_CRYPTO_SEED=m |
| 725 | CONFIG_CRYPTO_SERPENT=m | 718 | CONFIG_CRYPTO_SERPENT=m |
| 726 | CONFIG_CRYPTO_SM4=m | 719 | CONFIG_CRYPTO_SM4=m |
| @@ -26,7 +26,6 @@ CONFIG_CRASH_DUMP=y · 25 unmodified lines | |||
| 26 | # CONFIG_SECCOMP is not set | 26 | # CONFIG_SECCOMP is not set |
| 27 | # CONFIG_GCC_PLUGINS is not set | 27 | # CONFIG_GCC_PLUGINS is not set |
| 28 | CONFIG_PARTITION_ADVANCED=y | 28 | CONFIG_PARTITION_ADVANCED=y |
| 29 | CONFIG_IBM_PARTITION=y | ||
| 30 | # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set | 29 | # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set |
| 31 | # CONFIG_COMPACTION is not set | 30 | # CONFIG_COMPACTION is not set |
| 32 | # CONFIG_MIGRATION is not set | 31 | # CONFIG_MIGRATION is not set |
| @@ -61,11 +60,9 @@ CONFIG_RAW_DRIVER=y · 28 unmodified lines | |||
| 61 | # CONFIG_HID is not set | 60 | # CONFIG_HID is not set |
| 62 | # CONFIG_VIRTIO_MENU is not set | 61 | # CONFIG_VIRTIO_MENU is not set |
| 63 | # CONFIG_VHOST_MENU is not set | 62 | # CONFIG_VHOST_MENU is not set |
| 64 | # CONFIG_SURFACE_PLATFORMS is not set | ||
| 65 | # CONFIG_IOMMU_SUPPORT is not set | 63 | # CONFIG_IOMMU_SUPPORT is not set |
| 66 | # CONFIG_DNOTIFY is not set | 64 | # CONFIG_DNOTIFY is not set |
| 67 | # CONFIG_INOTIFY_USER is not set | 65 | # CONFIG_INOTIFY_USER is not set |
| 68 | CONFIG_CONFIGFS_FS=y | ||
| 69 | # CONFIG_MISC_FILESYSTEMS is not set | 66 | # CONFIG_MISC_FILESYSTEMS is not set |
| 70 | # CONFIG_NETWORK_FILESYSTEMS is not set | 67 | # CONFIG_NETWORK_FILESYSTEMS is not set |
| 71 | CONFIG_LSM="yama,loadpin,safesetid,integrity" | 68 | CONFIG_LSM="yama,loadpin,safesetid,integrity" |
| @@ -14,12 +14,12 @@ · 13 unmodified lines | |||
| 14 | 14 | ||
| 15 | struct s390_idle_data { | 15 | struct s390_idle_data { |
| 16 | seqcount_t seqcount; | 16 | seqcount_t seqcount; |
| 17 | unsigned long long idle_count; | 17 | unsigned long idle_count; |
| 18 | unsigned long long idle_time; | 18 | unsigned long idle_time; |
| 19 | unsigned long long clock_idle_enter; | 19 | unsigned long clock_idle_enter; |
| 20 | unsigned long long clock_idle_exit; | 20 | unsigned long clock_idle_exit; |
| 21 | unsigned long long timer_idle_enter; | 21 | unsigned long timer_idle_enter; |
| 22 | unsigned long long timer_idle_exit; | 22 | unsigned long timer_idle_exit; |
| 23 | unsigned long mt_cycles_enter[8]; | 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 | /* Base stuff */ | 203 | /* Base stuff */ |
| 204 | int zpci_create_device(u32 fid, u32 fh, enum zpci_state state); | 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 | int zpci_enable_device(struct zpci_dev *); | 206 | int zpci_enable_device(struct zpci_dev *); |
| 207 | int zpci_disable_device(struct zpci_dev *); | 207 | int zpci_disable_device(struct zpci_dev *); |
| 208 | int zpci_register_ioat(struct zpci_dev *, u8, u64, u64, u64); | 208 | int zpci_register_ioat(struct zpci_dev *, u8, u64, u64, u64); |
| @@ -12,6 +12,7 @@ enum stack_type { · 11 unmodified lines | |||
| 12 | STACK_TYPE_IRQ, | 12 | STACK_TYPE_IRQ, |
| 13 | STACK_TYPE_NODAT, | 13 | STACK_TYPE_NODAT, |
| 14 | STACK_TYPE_RESTART, | 14 | STACK_TYPE_RESTART, |
| 15 | STACK_TYPE_MCCK, | ||
| 15 | }; | 16 | }; |
| 16 | 17 | ||
| 17 | struct stack_info { | 18 | struct stack_info { |
| @@ -98,10 +98,10 @@ extern unsigned char ptff_function_mask[16]; · 97 unmodified lines | |||
| 98 | 98 | ||
| 99 | /* Query TOD offset result */ | 99 | /* Query TOD offset result */ |
| 100 | struct ptff_qto { | 100 | struct ptff_qto { |
| 101 | unsigned long long physical_clock; | 101 | unsigned long physical_clock; |
| 102 | unsigned long long tod_offset; | 102 | unsigned long tod_offset; |
| 103 | unsigned long long logical_tod_offset; | 103 | unsigned long logical_tod_offset; |
| 104 | unsigned long long tod_epoch_difference; | 104 | unsigned long tod_epoch_difference; |
| 105 | } __packed; | 105 | } __packed; |
| 106 | 106 | ||
| 107 | static inline int ptff_query(unsigned int nr) | 107 | static inline int ptff_query(unsigned int nr) |
| @@ -151,9 +151,9 @@ struct ptff_qui { · 43 unmodified lines | |||
| 151 | rc; \ | 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 | old = S390_lowcore.clock_comparator; | 158 | old = S390_lowcore.clock_comparator; |
| 159 | S390_lowcore.clock_comparator = clock_comparator_max; | 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 | return old; | 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 | S390_lowcore.clock_comparator = comp; | 166 | S390_lowcore.clock_comparator = comp; |
| 167 | set_clock_comparator(S390_lowcore.clock_comparator); | 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 | #define CLOCK_TICK_RATE 1193180 /* Underlying HZ */ | 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 | union tod_clock clk; | 176 | union tod_clock clk; |
| 177 | 177 | ||
| @@ -179,10 +179,10 @@ static inline unsigned long long get_tod_clock(void) · 1 unmodified line | |||
| 179 | return clk.tod; | 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 | #ifdef CONFIG_HAVE_MARCH_Z9_109_FEATURES | 184 | #ifdef CONFIG_HAVE_MARCH_Z9_109_FEATURES |
| 185 | unsigned long long clk; | 185 | unsigned long clk; |
| 186 | 186 | ||
| 187 | asm volatile("stckf %0" : "=Q" (clk) : : "cc"); | 187 | asm volatile("stckf %0" : "=Q" (clk) : : "cc"); |
| 188 | return clk; | 188 | return clk; |
| @@ -208,9 +208,9 @@ extern union tod_clock tod_clock_base; · 19 unmodified lines | |||
| 208 | * Therefore preemption must be disabled, otherwise the returned | 208 | * Therefore preemption must be disabled, otherwise the returned |
| 209 | * value is not guaranteed to be monotonic. | 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 | preempt_disable_notrace(); | 215 | preempt_disable_notrace(); |
| 216 | tod = get_tod_clock() - tod_clock_base.tod; | 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 | * -> ns = (th * 125) + ((tl * 125) >> 9); | 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 | return ((todval >> 9) * 125) + (((todval & 0x1ff) * 125) >> 9); | 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 | * Returns: true if a is later than b | 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 | if (MACHINE_HAS_SCC) | 254 | if (MACHINE_HAS_SCC) |
| 255 | return (long long) a > (long long) b; | 255 | return (long) a > (long) b; |
| 256 | return a > b; | 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 | * Returns: true if a is later than b | 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 | if (MACHINE_HAS_SCC) | 268 | if (MACHINE_HAS_SCC) |
| 269 | return (long long) a >= (long long) b; | 269 | return (long) a >= (long) b; |
| 270 | return a >= b; | 270 | return a >= b; |
| 271 | } | 271 | } |
| 272 | 272 | ||
| @@ -6,7 +6,7 @@ · 5 unmodified lines | |||
| 6 | #include <vdso/datapage.h> | 6 | #include <vdso/datapage.h> |
| 7 | 7 | ||
| 8 | struct arch_vdso_data { | 8 | struct arch_vdso_data { |
| 9 | __u64 tod_steering_delta; | 9 | __s64 tod_steering_delta; |
| 10 | __u64 tod_steering_end; | 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 | static int diag8_response(int cmdlen, char *response, int *rlen) | 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 | register unsigned long reg2 asm ("2") = (addr_t) cpcmd_buf; | 42 | register unsigned long reg2 asm ("2") = (addr_t) cpcmd_buf; |
| 41 | register unsigned long reg3 asm ("3") = (addr_t) response; | 43 | register unsigned long reg3 asm ("3") = (addr_t) response; |
| 42 | register unsigned long reg4 asm ("4") = cmdlen | 0x40000000L; | 44 | register unsigned long reg4 asm ("4") = _cmdlen; |
| 43 | register unsigned long reg5 asm ("5") = *rlen; | 45 | register unsigned long reg5 asm ("5") = _rlen; |
| 44 | 46 | ||
| 45 | asm volatile( | 47 | asm volatile( |
| 46 | " diag %2,%0,0x8\n" | 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 | return in_stack(sp, info, STACK_TYPE_NODAT, top - THREAD_SIZE, top); | 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 | static bool in_restart_stack(unsigned long sp, struct stack_info *info) | 91 | static bool in_restart_stack(unsigned long sp, struct stack_info *info) |
| 83 | { | 92 | { |
| 84 | unsigned long frame_size, top; | 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 | /* Check per-cpu stacks */ | 117 | /* Check per-cpu stacks */ |
| 109 | if (!in_irq_stack(sp, info) && | 118 | if (!in_irq_stack(sp, info) && |
| 110 | !in_nodat_stack(sp, info) && | 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 | goto unknown; | 122 | goto unknown; |
| 113 | 123 | ||
| 114 | recursion_check: | 124 | recursion_check: |
| @@ -401,15 +401,13 @@ ENTRY(\name) · 400 unmodified lines | |||
| 401 | brasl %r14,.Lcleanup_sie_int | 401 | brasl %r14,.Lcleanup_sie_int |
| 402 | #endif | 402 | #endif |
| 403 | 0: CHECK_STACK __LC_SAVE_AREA_ASYNC | 403 | 0: CHECK_STACK __LC_SAVE_AREA_ASYNC |
| 404 | lgr %r11,%r15 | ||
| 405 | aghi %r15,-(STACK_FRAME_OVERHEAD + __PT_SIZE) | 404 | aghi %r15,-(STACK_FRAME_OVERHEAD + __PT_SIZE) |
| 406 | stg %r11,__SF_BACKCHAIN(%r15) | ||
| 407 | j 2f | 405 | j 2f |
| 408 | 1: BPENTER __TI_flags(%r12),_TIF_ISOLATE_BP | 406 | 1: BPENTER __TI_flags(%r12),_TIF_ISOLATE_BP |
| 409 | lctlg %c1,%c1,__LC_KERNEL_ASCE | 407 | lctlg %c1,%c1,__LC_KERNEL_ASCE |
| 410 | lg %r15,__LC_KERNEL_STACK | 408 | lg %r15,__LC_KERNEL_STACK |
| 411 | xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15) | 409 | 2: xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15) |
| 412 | 2: la %r11,STACK_FRAME_OVERHEAD(%r15) | 410 | la %r11,STACK_FRAME_OVERHEAD(%r15) |
| 413 | stmg %r0,%r7,__PT_R0(%r11) | 411 | stmg %r0,%r7,__PT_R0(%r11) |
| 414 | # clear user controlled registers to prevent speculative use | 412 | # clear user controlled registers to prevent speculative use |
| 415 | xgr %r0,%r0 | 413 | xgr %r0,%r0 |
| @@ -445,6 +443,7 @@ INT_HANDLER io_int_handler,__LC_IO_OLD_PSW,do_io_irq · 29 unmodified lines | |||
| 445 | * Load idle PSW. | 443 | * Load idle PSW. |
| 446 | */ | 444 | */ |
| 447 | ENTRY(psw_idle) | 445 | ENTRY(psw_idle) |
| 446 | stg %r14,(__SF_GPRS+8*8)(%r15) | ||
| 448 | stg %r3,__SF_EMPTY(%r15) | 447 | stg %r3,__SF_EMPTY(%r15) |
| 449 | larl %r1,psw_idle_exit | 448 | larl %r1,psw_idle_exit |
| 450 | stg %r1,__SF_EMPTY+8(%r15) | 449 | stg %r1,__SF_EMPTY+8(%r15) |
| @@ -47,7 +47,7 @@ void account_idle_time_irq(void) · 46 unmodified lines | |||
| 47 | void arch_cpu_idle(void) | 47 | void arch_cpu_idle(void) |
| 48 | { | 48 | { |
| 49 | struct s390_idle_data *idle = this_cpu_ptr(&s390_idle); | 49 | struct s390_idle_data *idle = this_cpu_ptr(&s390_idle); |
| 50 | unsigned long long idle_time; | 50 | unsigned long idle_time; |
| 51 | unsigned long psw_mask; | 51 | unsigned long psw_mask; |
| 52 | 52 | ||
| 53 | /* Wait for external, I/O or machine check interrupt. */ | 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 | struct device_attribute *attr, char *buf) | 73 | struct device_attribute *attr, char *buf) |
| 74 | { | 74 | { |
| 75 | struct s390_idle_data *idle = &per_cpu(s390_idle, dev->id); | 75 | struct s390_idle_data *idle = &per_cpu(s390_idle, dev->id); |
| 76 | unsigned long long idle_count; | 76 | unsigned long idle_count; |
| 77 | unsigned int seq; | 77 | unsigned int seq; |
| 78 | 78 | ||
| 79 | do { | 79 | do { |
| @@ -82,14 +82,14 @@ static ssize_t show_idle_count(struct device *dev, · 2 unmodified lines | |||
| 82 | if (READ_ONCE(idle->clock_idle_enter)) | 82 | if (READ_ONCE(idle->clock_idle_enter)) |
| 83 | idle_count++; | 83 | idle_count++; |
| 84 | } while (read_seqcount_retry(&idle->seqcount, seq)); | 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 | DEVICE_ATTR(idle_count, 0444, show_idle_count, NULL); | 87 | DEVICE_ATTR(idle_count, 0444, show_idle_count, NULL); |
| 88 | 88 | ||
| 89 | static ssize_t show_idle_time(struct device *dev, | 89 | static ssize_t show_idle_time(struct device *dev, |
| 90 | struct device_attribute *attr, char *buf) | 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 | struct s390_idle_data *idle = &per_cpu(s390_idle, dev->id); | 93 | struct s390_idle_data *idle = &per_cpu(s390_idle, dev->id); |
| 94 | unsigned int seq; | 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 | idle_time += in_idle; | 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 | DEVICE_ATTR(idle_time_us, 0444, show_idle_time, NULL); | 114 | DEVICE_ATTR(idle_time_us, 0444, show_idle_time, NULL); |
| 115 | 115 | ||
| 116 | u64 arch_cpu_idle_time(int cpu) | 116 | u64 arch_cpu_idle_time(int cpu) |
| 117 | { | 117 | { |
| 118 | struct s390_idle_data *idle = &per_cpu(s390_idle, cpu); | 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 | unsigned int seq; | 120 | unsigned int seq; |
| 121 | 121 | ||
| 122 | do { | 122 | do { |
| @@ -174,7 +174,7 @@ void noinstr do_ext_irq(struct pt_regs *regs) · 173 unmodified lines | |||
| 174 | 174 | ||
| 175 | memcpy(®s->int_code, &S390_lowcore.ext_cpu_addr, 4); | 175 | memcpy(®s->int_code, &S390_lowcore.ext_cpu_addr, 4); |
| 176 | regs->int_parm = S390_lowcore.ext_params; | 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 | from_idle = !user_mode(regs) && regs->psw.addr == (unsigned long)psw_idle_exit; | 179 | from_idle = !user_mode(regs) && regs->psw.addr == (unsigned long)psw_idle_exit; |
| 180 | if (from_idle) | 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 | case CPUMF_CTR_SET_MAX: | 269 | case CPUMF_CTR_SET_MAX: |
| 270 | /* The counter could not be associated to a counter set */ | 270 | /* The counter could not be associated to a counter set */ |
| 271 | return -EINVAL; | 271 | return -EINVAL; |
| 272 | }; | 272 | } |
| 273 | 273 | ||
| 274 | /* Initialize for using the CPU-measurement counter facility */ | 274 | /* Initialize for using the CPU-measurement counter facility */ |
| 275 | if (!atomic_inc_not_zero(&num_events)) { | 275 | if (!atomic_inc_not_zero(&num_events)) { |
| @@ -26,12 +26,10 @@ · 25 unmodified lines | |||
| 26 | #include <asm/timex.h> | 26 | #include <asm/timex.h> |
| 27 | #include <asm/debug.h> | 27 | #include <asm/debug.h> |
| 28 | 28 | ||
| 29 | #include <asm/perf_cpum_cf_diag.h> | 29 | #include <asm/hwctrset.h> |
| 30 | 30 | ||
| 31 | #define CF_DIAG_CTRSET_DEF 0xfeef /* Counter set header mark */ | 31 | #define CF_DIAG_CTRSET_DEF 0xfeef /* Counter set header mark */ |
| 32 | #define CF_DIAG_MIN_INTERVAL 60 /* Minimum counter set read */ | ||
| 33 | /* interval in seconds */ | 32 | /* interval in seconds */ |
| 34 | static unsigned long cf_diag_interval = CF_DIAG_MIN_INTERVAL; | ||
| 35 | static unsigned int cf_diag_cpu_speed; | 33 | static unsigned int cf_diag_cpu_speed; |
| 36 | static debug_info_t *cf_diag_dbg; | 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 | static struct cf_diag_ctrset { | 727 | static struct cf_diag_ctrset { |
| 730 | unsigned long ctrset; /* Bit mask of counter set to read */ | 728 | unsigned long ctrset; /* Bit mask of counter set to read */ |
| 731 | cpumask_t mask; /* CPU mask to read from */ | 729 | cpumask_t mask; /* CPU mask to read from */ |
| 732 | time64_t lastread; /* Epoch counter set last read */ | ||
| 733 | } cf_diag_ctrset; | 730 | } cf_diag_ctrset; |
| 734 | 731 | ||
| 735 | static void cf_diag_ctrset_clear(void) | 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 | struct cf_diag_call_on_cpu_parm p; | 864 | struct cf_diag_call_on_cpu_parm p; |
| 868 | cpumask_var_t mask; | 865 | cpumask_var_t mask; |
| 869 | time64_t now; | 866 | int rc; |
| 870 | int rc = 0; | ||
| 871 | 867 | ||
| 872 | debug_sprintf_event(cf_diag_dbg, 5, "%s\n", __func__); | 868 | debug_sprintf_event(cf_diag_dbg, 5, "%s\n", __func__); |
| 873 | if (!alloc_cpumask_var(&mask, GFP_KERNEL)) | 869 | if (!alloc_cpumask_var(&mask, GFP_KERNEL)) |
| 874 | return -ENOMEM; | 870 | return -ENOMEM; |
| 875 | now = ktime_get_seconds(); | 871 | |
| 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 | } | ||
| 885 | p.sets = cf_diag_ctrset.ctrset; | 872 | p.sets = cf_diag_ctrset.ctrset; |
| 886 | cpumask_and(mask, &cf_diag_ctrset.mask, cpu_online_mask); | 873 | cpumask_and(mask, &cf_diag_ctrset.mask, cpu_online_mask); |
| 887 | on_each_cpu_mask(mask, cf_diag_cpu_read, &p, 1); | 874 | on_each_cpu_mask(mask, cf_diag_cpu_read, &p, 1); |
| 888 | rc = cf_diag_all_copy(arg, mask); | 875 | rc = cf_diag_all_copy(arg, mask); |
| 889 | out: | ||
| 890 | free_cpumask_var(mask); | 876 | free_cpumask_var(mask); |
| 891 | debug_sprintf_event(cf_diag_dbg, 5, "%s rc %d\n", __func__, rc); | 877 | debug_sprintf_event(cf_diag_dbg, 5, "%s rc %d\n", __func__, rc); |
| 892 | return rc; | 878 | return rc; |
| @@ -982,7 +968,7 @@ static int cf_diag_all_start(void) · 89 unmodified lines | |||
| 982 | */ | 968 | */ |
| 983 | static size_t cf_diag_needspace(unsigned int sets) | 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 | size_t bytes = 0; | 972 | size_t bytes = 0; |
| 987 | int i; | 973 | int i; |
| 988 | 974 | ||
| @@ -998,6 +984,7 @@ static size_t cf_diag_needspace(unsigned int sets) · 9 unmodified lines | |||
| 998 | sizeof(((struct s390_ctrset_cpudata *)0)->no_sets)); | 984 | sizeof(((struct s390_ctrset_cpudata *)0)->no_sets)); |
| 999 | debug_sprintf_event(cf_diag_dbg, 5, "%s bytes %ld\n", __func__, | 985 | debug_sprintf_event(cf_diag_dbg, 5, "%s bytes %ld\n", __func__, |
| 1000 | bytes); | 986 | bytes); |
| 987 | put_cpu_ptr(&cpu_cf_events); | ||
| 1001 | return bytes; | 988 | return bytes; |
| 1002 | } | 989 | } |
| 1003 | 990 | ||
| @@ -354,7 +354,7 @@ static int __init stack_realloc(void) · 353 unmodified lines | |||
| 354 | if (!new) | 354 | if (!new) |
| 355 | panic("Couldn't allocate machine check stack"); | 355 | panic("Couldn't allocate machine check stack"); |
| 356 | WRITE_ONCE(S390_lowcore.mcck_stack, new + STACK_INIT_OFFSET); | 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 | return 0; | 358 | return 0; |
| 359 | } | 359 | } |
| 360 | early_initcall(stack_realloc); | 360 | early_initcall(stack_realloc); |
| @@ -68,10 +68,10 @@ EXPORT_SYMBOL(s390_epoch_delta_notifier); · 67 unmodified lines | |||
| 68 | 68 | ||
| 69 | unsigned char ptff_function_mask[16]; | 69 | unsigned char ptff_function_mask[16]; |
| 70 | 70 | ||
| 71 | static unsigned long long lpar_offset; | 71 | static unsigned long lpar_offset; |
| 72 | static unsigned long long initial_leap_seconds; | 72 | static unsigned long initial_leap_seconds; |
| 73 | static unsigned long long tod_steering_end; | 73 | static unsigned long tod_steering_end; |
| 74 | static long long tod_steering_delta; | 74 | static long tod_steering_delta; |
| 75 | 75 | ||
| 76 | /* | 76 | /* |
| 77 | * Get time offsets with PTFF | 77 | * Get time offsets with PTFF |
| @@ -80,10 +80,12 @@ void __init time_early_init(void) · 2 unmodified lines | |||
| 80 | { | 80 | { |
| 81 | struct ptff_qto qto; | 81 | struct ptff_qto qto; |
| 82 | struct ptff_qui qui; | 82 | struct ptff_qui qui; |
| 83 | int cs; | ||
| 83 | 84 | ||
| 84 | /* Initialize TOD steering parameters */ | 85 | /* Initialize TOD steering parameters */ |
| 85 | tod_steering_end = tod_clock_base.tod; | 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 | if (!test_facility(28)) | 90 | if (!test_facility(28)) |
| 89 | return; | 91 | return; |
| @@ -96,7 +98,7 @@ void __init time_early_init(void) · 6 unmodified lines | |||
| 96 | 98 | ||
| 97 | /* get initial leap seconds */ | 99 | /* get initial leap seconds */ |
| 98 | if (ptff_query(PTFF_QUI) && ptff(&qui, sizeof(qui), PTFF_QUI) == 0) | 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 | ((long) qui.old_leap * 4096000000L); | 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 | static u64 read_tod_clock(struct clocksource *cs) | 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 | preempt_disable(); /* protect from changes to steering parameters */ | 229 | preempt_disable(); /* protect from changes to steering parameters */ |
| 228 | now = get_tod_clock(); | 230 | now = get_tod_clock(); |
| @@ -362,10 +364,11 @@ static inline int check_sync_clock(void) · 133 unmodified lines | |||
| 362 | * Apply clock delta to the global data structures. | 364 | * Apply clock delta to the global data structures. |
| 363 | * This is called once on the CPU that performed the clock sync. | 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 | unsigned long now, adj; | 369 | unsigned long now, adj; |
| 368 | struct ptff_qto qto; | 370 | struct ptff_qto qto; |
| 371 | int cs; | ||
| 369 | 372 | ||
| 370 | /* Fixup the monotonic sched clock. */ | 373 | /* Fixup the monotonic sched clock. */ |
| 371 | tod_clock_base.eitod += delta; | 374 | tod_clock_base.eitod += delta; |
| @@ -378,10 +381,13 @@ static void clock_sync_global(unsigned long long delta) · 6 unmodified lines | |||
| 378 | -(adj >> 15) : (adj >> 15); | 381 | -(adj >> 15) : (adj >> 15); |
| 379 | tod_steering_delta += delta; | 382 | tod_steering_delta += delta; |
| 380 | if ((abs(tod_steering_delta) >> 48) != 0) | 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 | tod_steering_delta); | 385 | tod_steering_delta); |
| 383 | tod_steering_end = now + (abs(tod_steering_delta) << 15); | 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 | /* Update LPAR offset. */ | 392 | /* Update LPAR offset. */ |
| 387 | if (ptff_query(PTFF_QTO) && ptff(&qto, sizeof(qto), PTFF_QTO) == 0) | 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 | * Apply clock delta to the per-CPU data structures of this CPU. | 400 | * Apply clock delta to the per-CPU data structures of this CPU. |
| 395 | * This is called for each online CPU after the call to clock_sync_global. | 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 | /* Add the delta to the clock comparator. */ | 405 | /* Add the delta to the clock comparator. */ |
| 400 | if (S390_lowcore.clock_comparator != clock_comparator_max) { | 406 | if (S390_lowcore.clock_comparator != clock_comparator_max) { |
| @@ -418,7 +424,7 @@ static void __init time_init_wq(void) · 17 unmodified lines | |||
| 418 | struct clock_sync_data { | 424 | struct clock_sync_data { |
| 419 | atomic_t cpus; | 425 | atomic_t cpus; |
| 420 | int in_sync; | 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 | static int stp_sync_clock(void *data) | 544 | static int stp_sync_clock(void *data) |
| 539 | { | 545 | { |
| 540 | struct clock_sync_data *sync = data; | 546 | struct clock_sync_data *sync = data; |
| 541 | unsigned long long clock_delta, flags; | 547 | u64 clock_delta, flags; |
| 542 | static int first; | 548 | static int first; |
| 543 | int rc; | 549 | int rc; |
| 544 | 550 | ||
| @@ -720,8 +726,8 @@ static ssize_t ctn_id_show(struct device *dev, · 175 unmodified lines | |||
| 720 | 726 | ||
| 721 | mutex_lock(&stp_mutex); | 727 | mutex_lock(&stp_mutex); |
| 722 | if (stpinfo_valid()) | 728 | if (stpinfo_valid()) |
| 723 | ret = sprintf(buf, "%016llx\n", | 729 | ret = sprintf(buf, "%016lx\n", |
| 724 | *(unsigned long long *) stp_info.ctnid); | 730 | *(unsigned long *) stp_info.ctnid); |
| 725 | mutex_unlock(&stp_mutex); | 731 | mutex_unlock(&stp_mutex); |
| 726 | return ret; | 732 | return ret; |
| 727 | } | 733 | } |
| @@ -794,7 +800,7 @@ static ssize_t leap_seconds_scheduled_show(struct device *dev, · 66 unmodified lines | |||
| 794 | if (!stzi.lsoib.p) | 800 | if (!stzi.lsoib.p) |
| 795 | return sprintf(buf, "0,0\n"); | 801 | return sprintf(buf, "0,0\n"); |
| 796 | 802 | ||
| 797 | return sprintf(buf, "%llu,%d\n", | 803 | return sprintf(buf, "%lu,%d\n", |
| 798 | tod_to_ns(stzi.lsoib.nlsout - TOD_UNIX_EPOCH) / NSEC_PER_SEC, | 804 | tod_to_ns(stzi.lsoib.nlsout - TOD_UNIX_EPOCH) / NSEC_PER_SEC, |
| 799 | stzi.lsoib.nlso - stzi.lsoib.also); | 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 | info = info->next; | 77 | info = info->next; |
| 78 | } | 78 | } |
| 79 | if (cpumask_empty(&mask)) | ||
| 80 | cpumask_copy(&mask, cpumask_of(cpu)); | ||
| 81 | break; | 79 | break; |
| 82 | case TOPOLOGY_MODE_PACKAGE: | 80 | case TOPOLOGY_MODE_PACKAGE: |
| 83 | cpumask_copy(&mask, cpu_present_mask); | 81 | cpumask_copy(&mask, cpu_present_mask); |
| @@ -214,7 +214,7 @@ void vtime_flush(struct task_struct *tsk) · 213 unmodified lines | |||
| 214 | avg_steal = S390_lowcore.avg_steal_timer / 2; | 214 | avg_steal = S390_lowcore.avg_steal_timer / 2; |
| 215 | if ((s64) steal > 0) { | 215 | if ((s64) steal > 0) { |
| 216 | S390_lowcore.steal_timer = 0; | 216 | S390_lowcore.steal_timer = 0; |
| 217 | account_steal_time(steal); | 217 | account_steal_time(cputime_to_nsecs(steal)); |
| 218 | avg_steal += steal; | 218 | avg_steal += steal; |
| 219 | } | 219 | } |
| 220 | S390_lowcore.avg_steal_timer = avg_steal; | 220 | S390_lowcore.avg_steal_timer = avg_steal; |
| @@ -1287,7 +1287,7 @@ static u64 __calculate_sltime(struct kvm_vcpu *vcpu) · 1286 unmodified lines | |||
| 1287 | /* already expired? */ | 1287 | /* already expired? */ |
| 1288 | if (cputm >> 63) | 1288 | if (cputm >> 63) |
| 1289 | return 0; | 1289 | return 0; |
| 1290 | return min(sltime, tod_to_ns(cputm)); | 1290 | return min_t(u64, sltime, tod_to_ns(cputm)); |
| 1291 | } | 1291 | } |
| 1292 | } else if (cpu_timer_interrupts_enabled(vcpu)) { | 1292 | } else if (cpu_timer_interrupts_enabled(vcpu)) { |
| 1293 | sltime = kvm_s390_get_cpu_timer(vcpu); | 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 | EXPORT_SYMBOL_GPL(zpci_disable_device); | 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 | struct zpci_bus *zbus = zdev->zbus; | 696 | struct zpci_bus *zbus = zdev->zbus; |
| 688 | struct pci_dev *pdev; | 697 | struct pci_dev *pdev; |
| 689 | 698 | ||
| 699 | if (!zdev->zbus->bus) | ||
| 700 | return; | ||
| 701 | |||
| 690 | pdev = pci_get_slot(zbus->bus, zdev->devfn); | 702 | pdev = pci_get_slot(zbus->bus, zdev->devfn); |
| 691 | if (pdev) { | 703 | if (pdev) { |
| 692 | if (pdev->is_virtfn) | 704 | if (set_error) |
| 693 | return zpci_iov_remove_virtfn(pdev, zdev->vfn); | 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 | pci_stop_and_remove_bus_device_locked(pdev); | 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 | struct zpci_dev *zdev = container_of(kref, struct zpci_dev, kref); | 785 | struct zpci_dev *zdev = container_of(kref, struct zpci_dev, kref); |
| 766 | 786 | ||
| 767 | if (zdev->zbus->bus) | 787 | if (zdev->zbus->bus) |
| 768 | zpci_remove_device(zdev); | 788 | zpci_remove_device(zdev, false); |
| 769 | 789 | ||
| 770 | switch (zdev->state) { | 790 | switch (zdev->state) { |
| 771 | case ZPCI_FN_STATE_ONLINE: | 791 | case ZPCI_FN_STATE_ONLINE: |
| @@ -76,13 +76,10 @@ void zpci_event_error(void *data) · 75 unmodified lines | |||
| 76 | static void __zpci_event_availability(struct zpci_ccdf_avail *ccdf) | 76 | static void __zpci_event_availability(struct zpci_ccdf_avail *ccdf) |
| 77 | { | 77 | { |
| 78 | struct zpci_dev *zdev = get_zdev_by_fid(ccdf->fid); | 78 | struct zpci_dev *zdev = get_zdev_by_fid(ccdf->fid); |
| 79 | struct pci_dev *pdev = NULL; | ||
| 80 | enum zpci_state state; | 79 | enum zpci_state state; |
| 80 | struct pci_dev *pdev; | ||
| 81 | int ret; | 81 | int ret; |
| 82 | 82 | ||
| 83 | if (zdev && zdev->zbus->bus) | ||
| 84 | pdev = pci_get_slot(zdev->zbus->bus, zdev->devfn); | ||
| 85 | |||
| 86 | zpci_err("avail CCDF:\n"); | 83 | zpci_err("avail CCDF:\n"); |
| 87 | zpci_err_hex(ccdf, sizeof(*ccdf)); | 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 | case 0x0303: /* Deconfiguration requested */ | 121 | case 0x0303: /* Deconfiguration requested */ |
| 125 | if (!zdev) | 122 | if (!zdev) |
| 126 | break; | 123 | break; |
| 127 | if (pdev) | 124 | zpci_remove_device(zdev, false); |
| 128 | zpci_remove_device(zdev); | ||
| 129 | 125 | ||
| 130 | ret = zpci_disable_device(zdev); | 126 | ret = zpci_disable_device(zdev); |
| 131 | if (ret) | 127 | if (ret) |
| @@ -140,12 +136,10 @@ static void __zpci_event_availability(struct zpci_ccdf_avail *ccdf) · 8 unmodified lines | |||
| 140 | case 0x0304: /* Configured -> Standby|Reserved */ | 136 | case 0x0304: /* Configured -> Standby|Reserved */ |
| 141 | if (!zdev) | 137 | if (!zdev) |
| 142 | break; | 138 | break; |
| 143 | if (pdev) { | 139 | /* Give the driver a hint that the function is |
| 144 | /* Give the driver a hint that the function is | 140 | * already unusable. |
| 145 | * already unusable. */ | 141 | */ |
| 146 | pdev->error_state = pci_channel_io_perm_failure; | 142 | zpci_remove_device(zdev, true); |
| 147 | zpci_remove_device(zdev); | ||
| 148 | } | ||
| 149 | 143 | ||
| 150 | zdev->fh = ccdf->fh; | 144 | zdev->fh = ccdf->fh; |
| 151 | zpci_disable_device(zdev); | 145 | zpci_disable_device(zdev); |
| @@ -93,7 +93,7 @@ CONFIG_NETDEVICES=y · 92 unmodified lines | |||
| 93 | CONFIG_NET_ETHERNET=y | 93 | CONFIG_NET_ETHERNET=y |
| 94 | CONFIG_MII=m | 94 | CONFIG_MII=m |
| 95 | CONFIG_SUNLANCE=m | 95 | CONFIG_SUNLANCE=m |
| 96 | CONFIG_HAPPYMEAL=m | 96 | CONFIG_HAPPYMEAL=y |
| 97 | CONFIG_SUNGEM=m | 97 | CONFIG_SUNGEM=m |
| 98 | CONFIG_SUNVNET=m | 98 | CONFIG_SUNVNET=m |
| 99 | CONFIG_LDMVSW=m | 99 | CONFIG_LDMVSW=m |
| @@ -234,9 +234,7 @@ CONFIG_CRYPTO_TWOFISH=m · 134 unmodified lines | |||
| 234 | CONFIG_CRC16=m | 234 | CONFIG_CRC16=m |
| 235 | CONFIG_LIBCRC32C=m | 235 | CONFIG_LIBCRC32C=m |
| 236 | CONFIG_VCC=m | 236 | CONFIG_VCC=m |
| 237 | CONFIG_ATA=y | ||
| 238 | CONFIG_PATA_CMD64X=y | 237 | CONFIG_PATA_CMD64X=y |
| 239 | CONFIG_HAPPYMEAL=y | ||
| 240 | CONFIG_IP_PNP=y | 238 | CONFIG_IP_PNP=y |
| 241 | CONFIG_IP_PNP_DHCP=y | 239 | CONFIG_IP_PNP_DHCP=y |
| 242 | CONFIG_DEVTMPFS=y | 240 | CONFIG_DEVTMPFS=y |
| @@ -8,7 +8,6 @@ · 7 unmodified lines | |||
| 8 | 8 | ||
| 9 | #include <asm/ptrace.h> | 9 | #include <asm/ptrace.h> |
| 10 | #include <asm/processor.h> | 10 | #include <asm/processor.h> |
| 11 | #include <asm/extable_64.h> | ||
| 12 | #include <asm/spitfire.h> | 11 | #include <asm/spitfire.h> |
| 13 | #include <asm/adi.h> | 12 | #include <asm/adi.h> |
| 14 | 13 | ||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* SPDX-License-Identifier: GPL-2.0 */ | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | #ifndef __ASM_EXTABLE64_H | 2 | #ifndef __ASM_EXTABLE_H |
| 3 | #define __ASM_EXTABLE64_H | 3 | #define __ASM_EXTABLE_H |
| 4 | /* | 4 | /* |
| 5 | * The exception table consists of pairs of addresses: the first is the | 5 | * The exception table consists of pairs of addresses: the first is the |
| 6 | * address of an instruction that is allowed to fault, and the second is | 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 | unsigned long fsr; | 50 | unsigned long fsr; |
| 51 | unsigned long fpqdepth; | 51 | unsigned long fpqdepth; |
| 52 | struct fpq fpqueue[16]; | 52 | struct fpq fpqueue[16]; |
| 53 | unsigned long flags; | ||
| 54 | mm_segment_t current_ds; | 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 | #define INIT_THREAD { \ | 56 | #define INIT_THREAD { \ |
| 61 | .flags = SPARC_FLAG_KTHREAD, \ | ||
| 62 | .current_ds = KERNEL_DS, \ | 57 | .current_ds = KERNEL_DS, \ |
| 58 | .kregs = (struct pt_regs *)(init_stack+THREAD_SIZE)-1 \ | ||
| 63 | } | 59 | } |
| 64 | 60 | ||
| 65 | /* Do necessary setup to start up a newly executed thread. */ | 61 | /* Do necessary setup to start up a newly executed thread. */ |
| @@ -118,6 +118,7 @@ struct thread_info { · 117 unmodified lines | |||
| 118 | .task = &tsk, \ | 118 | .task = &tsk, \ |
| 119 | .current_ds = ASI_P, \ | 119 | .current_ds = ASI_P, \ |
| 120 | .preempt_count = INIT_PREEMPT_COUNT, \ | 120 | .preempt_count = INIT_PREEMPT_COUNT, \ |
| 121 | .kregs = (struct pt_regs *)(init_stack+THREAD_SIZE)-1 \ | ||
| 121 | } | 122 | } |
| 122 | 123 | ||
| 123 | /* how to get the thread information struct from C */ | 124 | /* how to get the thread information struct from C */ |
| @@ -1,6 +1,9 @@ | |||
| 1 | /* SPDX-License-Identifier: GPL-2.0 */ | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | #ifndef ___ASM_SPARC_UACCESS_H | 2 | #ifndef ___ASM_SPARC_UACCESS_H |
| 3 | #define ___ASM_SPARC_UACCESS_H | 3 | #define ___ASM_SPARC_UACCESS_H |
| 4 | |||
| 5 | #include <asm/extable.h> | ||
| 6 | |||
| 4 | #if defined(__sparc__) && defined(__arch64__) | 7 | #if defined(__sparc__) && defined(__arch64__) |
| 5 | #include <asm/uaccess_64.h> | 8 | #include <asm/uaccess_64.h> |
| 6 | #else | 9 | #else |
| @@ -13,9 +13,6 @@ · 12 unmodified lines | |||
| 13 | 13 | ||
| 14 | #include <asm/processor.h> | 14 | #include <asm/processor.h> |
| 15 | 15 | ||
| 16 | #define ARCH_HAS_SORT_EXTABLE | ||
| 17 | #define ARCH_HAS_SEARCH_EXTABLE | ||
| 18 | |||
| 19 | /* Sparc is not segmented, however we need to be able to fool access_ok() | 16 | /* Sparc is not segmented, however we need to be able to fool access_ok() |
| 20 | * when doing system calls from kernel mode legitimately. | 17 | * when doing system calls from kernel mode legitimately. |
| 21 | * | 18 | * |
| @@ -40,36 +37,6 @@ · 18 unmodified lines | |||
| 40 | #define __access_ok(addr, size) (__user_ok((addr) & get_fs().seg, (size))) | 37 | #define __access_ok(addr, size) (__user_ok((addr) & get_fs().seg, (size))) |
| 41 | #define access_ok(addr, size) __access_ok((unsigned long)(addr), size) | 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 | /* Uh, these should become the main single-value transfer routines.. | 40 | /* Uh, these should become the main single-value transfer routines.. |
| 74 | * They automatically use the right size if we just have the right | 41 | * They automatically use the right size if we just have the right |
| 75 | * pointer type.. | 42 | * pointer type.. |
| @@ -252,12 +219,7 @@ static inline unsigned long __clear_user(void __user *addr, unsigned long size) · 176 unmodified lines | |||
| 252 | unsigned long ret; | 219 | unsigned long ret; |
| 253 | 220 | ||
| 254 | __asm__ __volatile__ ( | 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 | "mov %2, %%o1\n" | 222 | "mov %2, %%o1\n" |
| 260 | "1:\n\t" | ||
| 261 | "call __bzero\n\t" | 223 | "call __bzero\n\t" |
| 262 | " mov %1, %%o0\n\t" | 224 | " mov %1, %%o0\n\t" |
| 263 | "mov %%o0, %0\n" | 225 | "mov %%o0, %0\n" |
| @@ -10,7 +10,6 @@ · 9 unmodified lines | |||
| 10 | #include <linux/string.h> | 10 | #include <linux/string.h> |
| 11 | #include <asm/asi.h> | 11 | #include <asm/asi.h> |
| 12 | #include <asm/spitfire.h> | 12 | #include <asm/spitfire.h> |
| 13 | #include <asm/extable_64.h> | ||
| 14 | 13 | ||
| 15 | #include <asm/processor.h> | 14 | #include <asm/processor.h> |
| 16 | 15 | ||
| @@ -515,7 +515,7 @@ continue_boot: · 514 unmodified lines | |||
| 515 | 515 | ||
| 516 | /* I want a kernel stack NOW! */ | 516 | /* I want a kernel stack NOW! */ |
| 517 | set init_thread_union, %g1 | 517 | set init_thread_union, %g1 |
| 518 | set (THREAD_SIZE - STACKFRAME_SZ), %g2 | 518 | set (THREAD_SIZE - STACKFRAME_SZ - TRACEREG_SZ), %g2 |
| 519 | add %g1, %g2, %sp | 519 | add %g1, %g2, %sp |
| 520 | mov 0, %fp /* And for good luck */ | 520 | mov 0, %fp /* And for good luck */ |
| 521 | 521 | ||
| @@ -706,7 +706,7 @@ tlb_fixup_done: · 705 unmodified lines | |||
| 706 | wr %g0, ASI_P, %asi | 706 | wr %g0, ASI_P, %asi |
| 707 | mov 1, %g1 | 707 | mov 1, %g1 |
| 708 | sllx %g1, THREAD_SHIFT, %g1 | 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 | add %g6, %g1, %sp | 710 | add %g6, %g1, %sp |
| 711 | 711 | ||
| 712 | /* Set per-cpu pointer initially to zero, this makes | 712 | /* Set per-cpu pointer initially to zero, this makes |
| @@ -216,16 +216,6 @@ void flush_thread(void) · 215 unmodified lines | |||
| 216 | clear_thread_flag(TIF_USEDFPU); | 216 | clear_thread_flag(TIF_USEDFPU); |
| 217 | #endif | 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 | static inline struct sparc_stackf __user * | 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 | extern int nwindows; | 303 | extern int nwindows; |
| 314 | unsigned long psr; | 304 | unsigned long psr; |
| 315 | memset(new_stack, 0, STACKFRAME_SZ + TRACEREG_SZ); | 305 | memset(new_stack, 0, STACKFRAME_SZ + TRACEREG_SZ); |
| 316 | p->thread.flags |= SPARC_FLAG_KTHREAD; | ||
| 317 | p->thread.current_ds = KERNEL_DS; | 306 | p->thread.current_ds = KERNEL_DS; |
| 318 | ti->kpc = (((unsigned long) ret_from_kernel_thread) - 0x8); | 307 | ti->kpc = (((unsigned long) ret_from_kernel_thread) - 0x8); |
| 319 | childregs->u_regs[UREG_G1] = sp; /* function */ | 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 | memcpy(new_stack, (char *)regs - STACKFRAME_SZ, STACKFRAME_SZ + TRACEREG_SZ); | 315 | memcpy(new_stack, (char *)regs - STACKFRAME_SZ, STACKFRAME_SZ + TRACEREG_SZ); |
| 327 | childregs->u_regs[UREG_FP] = sp; | 316 | childregs->u_regs[UREG_FP] = sp; |
| 328 | p->thread.flags &= ~SPARC_FLAG_KTHREAD; | ||
| 329 | p->thread.current_ds = USER_DS; | 317 | p->thread.current_ds = USER_DS; |
| 330 | ti->kpc = (((unsigned long) ret_from_fork) - 0x8); | 318 | ti->kpc = (((unsigned long) ret_from_fork) - 0x8); |
| 331 | ti->kpsr = current->thread.fork_kpsr | PSR_PIL; | 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 | struct tt_entry *sparc_ttable; | 268 | struct tt_entry *sparc_ttable; |
| 269 | static struct pt_regs fake_swapper_regs; | ||
| 270 | 269 | ||
| 271 | /* Called from head_32.S - before we have setup anything | 270 | /* Called from head_32.S - before we have setup anything |
| 272 | * in the kernel. Be very careful with what you do here. | 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 | (*(linux_dbvec->teach_debugger))(); | 362 | (*(linux_dbvec->teach_debugger))(); |
| 364 | } | 363 | } |
| 365 | 364 | ||
| 366 | init_task.thread.kregs = &fake_swapper_regs; | ||
| 367 | |||
| 368 | /* Run-time patch instructions to match the cpu model */ | 365 | /* Run-time patch instructions to match the cpu model */ |
| 369 | per_cpu_patch(); | 366 | per_cpu_patch(); |
| 370 | 367 | ||
| @@ -165,8 +165,6 @@ extern int root_mountflags; · 164 unmodified lines | |||
| 165 | 165 | ||
| 166 | char reboot_command[COMMAND_LINE_SIZE]; | 166 | char reboot_command[COMMAND_LINE_SIZE]; |
| 167 | 167 | ||
| 168 | static struct pt_regs fake_swapper_regs = { { 0, }, 0, 0, 0, 0 }; | ||
| 169 | |||
| 170 | static void __init per_cpu_patch(void) | 168 | static void __init per_cpu_patch(void) |
| 171 | { | 169 | { |
| 172 | struct cpuid_patch_entry *p; | 170 | struct cpuid_patch_entry *p; |
| @@ -661,8 +659,6 @@ void __init setup_arch(char **cmdline_p) · 488 unmodified lines | |||
| 661 | rd_image_start = ram_flags & RAMDISK_IMAGE_START_MASK; | 659 | rd_image_start = ram_flags & RAMDISK_IMAGE_START_MASK; |
| 662 | #endif | 660 | #endif |
| 663 | 661 | ||
| 664 | task_thread_info(&init_task)->kregs = &fake_swapper_regs; | ||
| 665 | |||
| 666 | #ifdef CONFIG_IP_PNP | 662 | #ifdef CONFIG_IP_PNP |
| 667 | if (!ic_set_manually) { | 663 | if (!ic_set_manually) { |
| 668 | phandle chosen = prom_finddevice("/chosen"); | 664 | phandle chosen = prom_finddevice("/chosen"); |
| @@ -275,14 +275,13 @@ bool is_no_fault_exception(struct pt_regs *regs) · 274 unmodified lines | |||
| 275 | asi = (regs->tstate >> 24); /* saved %asi */ | 275 | asi = (regs->tstate >> 24); /* saved %asi */ |
| 276 | else | 276 | else |
| 277 | asi = (insn >> 5); /* immediate asi */ | 277 | asi = (insn >> 5); /* immediate asi */ |
| 278 | if ((asi & 0xf2) == ASI_PNF) { | 278 | if ((asi & 0xf6) == ASI_PNF) { |
| 279 | if (insn & 0x1000000) { /* op3[5:4]=3 */ | 279 | if (insn & 0x200000) /* op3[2], stores */ |
| 280 | handle_ldf_stq(insn, regs); | ||
| 281 | return true; | ||
| 282 | } else if (insn & 0x200000) { /* op3[2], stores */ | ||
| 283 | return false; | 280 | return false; |
| 284 | } | 281 | if (insn & 0x1000000) /* op3[5:4]=3 (fp) */ |
| 285 | handle_ld_nf(insn, regs); | 282 | handle_ldf_stq(insn, regs); |
| 283 | else | ||
| 284 | handle_ld_nf(insn, regs); | ||
| 286 | return true; | 285 | return true; |
| 287 | } | 286 | } |
| 288 | } | 287 | } |
| @@ -16,6 +16,7 @@ · 15 unmodified lines | |||
| 16 | #include <linux/uaccess.h> | 16 | #include <linux/uaccess.h> |
| 17 | #include <linux/smp.h> | 17 | #include <linux/smp.h> |
| 18 | #include <linux/perf_event.h> | 18 | #include <linux/perf_event.h> |
| 19 | #include <linux/extable.h> | ||
| 19 | 20 | ||
| 20 | #include <asm/setup.h> | 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 | static void kernel_mna_trap_fault(struct pt_regs *regs, unsigned int insn) | 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 | const struct exception_table_entry *entry; |
| 217 | unsigned long fixup = search_extables_range(regs->pc, &g2); | ||
| 218 | 218 | ||
| 219 | if (!fixup) { | 219 | entry = search_exception_tables(regs->pc); |
| 220 | if (!entry) { | ||
| 220 | unsigned long address = compute_effective_address(regs, insn); | 221 | unsigned long address = compute_effective_address(regs, insn); |
| 221 | if(address < PAGE_SIZE) { | 222 | if(address < PAGE_SIZE) { |
| 222 | printk(KERN_ALERT "Unable to handle kernel NULL pointer dereference in mna handler"); | 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 | die_if_kernel("Oops", regs); | 233 | die_if_kernel("Oops", regs); |
| 233 | /* Not reached */ | 234 | /* Not reached */ |
| 234 | } | 235 | } |
| 235 | regs->pc = fixup; | 236 | regs->pc = entry->fixup; |
| 236 | regs->npc = regs->pc + 4; | 237 | regs->npc = regs->pc + 4; |
| 237 | regs->u_regs [UREG_G2] = g2; | ||
| 238 | } | 238 | } |
| 239 | 239 | ||
| 240 | asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn) | 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, | 277 | asmlinkage void user_unaligned_trap(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) | ||
| 312 | { | 278 | { |
| 313 | send_sig_fault(SIGBUS, BUS_ADRALN, | 279 | send_sig_fault(SIGBUS, BUS_ADRALN, |
| 314 | (void __user *)safe_compute_effective_address(regs, insn), | 280 | (void __user *)safe_compute_effective_address(regs, insn), |
| 315 | 0, current); | 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 | .text; \ | 155 | .text; \ |
| 156 | .align 4 | 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 | /* This aligned version executes typically in 8.5 superscalar cycles, this | 158 | /* This aligned version executes typically in 8.5 superscalar cycles, this |
| 166 | * is the best I can do. I say 8.5 because the final add will pair with | 159 | * is the best I can do. I say 8.5 because the final add will pair with |
| 167 | * the next ldd in the main unrolled loop. Thus the pipe is always full. | 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 | * please check the fixup code below as well. | 162 | * please check the fixup code below as well. |
| 170 | */ | 163 | */ |
| 171 | #define CSUMCOPY_BIGCHUNK_ALIGNED(src, dst, sum, off, t0, t1, t2, t3, t4, t5, t6, t7) \ | 164 | #define CSUMCOPY_BIGCHUNK_ALIGNED(src, dst, sum, off, t0, t1, t2, t3, t4, t5, t6, t7) \ |
| 172 | ldd [src + off + 0x00], t0; \ | 165 | EX(ldd [src + off + 0x00], t0); \ |
| 173 | ldd [src + off + 0x08], t2; \ | 166 | EX(ldd [src + off + 0x08], t2); \ |
| 174 | addxcc t0, sum, sum; \ | 167 | addxcc t0, sum, sum; \ |
| 175 | ldd [src + off + 0x10], t4; \ | 168 | EX(ldd [src + off + 0x10], t4); \ |
| 176 | addxcc t1, sum, sum; \ | 169 | addxcc t1, sum, sum; \ |
| 177 | ldd [src + off + 0x18], t6; \ | 170 | EX(ldd [src + off + 0x18], t6); \ |
| 178 | addxcc t2, sum, sum; \ | 171 | addxcc t2, sum, sum; \ |
| 179 | std t0, [dst + off + 0x00]; \ | 172 | EX(std t0, [dst + off + 0x00]); \ |
| 180 | addxcc t3, sum, sum; \ | 173 | addxcc t3, sum, sum; \ |
| 181 | std t2, [dst + off + 0x08]; \ | 174 | EX(std t2, [dst + off + 0x08]); \ |
| 182 | addxcc t4, sum, sum; \ | 175 | addxcc t4, sum, sum; \ |
| 183 | std t4, [dst + off + 0x10]; \ | 176 | EX(std t4, [dst + off + 0x10]); \ |
| 184 | addxcc t5, sum, sum; \ | 177 | addxcc t5, sum, sum; \ |
| 185 | std t6, [dst + off + 0x18]; \ | 178 | EX(std t6, [dst + off + 0x18]); \ |
| 186 | addxcc t6, sum, sum; \ | 179 | addxcc t6, sum, sum; \ |
| 187 | addxcc t7, sum, sum; | 180 | addxcc t7, sum, sum; |
| 188 | 181 | ||
| @@ -191,39 +184,39 @@ cpout: retl ! get outta here · 2 unmodified lines | |||
| 191 | * Viking MXCC into streaming mode. Ho hum... | 184 | * Viking MXCC into streaming mode. Ho hum... |
| 192 | */ | 185 | */ |
| 193 | #define CSUMCOPY_BIGCHUNK(src, dst, sum, off, t0, t1, t2, t3, t4, t5, t6, t7) \ | 186 | #define CSUMCOPY_BIGCHUNK(src, dst, sum, off, t0, t1, t2, t3, t4, t5, t6, t7) \ |
| 194 | ldd [src + off + 0x00], t0; \ | 187 | EX(ldd [src + off + 0x00], t0); \ |
| 195 | ldd [src + off + 0x08], t2; \ | 188 | EX(ldd [src + off + 0x08], t2); \ |
| 196 | ldd [src + off + 0x10], t4; \ | 189 | EX(ldd [src + off + 0x10], t4); \ |
| 197 | ldd [src + off + 0x18], t6; \ | 190 | EX(ldd [src + off + 0x18], t6); \ |
| 198 | st t0, [dst + off + 0x00]; \ | 191 | EX(st t0, [dst + off + 0x00]); \ |
| 199 | addxcc t0, sum, sum; \ | 192 | addxcc t0, sum, sum; \ |
| 200 | st t1, [dst + off + 0x04]; \ | 193 | EX(st t1, [dst + off + 0x04]); \ |
| 201 | addxcc t1, sum, sum; \ | 194 | addxcc t1, sum, sum; \ |
| 202 | st t2, [dst + off + 0x08]; \ | 195 | EX(st t2, [dst + off + 0x08]); \ |
| 203 | addxcc t2, sum, sum; \ | 196 | addxcc t2, sum, sum; \ |
| 204 | st t3, [dst + off + 0x0c]; \ | 197 | EX(st t3, [dst + off + 0x0c]); \ |
| 205 | addxcc t3, sum, sum; \ | 198 | addxcc t3, sum, sum; \ |
| 206 | st t4, [dst + off + 0x10]; \ | 199 | EX(st t4, [dst + off + 0x10]); \ |
| 207 | addxcc t4, sum, sum; \ | 200 | addxcc t4, sum, sum; \ |
| 208 | st t5, [dst + off + 0x14]; \ | 201 | EX(st t5, [dst + off + 0x14]); \ |
| 209 | addxcc t5, sum, sum; \ | 202 | addxcc t5, sum, sum; \ |
| 210 | st t6, [dst + off + 0x18]; \ | 203 | EX(st t6, [dst + off + 0x18]); \ |
| 211 | addxcc t6, sum, sum; \ | 204 | addxcc t6, sum, sum; \ |
| 212 | st t7, [dst + off + 0x1c]; \ | 205 | EX(st t7, [dst + off + 0x1c]); \ |
| 213 | addxcc t7, sum, sum; | 206 | addxcc t7, sum, sum; |
| 214 | 207 | ||
| 215 | /* Yuck, 6 superscalar cycles... */ | 208 | /* Yuck, 6 superscalar cycles... */ |
| 216 | #define CSUMCOPY_LASTCHUNK(src, dst, sum, off, t0, t1, t2, t3) \ | 209 | #define CSUMCOPY_LASTCHUNK(src, dst, sum, off, t0, t1, t2, t3) \ |
| 217 | ldd [src - off - 0x08], t0; \ | 210 | EX(ldd [src - off - 0x08], t0); \ |
| 218 | ldd [src - off - 0x00], t2; \ | 211 | EX(ldd [src - off - 0x00], t2); \ |
| 219 | addxcc t0, sum, sum; \ | 212 | addxcc t0, sum, sum; \ |
| 220 | st t0, [dst - off - 0x08]; \ | 213 | EX(st t0, [dst - off - 0x08]); \ |
| 221 | addxcc t1, sum, sum; \ | 214 | addxcc t1, sum, sum; \ |
| 222 | st t1, [dst - off - 0x04]; \ | 215 | EX(st t1, [dst - off - 0x04]); \ |
| 223 | addxcc t2, sum, sum; \ | 216 | addxcc t2, sum, sum; \ |
| 224 | st t2, [dst - off - 0x00]; \ | 217 | EX(st t2, [dst - off - 0x00]); \ |
| 225 | addxcc t3, sum, sum; \ | 218 | addxcc t3, sum, sum; \ |
| 226 | st t3, [dst - off + 0x04]; | 219 | EX(st t3, [dst - off + 0x04]); |
| 227 | 220 | ||
| 228 | /* Handle the end cruft code out of band for better cache patterns. */ | 221 | /* Handle the end cruft code out of band for better cache patterns. */ |
| 229 | cc_end_cruft: | 222 | cc_end_cruft: |
| @@ -331,7 +324,6 @@ __csum_partial_copy_sparc_generic: · 101 unmodified lines | |||
| 331 | CSUMCOPY_BIGCHUNK(%o0,%o1,%g7,0x20,%o4,%o5,%g2,%g3,%g4,%g5,%o2,%o3) | 324 | CSUMCOPY_BIGCHUNK(%o0,%o1,%g7,0x20,%o4,%o5,%g2,%g3,%g4,%g5,%o2,%o3) |
| 332 | CSUMCOPY_BIGCHUNK(%o0,%o1,%g7,0x40,%o4,%o5,%g2,%g3,%g4,%g5,%o2,%o3) | 325 | CSUMCOPY_BIGCHUNK(%o0,%o1,%g7,0x40,%o4,%o5,%g2,%g3,%g4,%g5,%o2,%o3) |
| 333 | CSUMCOPY_BIGCHUNK(%o0,%o1,%g7,0x60,%o4,%o5,%g2,%g3,%g4,%g5,%o2,%o3) | 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 | sub %g1, 128, %g1 ! detract from length | 327 | sub %g1, 128, %g1 ! detract from length |
| 336 | addx %g0, %g7, %g7 ! add in last carry bit | 328 | addx %g0, %g7, %g7 ! add in last carry bit |
| 337 | andcc %g1, 0xffffff80, %g0 ! more to csum? | 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 | CSUMCOPY_LASTCHUNK(%o0,%o1,%g7,0x28,%g2,%g3,%g4,%g5) | 348 | CSUMCOPY_LASTCHUNK(%o0,%o1,%g7,0x28,%g2,%g3,%g4,%g5) |
| 357 | CSUMCOPY_LASTCHUNK(%o0,%o1,%g7,0x18,%g2,%g3,%g4,%g5) | 349 | CSUMCOPY_LASTCHUNK(%o0,%o1,%g7,0x18,%g2,%g3,%g4,%g5) |
| 358 | CSUMCOPY_LASTCHUNK(%o0,%o1,%g7,0x08,%g2,%g3,%g4,%g5) | 350 | CSUMCOPY_LASTCHUNK(%o0,%o1,%g7,0x08,%g2,%g3,%g4,%g5) |
| 359 | 12: EXT(cctbl, 12b) ! note for exception table handling | 351 | 12: addx %g0, %g7, %g7 |
| 360 | addx %g0, %g7, %g7 | ||
| 361 | andcc %o3, 0xf, %g0 ! check for low bits set | 352 | andcc %o3, 0xf, %g0 ! check for low bits set |
| 362 | ccte: bne cc_end_cruft ! something left, handle it out of band | 353 | ccte: bne cc_end_cruft ! something left, handle it out of band |
| 363 | andcc %o3, 8, %g0 ! begin checks for that code | 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 | CSUMCOPY_BIGCHUNK_ALIGNED(%o0,%o1,%g7,0x20,%o4,%o5,%g2,%g3,%g4,%g5,%o2,%o3) | 358 | CSUMCOPY_BIGCHUNK_ALIGNED(%o0,%o1,%g7,0x20,%o4,%o5,%g2,%g3,%g4,%g5,%o2,%o3) |
| 368 | CSUMCOPY_BIGCHUNK_ALIGNED(%o0,%o1,%g7,0x40,%o4,%o5,%g2,%g3,%g4,%g5,%o2,%o3) | 359 | CSUMCOPY_BIGCHUNK_ALIGNED(%o0,%o1,%g7,0x40,%o4,%o5,%g2,%g3,%g4,%g5,%o2,%o3) |
| 369 | CSUMCOPY_BIGCHUNK_ALIGNED(%o0,%o1,%g7,0x60,%o4,%o5,%g2,%g3,%g4,%g5,%o2,%o3) | 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 | sub %g1, 128, %g1 ! detract from length | 361 | sub %g1, 128, %g1 ! detract from length |
| 372 | addx %g0, %g7, %g7 ! add in last carry bit | 362 | addx %g0, %g7, %g7 ! add in last carry bit |
| 373 | andcc %g1, 0xffffff80, %g0 ! more to csum? | 363 | andcc %g1, 0xffffff80, %g0 ! more to csum? |
| @@ -21,98 +21,134 @@ · 20 unmodified lines | |||
| 21 | /* Work around cpp -rob */ | 21 | /* Work around cpp -rob */ |
| 22 | #define ALLOC #alloc | 22 | #define ALLOC #alloc |
| 23 | #define EXECINSTR #execinstr | 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 | #define EX(x,y,a,b) \ | 31 | #define EX(x,y,a,b) \ |
| 25 | 98: x,y; \ | 32 | 98: x,y; \ |
| 26 | .section .fixup,ALLOC,EXECINSTR; \ | 33 | .section .fixup,ALLOC,EXECINSTR; \ |
| 27 | .align 4; \ | 34 | .align 4; \ |
| 28 | 99: ba fixupretl; \ | 35 | 99: retl; \ |
| 29 | a, b, %g3; \ | 36 | a, b, %o0; \ |
| 30 | .section __ex_table,ALLOC; \ | 37 | EX_ENTRY(98b, 99b) |
| 31 | .align 4; \ | ||
| 32 | .word 98b, 99b; \ | ||
| 33 | .text; \ | ||
| 34 | .align 4 | ||
| 35 | 38 | ||
| 36 | #define EX2(x,y,c,d,e,a,b) \ | 39 | #define EX2(x,y,c,d,e,a,b) \ |
| 37 | 98: x,y; \ | 40 | 98: x,y; \ |
| 38 | .section .fixup,ALLOC,EXECINSTR; \ | 41 | .section .fixup,ALLOC,EXECINSTR; \ |
| 39 | .align 4; \ | 42 | .align 4; \ |
| 40 | 99: c, d, e; \ | 43 | 99: c, d, e; \ |
| 41 | ba fixupretl; \ | 44 | retl; \ |
| 42 | a, b, %g3; \ | 45 | a, b, %o0; \ |
| 43 | .section __ex_table,ALLOC; \ | 46 | EX_ENTRY(98b, 99b) |
| 44 | .align 4; \ | ||
| 45 | .word 98b, 99b; \ | ||
| 46 | .text; \ | ||
| 47 | .align 4 | ||
| 48 | 47 | ||
| 49 | #define EXO2(x,y) \ | 48 | #define EXO2(x,y) \ |
| 50 | 98: x, y; \ | 49 | 98: x, y; \ |
| 51 | .section __ex_table,ALLOC; \ | 50 | EX_ENTRY(98b, 97f) |
| 52 | .align 4; \ | ||
| 53 | .word 98b, 97f; \ | ||
| 54 | .text; \ | ||
| 55 | .align 4 | ||
| 56 | 51 | ||
| 57 | #define EXT(start,end,handler) \ | 52 | #define LD(insn, src, offset, reg, label) \ |
| 58 | .section __ex_table,ALLOC; \ | 53 | 98: insn [%src + (offset)], %reg; \ |
| 59 | .align 4; \ | 54 | .section .fixup,ALLOC,EXECINSTR; \ |
| 60 | .word start, 0, end, handler; \ | 55 | 99: ba label; \ |
| 61 | .text; \ | 56 | mov offset, %g5; \ |
| 62 | .align 4 | 57 | EX_ENTRY(98b, 99b) |
| 63 | 58 | ||
| 64 | /* Please do not change following macros unless you change logic used | 59 | #define ST(insn, dst, offset, reg, label) \ |
| 65 | * in .fixup at the end of this file as well | 60 | 98: insn %reg, [%dst + (offset)]; \ |
| 66 | */ | 61 | .section .fixup,ALLOC,EXECINSTR; \ |
| 62 | 99: ba label; \ | ||
| 63 | mov offset, %g5; \ | ||
| 64 | EX_ENTRY(98b, 99b) | ||
| 67 | 65 | ||
| 68 | /* Both these macros have to start with exactly the same insn */ | 66 | /* Both these macros have to start with exactly the same insn */ |
| 67 | /* left: g7 + (g1 % 128) - offset */ | ||
| 69 | #define MOVE_BIGCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, t7) \ | 68 | #define MOVE_BIGCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, t7) \ |
| 70 | ldd [%src + (offset) + 0x00], %t0; \ | 69 | LD(ldd, src, offset + 0x00, t0, bigchunk_fault) \ |
| 71 | ldd [%src + (offset) + 0x08], %t2; \ | 70 | LD(ldd, src, offset + 0x08, t2, bigchunk_fault) \ |
| 72 | ldd [%src + (offset) + 0x10], %t4; \ | 71 | LD(ldd, src, offset + 0x10, t4, bigchunk_fault) \ |
| 73 | ldd [%src + (offset) + 0x18], %t6; \ | 72 | LD(ldd, src, offset + 0x18, t6, bigchunk_fault) \ |
| 74 | st %t0, [%dst + (offset) + 0x00]; \ | 73 | ST(st, dst, offset + 0x00, t0, bigchunk_fault) \ |
| 75 | st %t1, [%dst + (offset) + 0x04]; \ | 74 | ST(st, dst, offset + 0x04, t1, bigchunk_fault) \ |
| 76 | st %t2, [%dst + (offset) + 0x08]; \ | 75 | ST(st, dst, offset + 0x08, t2, bigchunk_fault) \ |
| 77 | st %t3, [%dst + (offset) + 0x0c]; \ | 76 | ST(st, dst, offset + 0x0c, t3, bigchunk_fault) \ |
| 78 | st %t4, [%dst + (offset) + 0x10]; \ | 77 | ST(st, dst, offset + 0x10, t4, bigchunk_fault) \ |
| 79 | st %t5, [%dst + (offset) + 0x14]; \ | 78 | ST(st, dst, offset + 0x14, t5, bigchunk_fault) \ |
| 80 | st %t6, [%dst + (offset) + 0x18]; \ | 79 | ST(st, dst, offset + 0x18, t6, bigchunk_fault) \ |
| 81 | st %t7, [%dst + (offset) + 0x1c]; | 80 | ST(st, dst, offset + 0x1c, t7, bigchunk_fault) |
| 82 | 81 | ||
| 82 | /* left: g7 + (g1 % 128) - offset */ | ||
| 83 | #define MOVE_BIGALIGNCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, t7) \ | 83 | #define MOVE_BIGALIGNCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, t7) \ |
| 84 | ldd [%src + (offset) + 0x00], %t0; \ | 84 | LD(ldd, src, offset + 0x00, t0, bigchunk_fault) \ |
| 85 | ldd [%src + (offset) + 0x08], %t2; \ | 85 | LD(ldd, src, offset + 0x08, t2, bigchunk_fault) \ |
| 86 | ldd [%src + (offset) + 0x10], %t4; \ | 86 | LD(ldd, src, offset + 0x10, t4, bigchunk_fault) \ |
| 87 | ldd [%src + (offset) + 0x18], %t6; \ | 87 | LD(ldd, src, offset + 0x18, t6, bigchunk_fault) \ |
| 88 | std %t0, [%dst + (offset) + 0x00]; \ | 88 | ST(std, dst, offset + 0x00, t0, bigchunk_fault) \ |
| 89 | std %t2, [%dst + (offset) + 0x08]; \ | 89 | ST(std, dst, offset + 0x08, t2, bigchunk_fault) \ |
| 90 | std %t4, [%dst + (offset) + 0x10]; \ | 90 | ST(std, dst, offset + 0x10, t4, bigchunk_fault) \ |
| 91 | std %t6, [%dst + (offset) + 0x18]; | 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 | #define MOVE_LASTCHUNK(src, dst, offset, t0, t1, t2, t3) \ | 101 | #define MOVE_LASTCHUNK(src, dst, offset, t0, t1, t2, t3) \ |
| 94 | ldd [%src - (offset) - 0x10], %t0; \ | 102 | LD(ldd, src, -(offset + 0x10), t0, lastchunk_fault) \ |
| 95 | ldd [%src - (offset) - 0x08], %t2; \ | 103 | LD(ldd, src, -(offset + 0x08), t2, lastchunk_fault) \ |
| 96 | st %t0, [%dst - (offset) - 0x10]; \ | 104 | ST(st, dst, -(offset + 0x10), t0, lastchunk_fault) \ |
| 97 | st %t1, [%dst - (offset) - 0x0c]; \ | 105 | ST(st, dst, -(offset + 0x0c), t1, lastchunk_fault) \ |
| 98 | st %t2, [%dst - (offset) - 0x08]; \ | 106 | ST(st, dst, -(offset + 0x08), t2, lastchunk_fault) \ |
| 99 | st %t3, [%dst - (offset) - 0x04]; | 107 | ST(st, dst, -(offset + 0x04), t3, lastchunk_fault) |
| 100 | 108 | ||
| 101 | #define MOVE_HALFCHUNK(src, dst, offset, t0, t1, t2, t3) \ | 109 | .section .fixup,#alloc,#execinstr |
| 102 | lduh [%src + (offset) + 0x00], %t0; \ | 110 | lastchunk_fault: |
| 103 | lduh [%src + (offset) + 0x02], %t1; \ | 111 | and %g1, 15, %g1 |
| 104 | lduh [%src + (offset) + 0x04], %t2; \ | 112 | retl |
| 105 | lduh [%src + (offset) + 0x06], %t3; \ | 113 | sub %g1, %g5, %o0 |
| 106 | sth %t0, [%dst + (offset) + 0x00]; \ | ||
| 107 | sth %t1, [%dst + (offset) + 0x02]; \ | ||
| 108 | sth %t2, [%dst + (offset) + 0x04]; \ | ||
| 109 | sth %t3, [%dst + (offset) + 0x06]; | ||
| 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 | #define MOVE_SHORTCHUNK(src, dst, offset, t0, t1) \ | 127 | #define MOVE_SHORTCHUNK(src, dst, offset, t0, t1) \ |
| 112 | ldub [%src - (offset) - 0x02], %t0; \ | 128 | LD(ldub, src, -(offset + 0x02), t0, halfchunk_fault) \ |
| 113 | ldub [%src - (offset) - 0x01], %t1; \ | 129 | LD(ldub, src, -(offset + 0x01), t1, halfchunk_fault) \ |
| 114 | stb %t0, [%dst - (offset) - 0x02]; \ | 130 | ST(stb, dst, -(offset + 0x02), t0, halfchunk_fault) \ |
| 115 | stb %t1, [%dst - (offset) - 0x01]; | 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 | .text | 153 | .text |
| 118 | .align 4 | 154 | .align 4 |
| @@ -182,8 +218,6 @@ __copy_user: /* %o0=dst %o1=src %o2=len */ · 63 unmodified lines | |||
| 182 | MOVE_BIGCHUNK(o1, o0, 0x20, o2, o3, o4, o5, g2, g3, g4, g5) | 218 | MOVE_BIGCHUNK(o1, o0, 0x20, o2, o3, o4, o5, g2, g3, g4, g5) |
| 183 | MOVE_BIGCHUNK(o1, o0, 0x40, o2, o3, o4, o5, g2, g3, g4, g5) | 219 | MOVE_BIGCHUNK(o1, o0, 0x40, o2, o3, o4, o5, g2, g3, g4, g5) |
| 184 | MOVE_BIGCHUNK(o1, o0, 0x60, o2, o3, o4, o5, g2, g3, g4, g5) | 220 | MOVE_BIGCHUNK(o1, o0, 0x60, o2, o3, o4, o5, g2, g3, g4, g5) |
| 185 | 80: | ||
| 186 | EXT(5b, 80b, 50f) | ||
| 187 | subcc %g7, 128, %g7 | 221 | subcc %g7, 128, %g7 |
| 188 | add %o1, 128, %o1 | 222 | add %o1, 128, %o1 |
| 189 | bne 5b | 223 | bne 5b |
| @@ -201,7 +235,6 @@ __copy_user: /* %o0=dst %o1=src %o2=len */ · 11 unmodified lines | |||
| 201 | jmpl %o5 + %lo(copy_user_table_end), %g0 | 235 | jmpl %o5 + %lo(copy_user_table_end), %g0 |
| 202 | add %o0, %g7, %o0 | 236 | add %o0, %g7, %o0 |
| 203 | 237 | ||
| 204 | copy_user_table: | ||
| 205 | MOVE_LASTCHUNK(o1, o0, 0x60, g2, g3, g4, g5) | 238 | MOVE_LASTCHUNK(o1, o0, 0x60, g2, g3, g4, g5) |
| 206 | MOVE_LASTCHUNK(o1, o0, 0x50, g2, g3, g4, g5) | 239 | MOVE_LASTCHUNK(o1, o0, 0x50, g2, g3, g4, g5) |
| 207 | MOVE_LASTCHUNK(o1, o0, 0x40, g2, g3, g4, g5) | 240 | MOVE_LASTCHUNK(o1, o0, 0x40, g2, g3, g4, g5) |
| @@ -210,7 +243,6 @@ copy_user_table: · 2 unmodified lines | |||
| 210 | MOVE_LASTCHUNK(o1, o0, 0x10, g2, g3, g4, g5) | 243 | MOVE_LASTCHUNK(o1, o0, 0x10, g2, g3, g4, g5) |
| 211 | MOVE_LASTCHUNK(o1, o0, 0x00, g2, g3, g4, g5) | 244 | MOVE_LASTCHUNK(o1, o0, 0x00, g2, g3, g4, g5) |
| 212 | copy_user_table_end: | 245 | copy_user_table_end: |
| 213 | EXT(copy_user_table, copy_user_table_end, 51f) | ||
| 214 | be copy_user_last7 | 246 | be copy_user_last7 |
| 215 | andcc %g1, 4, %g0 | 247 | andcc %g1, 4, %g0 |
| 216 | 248 | ||
| @@ -250,8 +282,6 @@ ldd_std: · 33 unmodified lines | |||
| 250 | MOVE_BIGALIGNCHUNK(o1, o0, 0x20, o2, o3, o4, o5, g2, g3, g4, g5) | 282 | MOVE_BIGALIGNCHUNK(o1, o0, 0x20, o2, o3, o4, o5, g2, g3, g4, g5) |
| 251 | MOVE_BIGALIGNCHUNK(o1, o0, 0x40, o2, o3, o4, o5, g2, g3, g4, g5) | 283 | MOVE_BIGALIGNCHUNK(o1, o0, 0x40, o2, o3, o4, o5, g2, g3, g4, g5) |
| 252 | MOVE_BIGALIGNCHUNK(o1, o0, 0x60, o2, o3, o4, o5, g2, g3, g4, g5) | 284 | MOVE_BIGALIGNCHUNK(o1, o0, 0x60, o2, o3, o4, o5, g2, g3, g4, g5) |
| 253 | 81: | ||
| 254 | EXT(ldd_std, 81b, 52f) | ||
| 255 | subcc %g7, 128, %g7 | 285 | subcc %g7, 128, %g7 |
| 256 | add %o1, 128, %o1 | 286 | add %o1, 128, %o1 |
| 257 | bne ldd_std | 287 | bne ldd_std |
| @@ -290,8 +320,6 @@ cannot_optimize: · 32 unmodified lines | |||
| 290 | 10: | 320 | 10: |
| 291 | MOVE_HALFCHUNK(o1, o0, 0x00, g2, g3, g4, g5) | 321 | MOVE_HALFCHUNK(o1, o0, 0x00, g2, g3, g4, g5) |
| 292 | MOVE_HALFCHUNK(o1, o0, 0x08, g2, g3, g4, g5) | 322 | MOVE_HALFCHUNK(o1, o0, 0x08, g2, g3, g4, g5) |
| 293 | 82: | ||
| 294 | EXT(10b, 82b, 53f) | ||
| 295 | subcc %o3, 0x10, %o3 | 323 | subcc %o3, 0x10, %o3 |
| 296 | add %o1, 0x10, %o1 | 324 | add %o1, 0x10, %o1 |
| 297 | bne 10b | 325 | bne 10b |
| @@ -308,8 +336,6 @@ byte_chunk: · 10 unmodified lines | |||
| 308 | MOVE_SHORTCHUNK(o1, o0, -0x0c, g2, g3) | 336 | MOVE_SHORTCHUNK(o1, o0, -0x0c, g2, g3) |
| 309 | MOVE_SHORTCHUNK(o1, o0, -0x0e, g2, g3) | 337 | MOVE_SHORTCHUNK(o1, o0, -0x0e, g2, g3) |
| 310 | MOVE_SHORTCHUNK(o1, o0, -0x10, g2, g3) | 338 | MOVE_SHORTCHUNK(o1, o0, -0x10, g2, g3) |
| 311 | 83: | ||
| 312 | EXT(byte_chunk, 83b, 54f) | ||
| 313 | subcc %o3, 0x10, %o3 | 339 | subcc %o3, 0x10, %o3 |
| 314 | add %o1, 0x10, %o1 | 340 | add %o1, 0x10, %o1 |
| 315 | bne byte_chunk | 341 | bne byte_chunk |
| @@ -325,16 +351,14 @@ short_end: · 9 unmodified lines | |||
| 325 | add %o1, %o3, %o1 | 351 | add %o1, %o3, %o1 |
| 326 | jmpl %o5 + %lo(short_table_end), %g0 | 352 | jmpl %o5 + %lo(short_table_end), %g0 |
| 327 | andcc %o2, 1, %g0 | 353 | andcc %o2, 1, %g0 |
| 328 | 84: | 354 | MOVE_LAST_SHORTCHUNK(o1, o0, 0x0c, g2, g3) |
| 329 | MOVE_SHORTCHUNK(o1, o0, 0x0c, g2, g3) | 355 | MOVE_LAST_SHORTCHUNK(o1, o0, 0x0a, g2, g3) |
| 330 | MOVE_SHORTCHUNK(o1, o0, 0x0a, g2, g3) | 356 | MOVE_LAST_SHORTCHUNK(o1, o0, 0x08, g2, g3) |
| 331 | MOVE_SHORTCHUNK(o1, o0, 0x08, g2, g3) | 357 | MOVE_LAST_SHORTCHUNK(o1, o0, 0x06, g2, g3) |
| 332 | MOVE_SHORTCHUNK(o1, o0, 0x06, g2, g3) | 358 | MOVE_LAST_SHORTCHUNK(o1, o0, 0x04, g2, g3) |
| 333 | MOVE_SHORTCHUNK(o1, o0, 0x04, g2, g3) | 359 | MOVE_LAST_SHORTCHUNK(o1, o0, 0x02, g2, g3) |
| 334 | MOVE_SHORTCHUNK(o1, o0, 0x02, g2, g3) | 360 | MOVE_LAST_SHORTCHUNK(o1, o0, 0x00, g2, g3) |
| 335 | MOVE_SHORTCHUNK(o1, o0, 0x00, g2, g3) | ||
| 336 | short_table_end: | 361 | short_table_end: |
| 337 | EXT(84b, short_table_end, 55f) | ||
| 338 | be 1f | 362 | be 1f |
| 339 | nop | 363 | nop |
| 340 | EX(ldub [%o1], %g2, add %g0, 1) | 364 | EX(ldub [%o1], %g2, add %g0, 1) |
| @@ -363,123 +387,8 @@ short_aligned_end: · 22 unmodified lines | |||
| 363 | .section .fixup,#alloc,#execinstr | 387 | .section .fixup,#alloc,#execinstr |
| 364 | .align 4 | 388 | .align 4 |
| 365 | 97: | 389 | 97: |
| 366 | mov %o2, %g3 | ||
| 367 | fixupretl: | ||
| 368 | retl | 390 | retl |
| 369 | mov %g3, %o0 | 391 | mov %o2, %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 | ||
| 483 | 392 | ||
| 484 | .globl __copy_user_end | 393 | .globl __copy_user_end |
| 485 | __copy_user_end: | 394 | __copy_user_end: |
| @@ -19,7 +19,7 @@ · 18 unmodified lines | |||
| 19 | 98: x,y; \ | 19 | 98: x,y; \ |
| 20 | .section .fixup,ALLOC,EXECINSTR; \ | 20 | .section .fixup,ALLOC,EXECINSTR; \ |
| 21 | .align 4; \ | 21 | .align 4; \ |
| 22 | 99: ba 30f; \ | 22 | 99: retl; \ |
| 23 | a, b, %o0; \ | 23 | a, b, %o0; \ |
| 24 | .section __ex_table,ALLOC; \ | 24 | .section __ex_table,ALLOC; \ |
| 25 | .align 4; \ | 25 | .align 4; \ |
| @@ -27,35 +27,44 @@ · 1 unmodified line | |||
| 27 | .text; \ | 27 | .text; \ |
| 28 | .align 4 | 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 | .section __ex_table,ALLOC; \ | 36 | .section __ex_table,ALLOC; \ |
| 32 | .align 4; \ | 37 | .align 4; \ |
| 33 | .word start, 0, end, handler; \ | 38 | .word 98b, 99b; \ |
| 34 | .text; \ | 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 | /* Please don't change these macros, unless you change the logic | 46 | /* Please don't change these macros, unless you change the logic |
| 38 | * in the .fixup section below as well. | 47 | * in the .fixup section below as well. |
| 39 | * Store 64 bytes at (BASE + OFFSET) using value SOURCE. */ | 48 | * Store 64 bytes at (BASE + OFFSET) using value SOURCE. */ |
| 40 | #define ZERO_BIG_BLOCK(base, offset, source) \ | 49 | #define ZERO_BIG_BLOCK(base, offset, source) \ |
| 41 | std source, [base + offset + 0x00]; \ | 50 | STORE(source, base, offset, 0x00); \ |
| 42 | std source, [base + offset + 0x08]; \ | 51 | STORE(source, base, offset, 0x08); \ |
| 43 | std source, [base + offset + 0x10]; \ | 52 | STORE(source, base, offset, 0x10); \ |
| 44 | std source, [base + offset + 0x18]; \ | 53 | STORE(source, base, offset, 0x18); \ |
| 45 | std source, [base + offset + 0x20]; \ | 54 | STORE(source, base, offset, 0x20); \ |
| 46 | std source, [base + offset + 0x28]; \ | 55 | STORE(source, base, offset, 0x28); \ |
| 47 | std source, [base + offset + 0x30]; \ | 56 | STORE(source, base, offset, 0x30); \ |
| 48 | std source, [base + offset + 0x38]; | 57 | STORE(source, base, offset, 0x38); |
| 49 | 58 | ||
| 50 | #define ZERO_LAST_BLOCKS(base, offset, source) \ | 59 | #define ZERO_LAST_BLOCKS(base, offset, source) \ |
| 51 | std source, [base - offset - 0x38]; \ | 60 | STORE_LAST(source, base, offset, 0x38); \ |
| 52 | std source, [base - offset - 0x30]; \ | 61 | STORE_LAST(source, base, offset, 0x30); \ |
| 53 | std source, [base - offset - 0x28]; \ | 62 | STORE_LAST(source, base, offset, 0x28); \ |
| 54 | std source, [base - offset - 0x20]; \ | 63 | STORE_LAST(source, base, offset, 0x20); \ |
| 55 | std source, [base - offset - 0x18]; \ | 64 | STORE_LAST(source, base, offset, 0x18); \ |
| 56 | std source, [base - offset - 0x10]; \ | 65 | STORE_LAST(source, base, offset, 0x10); \ |
| 57 | std source, [base - offset - 0x08]; \ | 66 | STORE_LAST(source, base, offset, 0x08); \ |
| 58 | std source, [base - offset - 0x00]; | 67 | STORE_LAST(source, base, offset, 0x00); |
| 59 | 68 | ||
| 60 | .text | 69 | .text |
| 61 | .align 4 | 70 | .align 4 |
| @@ -68,8 +77,6 @@ __bzero_begin: · 6 unmodified lines | |||
| 68 | .globl memset | 77 | .globl memset |
| 69 | EXPORT_SYMBOL(__bzero) | 78 | EXPORT_SYMBOL(__bzero) |
| 70 | EXPORT_SYMBOL(memset) | 79 | EXPORT_SYMBOL(memset) |
| 71 | .globl __memset_start, __memset_end | ||
| 72 | __memset_start: | ||
| 73 | memset: | 80 | memset: |
| 74 | mov %o0, %g1 | 81 | mov %o0, %g1 |
| 75 | mov 1, %g4 | 82 | mov 1, %g4 |
| @@ -122,8 +129,6 @@ __bzero: · 46 unmodified lines | |||
| 122 | ZERO_BIG_BLOCK(%o0, 0x00, %g2) | 129 | ZERO_BIG_BLOCK(%o0, 0x00, %g2) |
| 123 | subcc %o3, 128, %o3 | 130 | subcc %o3, 128, %o3 |
| 124 | ZERO_BIG_BLOCK(%o0, 0x40, %g2) | 131 | ZERO_BIG_BLOCK(%o0, 0x40, %g2) |
| 125 | 11: | ||
| 126 | EXT(10b, 11b, 20f) | ||
| 127 | bne 10b | 132 | bne 10b |
| 128 | add %o0, 128, %o0 | 133 | add %o0, 128, %o0 |
| 129 | 134 | ||
| @@ -138,11 +143,9 @@ __bzero: · 8 unmodified lines | |||
| 138 | jmp %o4 | 143 | jmp %o4 |
| 139 | add %o0, %o2, %o0 | 144 | add %o0, %o2, %o0 |
| 140 | 145 | ||
| 141 | 12: | ||
| 142 | ZERO_LAST_BLOCKS(%o0, 0x48, %g2) | 146 | ZERO_LAST_BLOCKS(%o0, 0x48, %g2) |
| 143 | ZERO_LAST_BLOCKS(%o0, 0x08, %g2) | 147 | ZERO_LAST_BLOCKS(%o0, 0x08, %g2) |
| 144 | 13: | 148 | 13: |
| 145 | EXT(12b, 13b, 21f) | ||
| 146 | be 8f | 149 | be 8f |
| 147 | andcc %o1, 4, %g0 | 150 | andcc %o1, 4, %g0 |
| 148 | 151 | ||
| @@ -182,37 +185,13 @@ __bzero: · 33 unmodified lines | |||
| 182 | 5: | 185 | 5: |
| 183 | retl | 186 | retl |
| 184 | clr %o0 | 187 | clr %o0 |
| 185 | __memset_end: | ||
| 186 | 188 | ||
| 187 | .section .fixup,#alloc,#execinstr | 189 | .section .fixup,#alloc,#execinstr |
| 188 | .align 4 | 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 | 30: | 191 | 30: |
| 208 | /* %o4 is faulting address, %o5 is %pc where fault occurred */ | 192 | and %o1, 0x7f, %o1 |
| 209 | save %sp, -104, %sp | 193 | retl |
| 210 | mov %i5, %o0 | 194 | add %o3, %o1, %o0 |
| 211 | mov %i7, %o1 | ||
| 212 | call lookup_fault | ||
| 213 | mov %i4, %o2 | ||
| 214 | ret | ||
| 215 | restore | ||
| 216 | 195 | ||
| 217 | .globl __bzero_end | 196 | .globl __bzero_end |
| 218 | __bzero_end: | 197 | __bzero_end: |
| @@ -8,7 +8,7 @@ ccflags-y := -Werror · 7 unmodified lines | |||
| 8 | obj-$(CONFIG_SPARC64) += ultra.o tlb.o tsb.o | 8 | obj-$(CONFIG_SPARC64) += ultra.o tlb.o tsb.o |
| 9 | obj-y += fault_$(BITS).o | 9 | obj-y += fault_$(BITS).o |
| 10 | obj-y += init_$(BITS).o | 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 | obj-$(CONFIG_SPARC32) += srmmu_access.o | 12 | obj-$(CONFIG_SPARC32) += srmmu_access.o |
| 13 | obj-$(CONFIG_SPARC32) += hypersparc.o viking.o tsunami.o swift.o | 13 | obj-$(CONFIG_SPARC32) += hypersparc.o viking.o tsunami.o swift.o |
| 14 | obj-$(CONFIG_SPARC32) += leon_mm.o | 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 | #include <linux/interrupt.h> | 23 | #include <linux/interrupt.h> |
| 24 | #include <linux/kdebug.h> | 24 | #include <linux/kdebug.h> |
| 25 | #include <linux/uaccess.h> | 25 | #include <linux/uaccess.h> |
| 26 | #include <linux/extable.h> | ||
| 26 | 27 | ||
| 27 | #include <asm/page.h> | 28 | #include <asm/page.h> |
| 28 | #include <asm/openprom.h> | 29 | #include <asm/openprom.h> |
| @@ -54,54 +55,6 @@ static void __noreturn unhandled_fault(unsigned long address, · 25 unmodified lines | |||
| 54 | die_if_kernel("Oops", regs); | 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 | static inline void | 58 | static inline void |
| 106 | show_signal_msg(struct pt_regs *regs, int sig, int code, | 59 | show_signal_msg(struct pt_regs *regs, int sig, int code, |
| 107 | unsigned long address, struct task_struct *tsk) | 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 | struct vm_area_struct *vma; | 115 | struct vm_area_struct *vma; |
| 163 | struct task_struct *tsk = current; | 116 | struct task_struct *tsk = current; |
| 164 | struct mm_struct *mm = tsk->mm; | 117 | struct mm_struct *mm = tsk->mm; |
| 165 | unsigned int fixup; | ||
| 166 | unsigned long g2; | ||
| 167 | int from_user = !(regs->psr & PSR_PS); | 118 | int from_user = !(regs->psr & PSR_PS); |
| 168 | int code; | 119 | int code; |
| 169 | vm_fault_t fault; | 120 | vm_fault_t fault; |
| @@ -281,30 +232,19 @@ bad_area_nosemaphore: · 111 unmodified lines | |||
| 281 | 232 | ||
| 282 | /* Is this in ex_table? */ | 233 | /* Is this in ex_table? */ |
| 283 | no_context: | 234 | no_context: |
| 284 | g2 = regs->u_regs[UREG_G2]; | ||
| 285 | if (!from_user) { | 235 | if (!from_user) { |
| 286 | fixup = search_extables_range(regs->pc, &g2); | 236 | const struct exception_table_entry *entry; |
| 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[]; | ||
| 291 | 237 | ||
| 238 | entry = search_exception_tables(regs->pc); | ||
| 292 | #ifdef DEBUG_EXCEPTIONS | 239 | #ifdef DEBUG_EXCEPTIONS |
| 293 | printk("Exception: PC<%08lx> faddr<%08lx>\n", | 240 | printk("Exception: PC<%08lx> faddr<%08lx>\n", |
| 294 | regs->pc, address); | 241 | regs->pc, address); |
| 295 | printk("EX_TABLE: insn<%08lx> fixup<%08x> g2<%08lx>\n", | 242 | printk("EX_TABLE: insn<%08lx> fixup<%08x>\n", |
| 296 | regs->pc, fixup, g2); | 243 | regs->pc, entry->fixup); |
| 297 | #endif | 244 | #endif |
| 298 | if ((regs->pc >= (unsigned long)__memset_start && | 245 | regs->pc = entry->fixup; |
| 299 | regs->pc < (unsigned long)__memset_end)) { | 246 | regs->npc = regs->pc + 4; |
| 300 | regs->u_regs[UREG_I4] = address; | 247 | return; |
| 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 | } | ||
| 308 | } | 248 | } |
| 309 | 249 | ||
| 310 | unhandled_fault(address, tsk, regs); | 250 | unhandled_fault(address, tsk, regs); |
| @@ -1,7 +1,5 @@ | |||
| 1 | /* SPDX-License-Identifier: GPL-2.0 */ | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | /* fault_32.c - visible as they are called from assembler */ | 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 | asmlinkage void do_sparc_fault(struct pt_regs *regs, int text_fault, int write, | 3 | asmlinkage void do_sparc_fault(struct pt_regs *regs, int text_fault, int write, |
| 6 | unsigned long address); | 4 | unsigned long address); |
| 7 | 5 | ||
| @@ -27,7 +27,7 @@ endif · 26 unmodified lines | |||
| 27 | REALMODE_CFLAGS := -m16 -g -Os -DDISABLE_BRANCH_PROFILING \ | 27 | REALMODE_CFLAGS := -m16 -g -Os -DDISABLE_BRANCH_PROFILING \ |
| 28 | -Wall -Wstrict-prototypes -march=i386 -mregparm=3 \ | 28 | -Wall -Wstrict-prototypes -march=i386 -mregparm=3 \ |
| 29 | -fno-strict-aliasing -fomit-frame-pointer -fno-pic \ | 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 | REALMODE_CFLAGS += -ffreestanding | 32 | REALMODE_CFLAGS += -ffreestanding |
| 33 | REALMODE_CFLAGS += -fno-stack-protector | 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 | regs->ax = -EFAULT; | 128 | regs->ax = -EFAULT; |
| 129 | 129 | ||
| 130 | instrumentation_end(); | 130 | instrumentation_end(); |
| 131 | syscall_exit_to_user_mode(regs); | 131 | local_irq_disable(); |
| 132 | irqentry_exit_to_user_mode(regs); | ||
| 132 | return false; | 133 | return false; |
| 133 | } | 134 | } |
| 134 | 135 | ||
| @@ -210,6 +210,8 @@ SYM_CODE_START(entry_SYSCALL_compat) · 209 unmodified lines | |||
| 210 | /* Switch to the kernel stack */ | 210 | /* Switch to the kernel stack */ |
| 211 | movq PER_CPU_VAR(cpu_current_top_of_stack), %rsp | 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 | /* Construct struct pt_regs on stack */ | 215 | /* Construct struct pt_regs on stack */ |
| 214 | pushq $__USER32_DS /* pt_regs->ss */ | 216 | pushq $__USER32_DS /* pt_regs->ss */ |
| 215 | pushq %r8 /* pt_regs->sp */ | 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 | DEFINE_STATIC_CALL_NULL(x86_pmu_drain_pebs, *x86_pmu.drain_pebs); | 81 | DEFINE_STATIC_CALL_NULL(x86_pmu_drain_pebs, *x86_pmu.drain_pebs); |
| 82 | DEFINE_STATIC_CALL_NULL(x86_pmu_pebs_aliases, *x86_pmu.pebs_aliases); | 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 | u64 __read_mostly hw_cache_event_ids | 90 | u64 __read_mostly hw_cache_event_ids |
| 87 | [PERF_COUNT_HW_CACHE_MAX] | 91 | [PERF_COUNT_HW_CACHE_MAX] |
| @@ -1944,13 +1948,6 @@ static void _x86_pmu_read(struct perf_event *event) · 1856 unmodified lines | |||
| 1944 | x86_perf_event_update(event); | 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 | static int __init init_hw_perf_events(void) | 1951 | static int __init init_hw_perf_events(void) |
| 1955 | { | 1952 | { |
| 1956 | struct x86_pmu_quirk *quirk; | 1953 | struct x86_pmu_quirk *quirk; |
| @@ -2025,7 +2022,7 @@ static int __init init_hw_perf_events(void) · 68 unmodified lines | |||
| 2025 | x86_pmu.read = _x86_pmu_read; | 2022 | x86_pmu.read = _x86_pmu_read; |
| 2026 | 2023 | ||
| 2027 | if (!x86_pmu.guest_get_msrs) | 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 | x86_pmu_static_call_update(); | 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 | return ret; | 3659 | return ret; |
| 3660 | 3660 | ||
| 3661 | if (event->attr.precise_ip) { | 3661 | if (event->attr.precise_ip) { |
| 3662 | if ((event->attr.config & INTEL_ARCH_EVENT_MASK) == INTEL_FIXED_VLBR_EVENT) | ||
| 3663 | return -EINVAL; | ||
| 3664 | |||
| 3662 | if (!(event->attr.freq || (event->attr.wakeup_events && !event->attr.watermark))) { | 3665 | if (!(event->attr.freq || (event->attr.wakeup_events && !event->attr.watermark))) { |
| 3663 | event->hw.flags |= PERF_X86_EVENT_AUTO_RELOAD; | 3666 | event->hw.flags |= PERF_X86_EVENT_AUTO_RELOAD; |
| 3664 | if (!(event->attr.sample_type & | 3667 | if (!(event->attr.sample_type & |
| 3665 | ~intel_pmu_large_pebs_flags(event))) | 3668 | ~intel_pmu_large_pebs_flags(event))) { |
| 3666 | event->hw.flags |= PERF_X86_EVENT_LARGE_PEBS; | 3669 | event->hw.flags |= PERF_X86_EVENT_LARGE_PEBS; |
| 3670 | event->attach_state |= PERF_ATTACH_SCHED_CB; | ||
| 3671 | } | ||
| 3667 | } | 3672 | } |
| 3668 | if (x86_pmu.pebs_aliases) | 3673 | if (x86_pmu.pebs_aliases) |
| 3669 | x86_pmu.pebs_aliases(event); | 3674 | x86_pmu.pebs_aliases(event); |
| @@ -3676,6 +3681,7 @@ static int intel_pmu_hw_config(struct perf_event *event) · 6 unmodified lines | |||
| 3676 | ret = intel_pmu_setup_lbr_filter(event); | 3681 | ret = intel_pmu_setup_lbr_filter(event); |
| 3677 | if (ret) | 3682 | if (ret) |
| 3678 | return ret; | 3683 | return ret; |
| 3684 | event->attach_state |= PERF_ATTACH_SCHED_CB; | ||
| 3679 | 3685 | ||
| 3680 | /* | 3686 | /* |
| 3681 | * BTS is set up earlier in this path, so don't account twice | 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 | if (!pebs_status && cpuc->pebs_enabled && | 2011 | if (!pebs_status && cpuc->pebs_enabled && |
| 2012 | !(cpuc->pebs_enabled & (cpuc->pebs_enabled-1))) | 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 | bit = find_first_bit((unsigned long *)&pebs_status, | 2015 | bit = find_first_bit((unsigned long *)&pebs_status, |
| 2016 | x86_pmu.max_pebs_events); | 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 | int insn_get_code_seg_params(struct pt_regs *regs); | 23 | int insn_get_code_seg_params(struct pt_regs *regs); |
| 24 | int insn_fetch_from_user(struct pt_regs *regs, | 24 | int insn_fetch_from_user(struct pt_regs *regs, |
| 25 | unsigned char buf[MAX_INSN_SIZE]); | 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 | bool insn_decode(struct insn *insn, struct pt_regs *regs, | 28 | bool insn_decode(struct insn *insn, struct pt_regs *regs, |
| 27 | unsigned char buf[MAX_INSN_SIZE], int buf_size); | 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 | else | 56 | else |
| 57 | set_pte(pte, __pte(pte_val(*pte) | _PAGE_PRESENT)); | 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 | flush_tlb_one_kernel(addr); | 64 | flush_tlb_one_kernel(addr); |
| 65 | preempt_enable(); | ||
| 61 | return true; | 66 | return true; |
| 62 | } | 67 | } |
| 63 | 68 | ||
| @@ -884,12 +884,29 @@ struct kvm_hv_syndbg { · 883 unmodified lines | |||
| 884 | u64 options; | 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 | /* Hyper-V emulation context */ | 903 | /* Hyper-V emulation context */ |
| 888 | struct kvm_hv { | 904 | struct kvm_hv { |
| 889 | struct mutex hv_lock; | 905 | struct mutex hv_lock; |
| 890 | u64 hv_guest_os_id; | 906 | u64 hv_guest_os_id; |
| 891 | u64 hv_hypercall; | 907 | u64 hv_hypercall; |
| 892 | u64 hv_tsc_page; | 908 | u64 hv_tsc_page; |
| 909 | enum hv_tsc_page_status hv_tsc_page_status; | ||
| 893 | 910 | ||
| 894 | /* Hyper-v based guest crash (NT kernel bugcheck) parameters */ | 911 | /* Hyper-v based guest crash (NT kernel bugcheck) parameters */ |
| 895 | u64 hv_crash_param[HV_X64_MSR_CRASH_PARAMS]; | 912 | u64 hv_crash_param[HV_X64_MSR_CRASH_PARAMS]; |
| @@ -931,6 +948,12 @@ enum kvm_irqchip_mode { · 35 unmodified lines | |||
| 931 | KVM_IRQCHIP_SPLIT, /* created with KVM_CAP_SPLIT_IRQCHIP */ | 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 | #define APICV_INHIBIT_REASON_DISABLE 0 | 957 | #define APICV_INHIBIT_REASON_DISABLE 0 |
| 935 | #define APICV_INHIBIT_REASON_HYPERV 1 | 958 | #define APICV_INHIBIT_REASON_HYPERV 1 |
| 936 | #define APICV_INHIBIT_REASON_NESTED 2 | 959 | #define APICV_INHIBIT_REASON_NESTED 2 |
| @@ -963,7 +986,7 @@ struct kvm_arch { · 26 unmodified lines | |||
| 963 | struct kvm_pit *vpit; | 986 | struct kvm_pit *vpit; |
| 964 | atomic_t vapics_in_nmi_mode; | 987 | atomic_t vapics_in_nmi_mode; |
| 965 | struct mutex apic_map_lock; | 988 | struct mutex apic_map_lock; |
| 966 | struct kvm_apic_map *apic_map; | 989 | struct kvm_apic_map __rcu *apic_map; |
| 967 | atomic_t apic_map_dirty; | 990 | atomic_t apic_map_dirty; |
| 968 | 991 | ||
| 969 | bool apic_access_page_done; | 992 | bool apic_access_page_done; |
| @@ -1025,18 +1048,13 @@ struct kvm_arch { · 55 unmodified lines | |||
| 1025 | bool guest_can_read_msr_platform_info; | 1048 | bool guest_can_read_msr_platform_info; |
| 1026 | bool exception_payload_enabled; | 1049 | bool exception_payload_enabled; |
| 1027 | 1050 | ||
| 1051 | bool bus_lock_detection_enabled; | ||
| 1052 | |||
| 1028 | /* Deflect RDMSR and WRMSR to user space when they trigger a #GP */ | 1053 | /* Deflect RDMSR and WRMSR to user space when they trigger a #GP */ |
| 1029 | u32 user_space_msr_mask; | 1054 | u32 user_space_msr_mask; |
| 1055 | struct kvm_x86_msr_filter __rcu *msr_filter; | ||
| 1030 | 1056 | ||
| 1031 | struct { | 1057 | struct kvm_pmu_event_filter __rcu *pmu_event_filter; |
| 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; | ||
| 1040 | struct task_struct *nx_lpage_recovery_thread; | 1058 | struct task_struct *nx_lpage_recovery_thread; |
| 1041 | 1059 | ||
| 1042 | #ifdef CONFIG_X86_64 | 1060 | #ifdef CONFIG_X86_64 |
| @@ -551,15 +551,6 @@ static inline void arch_thread_struct_whitelist(unsigned long *offset, · 550 unmodified lines | |||
| 551 | *size = fpu_kernel_xstate_size; | 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 | static inline void | 554 | static inline void |
| 564 | native_load_sp0(unsigned long sp0) | 555 | native_load_sp0(unsigned long sp0) |
| 565 | { | 556 | { |
| @@ -25,6 +25,7 @@ void __end_SYSENTER_singlestep_region(void); · 24 unmodified lines | |||
| 25 | void entry_SYSENTER_compat(void); | 25 | void entry_SYSENTER_compat(void); |
| 26 | void __end_entry_SYSENTER_compat(void); | 26 | void __end_entry_SYSENTER_compat(void); |
| 27 | void entry_SYSCALL_compat(void); | 27 | void entry_SYSCALL_compat(void); |
| 28 | void entry_SYSCALL_compat_safe_stack(void); | ||
| 28 | void entry_INT80_compat(void); | 29 | void entry_INT80_compat(void); |
| 29 | #ifdef CONFIG_XEN_PV | 30 | #ifdef CONFIG_XEN_PV |
| 30 | void xen_entry_INT80_compat(void); | 31 | void xen_entry_INT80_compat(void); |
| @@ -94,6 +94,8 @@ struct pt_regs { · 93 unmodified lines | |||
| 94 | #include <asm/paravirt_types.h> | 94 | #include <asm/paravirt_types.h> |
| 95 | #endif | 95 | #endif |
| 96 | 96 | ||
| 97 | #include <asm/proto.h> | ||
| 98 | |||
| 97 | struct cpuinfo_x86; | 99 | struct cpuinfo_x86; |
| 98 | struct task_struct; | 100 | struct task_struct; |
| 99 | 101 | ||
| @@ -175,6 +177,19 @@ static inline bool any_64bit_mode(struct pt_regs *regs) · 75 unmodified lines | |||
| 175 | #ifdef CONFIG_X86_64 | 177 | #ifdef CONFIG_X86_64 |
| 176 | #define current_user_stack_pointer() current_pt_regs()->sp | 178 | #define current_user_stack_pointer() current_pt_regs()->sp |
| 177 | #define compat_user_stack_pointer() current_pt_regs()->sp | 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 | #endif | 193 | #endif |
| 179 | 194 | ||
| 180 | static inline unsigned long kernel_stack_pointer(struct pt_regs *regs) | 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 | unsigned long flags; | 58 | unsigned long flags; |
| 59 | 59 | ||
| 60 | asm volatile ("# smap_save\n\t" | 60 | asm volatile ("# smap_save\n\t" |
| 61 | ALTERNATIVE("jmp 1f", "", X86_FEATURE_SMAP) | 61 | ALTERNATIVE("", "pushf; pop %0; " __ASM_CLAC "\n\t", |
| 62 | "pushf; pop %0; " __ASM_CLAC "\n\t" | 62 | X86_FEATURE_SMAP) |
| 63 | "1:" | ||
| 64 | : "=rm" (flags) : : "memory", "cc"); | 63 | : "=rm" (flags) : : "memory", "cc"); |
| 65 | 64 | ||
| 66 | return flags; | 65 | return flags; |
| @@ -69,9 +68,8 @@ static __always_inline unsigned long smap_save(void) · 2 unmodified lines | |||
| 69 | static __always_inline void smap_restore(unsigned long flags) | 68 | static __always_inline void smap_restore(unsigned long flags) |
| 70 | { | 69 | { |
| 71 | asm volatile ("# smap_restore\n\t" | 70 | asm volatile ("# smap_restore\n\t" |
| 72 | ALTERNATIVE("jmp 1f", "", X86_FEATURE_SMAP) | 71 | ALTERNATIVE("", "push %0; popf\n\t", |
| 73 | "push %0; popf\n\t" | 72 | X86_FEATURE_SMAP) |
| 74 | "1:" | ||
| 75 | : : "g" (flags) : "memory", "cc"); | 73 | : : "g" (flags) : "memory", "cc"); |
| 76 | } | 74 | } |
| 77 | 75 | ||
| @@ -132,6 +132,7 @@ void native_play_dead(void); · 131 unmodified lines | |||
| 132 | void play_dead_common(void); | 132 | void play_dead_common(void); |
| 133 | void wbinvd_on_cpu(int cpu); | 133 | void wbinvd_on_cpu(int cpu); |
| 134 | int wbinvd_on_all_cpus(void); | 134 | int wbinvd_on_all_cpus(void); |
| 135 | void cond_wakeup_cpu0(void); | ||
| 135 | 136 | ||
| 136 | void native_smp_send_reschedule(int cpu); | 137 | void native_smp_send_reschedule(int cpu); |
| 137 | void native_send_call_func_ipi(const struct cpumask *mask); | 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 | #endif | 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 | #ifdef CONFIG_COMPAT | 218 | #ifdef CONFIG_COMPAT |
| 209 | #define TS_I386_REGS_POKED 0x0004 /* regs poked by 32-bit ptracer */ | 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 | #endif | 224 | #endif |
| 211 | #ifndef __ASSEMBLY__ | ||
| 212 | 225 | ||
| 213 | #ifdef CONFIG_X86_32 | 226 | #ifdef CONFIG_X86_32 |
| 214 | #define in_ia32_syscall() true | 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 | #endif | 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 | * Helper functions to write or read unsigned long values to/from | 90 | * Helper functions to write or read unsigned long values to/from |
| 103 | * memory, when the access may fault. | 91 | * memory, when the access may fault. |
| @@ -1554,10 +1554,18 @@ void __init acpi_boot_table_init(void) · 1553 unmodified lines | |||
| 1554 | /* | 1554 | /* |
| 1555 | * Initialize the ACPI boot-time table parser. | 1555 | * Initialize the ACPI boot-time table parser. |
| 1556 | */ | 1556 | */ |
| 1557 | if (acpi_table_init()) { | 1557 | if (acpi_locate_initial_tables()) |
| 1558 | disable_acpi(); | 1558 | disable_acpi(); |
| 1559 | return; | 1559 | else |
| 1560 | } | 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 | acpi_table_parse(ACPI_SIG_BOOT, acpi_parse_sbf); | 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 | } else { | 1578 | } else { |
| 1571 | printk(KERN_WARNING PREFIX "Disabling ACPI support\n"); | 1579 | printk(KERN_WARNING PREFIX "Disabling ACPI support\n"); |
| 1572 | disable_acpi(); | 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 | * Process the Multiple APIC Description Table (MADT), if present | 1586 | * Process the Multiple APIC Description Table (MADT), if present |
| @@ -115,7 +115,7 @@ SYM_FUNC_START(do_suspend_lowlevel) · 114 unmodified lines | |||
| 115 | movq pt_regs_r14(%rax), %r14 | 115 | movq pt_regs_r14(%rax), %r14 |
| 116 | movq pt_regs_r15(%rax), %r15 | 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 | * The suspend path may have poisoned some areas deeper in the stack, | 120 | * The suspend path may have poisoned some areas deeper in the stack, |
| 121 | * which we now need to unpoison. | 121 | * which we now need to unpoison. |
| @@ -2342,6 +2342,11 @@ static int cpuid_to_apicid[] = { · 2341 unmodified lines | |||
| 2342 | [0 ... NR_CPUS - 1] = -1, | 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 | #ifdef CONFIG_SMP | 2350 | #ifdef CONFIG_SMP |
| 2346 | /** | 2351 | /** |
| 2347 | * apic_id_is_primary_thread - Check whether APIC ID belongs to a primary thread | 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 | if (idx >= 0 && test_bit(mp_irqs[idx].srcbus, mp_bus_not_pci)) { | 1032 | if (idx >= 0 && test_bit(mp_irqs[idx].srcbus, mp_bus_not_pci)) { |
| 1033 | irq = mp_irqs[idx].srcbusirq; | 1033 | irq = mp_irqs[idx].srcbusirq; |
| 1034 | legacy = mp_is_legacy_irq(irq); | 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 | mutex_lock(&ioapic_mutex); | 1047 | mutex_lock(&ioapic_mutex); |
| @@ -12,7 +12,7 @@ · 11 unmodified lines | |||
| 12 | 12 | ||
| 13 | #include "common.h" | 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 | void kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip, | 16 | void kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip, |
| 17 | struct ftrace_ops *ops, struct ftrace_regs *fregs) | 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 | static void kvm_wait(u8 *ptr, u8 val) | 837 | static void kvm_wait(u8 *ptr, u8 val) |
| 838 | { | 838 | { |
| 839 | unsigned long flags; | ||
| 840 | |||
| 841 | if (in_nmi()) | 839 | if (in_nmi()) |
| 842 | return; | 840 | return; |
| 843 | 841 | ||
| 844 | local_irq_save(flags); | ||
| 845 | |||
| 846 | if (READ_ONCE(*ptr) != val) | ||
| 847 | goto out; | ||
| 848 | |||
| 849 | /* | 842 | /* |
| 850 | * halt until it's our turn and kicked. Note that we do safe halt | 843 | * halt until it's our turn and kicked. Note that we do safe halt |
| 851 | * for irq enabled case to avoid hang when lock info is overwritten | 844 | * for irq enabled case to avoid hang when lock info is overwritten |
| 852 | * in irq spinlock slowpath and no spurious interrupt occur to save us. | 845 | * in irq spinlock slowpath and no spurious interrupt occur to save us. |
| 853 | */ | 846 | */ |
| 854 | if (arch_irqs_disabled_flags(flags)) | 847 | if (irqs_disabled()) { |
| 855 | halt(); | 848 | if (READ_ONCE(*ptr) == val) |
| 856 | else | 849 | halt(); |
| 857 | safe_halt(); | 850 | } else { |
| 851 | local_irq_disable(); | ||
| 858 | 852 | ||
| 859 | out: | 853 | if (READ_ONCE(*ptr) == val) |
| 860 | local_irq_restore(flags); | 854 | safe_halt(); |
| 855 | |||
| 856 | local_irq_enable(); | ||
| 857 | } | ||
| 861 | } | 858 | } |
| 862 | 859 | ||
| 863 | #ifdef CONFIG_X86_32 | 860 | #ifdef CONFIG_X86_32 |
| @@ -268,21 +268,20 @@ static void __init kvmclock_init_mem(void) · 267 unmodified lines | |||
| 268 | 268 | ||
| 269 | static int __init kvm_setup_vsyscall_timeinfo(void) | 269 | static int __init kvm_setup_vsyscall_timeinfo(void) |
| 270 | { | 270 | { |
| 271 | #ifdef CONFIG_X86_64 | 271 | kvmclock_init_mem(); |
| 272 | u8 flags; | ||
| 273 | 272 | ||
| 274 | if (!per_cpu(hv_clock_per_cpu, 0) || !kvmclock_vsyscall) | 273 | #ifdef CONFIG_X86_64 |
| 275 | return 0; | 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); | 277 | flags = pvclock_read_flags(&hv_clock_boot[0].pvti); |
| 278 | if (!(flags & PVCLOCK_TSC_STABLE_BIT)) | 278 | if (!(flags & PVCLOCK_TSC_STABLE_BIT)) |
| 279 | return 0; | 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 | #endif | 283 | #endif |
| 283 | 284 | ||
| 284 | kvmclock_init_mem(); | ||
| 285 | |||
| 286 | return 0; | 285 | return 0; |
| 287 | } | 286 | } |
| 288 | early_initcall(kvm_setup_vsyscall_timeinfo); | 287 | early_initcall(kvm_setup_vsyscall_timeinfo); |
| @@ -1129,6 +1129,8 @@ void __init setup_arch(char **cmdline_p) · 1128 unmodified lines | |||
| 1129 | reserve_initrd(); | 1129 | reserve_initrd(); |
| 1130 | 1130 | ||
| 1131 | acpi_table_upgrade(); | 1131 | acpi_table_upgrade(); |
| 1132 | /* Look for ACPI tables and reserve memory occupied by them. */ | ||
| 1133 | acpi_boot_table_init(); | ||
| 1132 | 1134 | ||
| 1133 | vsmp_init(); | 1135 | vsmp_init(); |
| 1134 | 1136 | ||
| @@ -1136,11 +1138,6 @@ void __init setup_arch(char **cmdline_p) · 1 unmodified line | |||
| 1136 | 1138 | ||
| 1137 | early_platform_quirks(); | 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 | early_acpi_boot_init(); | 1141 | early_acpi_boot_init(); |
| 1145 | 1142 | ||
| 1146 | initmem_init(); | 1143 | initmem_init(); |
| @@ -121,8 +121,18 @@ static void __init setup_vc_stacks(int cpu) · 120 unmodified lines | |||
| 121 | cea_set_pte((void *)vaddr, pa, PAGE_KERNEL); | 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 | return ((sp >= __this_cpu_ist_bottom_va(VC)) && (sp < __this_cpu_ist_top_va(VC))); | 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 | old_ist = __this_cpu_read(cpu_tss_rw.x86_tss.ist[IST_INDEX_VC]); | 154 | old_ist = __this_cpu_read(cpu_tss_rw.x86_tss.ist[IST_INDEX_VC]); |
| 145 | 155 | ||
| 146 | /* Make room on the IST stack */ | 156 | /* Make room on the IST stack */ |
| 147 | if (on_vc_stack(regs->sp)) | 157 | if (on_vc_stack(regs)) |
| 148 | new_ist = ALIGN_DOWN(regs->sp, 8) - sizeof(old_ist); | 158 | new_ist = ALIGN_DOWN(regs->sp, 8) - sizeof(old_ist); |
| 149 | else | 159 | else |
| 150 | new_ist = old_ist - sizeof(old_ist); | 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 | int res; | 258 | int res; |
| 249 | 259 | ||
| 250 | if (user_mode(ctxt->regs)) { | 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 | if (!res) { | 262 | if (!res) { |
| 253 | ctxt->fi.vector = X86_TRAP_PF; | 263 | ctxt->fi.vector = X86_TRAP_PF; |
| 254 | ctxt->fi.error_code = X86_PF_INSTR | X86_PF_USER; | 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 | DEFINE_IDTENTRY_VC_SAFE_STACK(exc_vmm_communication) | 1258 | DEFINE_IDTENTRY_VC_SAFE_STACK(exc_vmm_communication) |
| 1249 | { | 1259 | { |
| 1250 | struct sev_es_runtime_data *data = this_cpu_read(runtime_data); | 1260 | struct sev_es_runtime_data *data = this_cpu_read(runtime_data); |
| 1261 | irqentry_state_t irq_state; | ||
| 1251 | struct ghcb_state state; | 1262 | struct ghcb_state state; |
| 1252 | struct es_em_ctxt ctxt; | 1263 | struct es_em_ctxt ctxt; |
| 1253 | enum es_result result; | 1264 | enum es_result result; |
| 1254 | struct ghcb *ghcb; | 1265 | struct ghcb *ghcb; |
| 1255 | 1266 | ||
| 1256 | lockdep_assert_irqs_disabled(); | ||
| 1257 | |||
| 1258 | /* | 1267 | /* |
| 1259 | * Handle #DB before calling into !noinstr code to avoid recursive #DB. | 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 | return; | 1272 | return; |
| 1264 | } | 1273 | } |
| 1265 | 1274 | ||
| 1275 | irq_state = irqentry_nmi_enter(regs); | ||
| 1276 | lockdep_assert_irqs_disabled(); | ||
| 1266 | instrumentation_begin(); | 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 | out: | 1337 | out: |
| 1327 | instrumentation_end(); | 1338 | instrumentation_end(); |
| 1339 | irqentry_nmi_exit(regs, irq_state); | ||
| 1328 | 1340 | ||
| 1329 | return; | 1341 | return; |
| 1330 | 1342 | ||
| @@ -766,30 +766,8 @@ handle_signal(struct ksignal *ksig, struct pt_regs *regs) · 765 unmodified lines | |||
| 766 | 766 | ||
| 767 | static inline unsigned long get_nr_restart_syscall(const struct pt_regs *regs) | 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 | #ifdef CONFIG_IA32_EMULATION | 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 | return __NR_ia32_restart_syscall; | 771 | return __NR_ia32_restart_syscall; |
| 794 | #endif | 772 | #endif |
| 795 | #ifdef CONFIG_X86_X32_ABI | 773 | #ifdef CONFIG_X86_X32_ABI |
| @@ -1659,13 +1659,17 @@ void play_dead_common(void) · 1658 unmodified lines | |||
| 1659 | local_irq_disable(); | 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 | if (smp_processor_id() == 0 && enable_start_cpu0) | 1669 | if (smp_processor_id() == 0 && enable_start_cpu0) |
| 1665 | return true; | 1670 | start_cpu0(); |
| 1666 | |||
| 1667 | return false; | ||
| 1668 | } | 1671 | } |
| 1672 | EXPORT_SYMBOL_GPL(cond_wakeup_cpu0); | ||
| 1669 | 1673 | ||
| 1670 | /* | 1674 | /* |
| 1671 | * We need to flush the caches before going to sleep, lest we have | 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 | __monitor(mwait_ptr, 0, 0); | 1738 | __monitor(mwait_ptr, 0, 0); |
| 1735 | mb(); | 1739 | mb(); |
| 1736 | __mwait(eax, 0); | 1740 | __mwait(eax, 0); |
| 1737 | /* | 1741 | |
| 1738 | * If NMI wants to wake up CPU0, start CPU0. | 1742 | cond_wakeup_cpu0(); |
| 1739 | */ | ||
| 1740 | if (wakeup_cpu0()) | ||
| 1741 | start_cpu0(); | ||
| 1742 | } | 1743 | } |
| 1743 | } | 1744 | } |
| 1744 | 1745 | ||
| @@ -1749,11 +1750,8 @@ void hlt_play_dead(void) · 4 unmodified lines | |||
| 1749 | 1750 | ||
| 1750 | while (1) { | 1751 | while (1) { |
| 1751 | native_halt(); | 1752 | native_halt(); |
| 1752 | /* | 1753 | |
| 1753 | * If NMI wants to wake up CPU0, start CPU0. | 1754 | cond_wakeup_cpu0(); |
| 1754 | */ | ||
| 1755 | if (wakeup_cpu0()) | ||
| 1756 | start_cpu0(); | ||
| 1757 | } | 1755 | } |
| 1758 | } | 1756 | } |
| 1759 | 1757 | ||
| @@ -556,7 +556,7 @@ DEFINE_IDTENTRY_ERRORCODE(exc_general_protection) · 555 unmodified lines | |||
| 556 | tsk->thread.trap_nr = X86_TRAP_GP; | 556 | tsk->thread.trap_nr = X86_TRAP_GP; |
| 557 | 557 | ||
| 558 | if (fixup_vdso_exception(regs, X86_TRAP_GP, error_code, 0)) | 558 | if (fixup_vdso_exception(regs, X86_TRAP_GP, error_code, 0)) |
| 559 | return; | 559 | goto exit; |
| 560 | 560 | ||
| 561 | show_signal(tsk, SIGSEGV, "", desc, regs, error_code); | 561 | show_signal(tsk, SIGSEGV, "", desc, regs, error_code); |
| 562 | force_sig(SIGSEGV); | 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 | * In the SYSCALL entry path the RSP value comes from user-space - don't | 694 | * In the SYSCALL entry path the RSP value comes from user-space - don't |
| 695 | * trust it and switch to the current kernel stack | 695 | * trust it and switch to the current kernel stack |
| 696 | */ | 696 | */ |
| 697 | if (regs->ip >= (unsigned long)entry_SYSCALL_64 && | 697 | if (ip_within_syscall_gap(regs)) { |
| 698 | regs->ip < (unsigned long)entry_SYSCALL_64_safe_stack) { | ||
| 699 | sp = this_cpu_read(cpu_current_top_of_stack); | 698 | sp = this_cpu_read(cpu_current_top_of_stack); |
| 700 | goto sync; | 699 | goto sync; |
| 701 | } | 700 | } |
| @@ -1058,7 +1057,7 @@ static void math_error(struct pt_regs *regs, int trapnr) · 356 unmodified lines | |||
| 1058 | goto exit; | 1057 | goto exit; |
| 1059 | 1058 | ||
| 1060 | if (fixup_vdso_exception(regs, trapnr, 0, 0)) | 1059 | if (fixup_vdso_exception(regs, trapnr, 0, 0)) |
| 1061 | return; | 1060 | goto exit; |
| 1062 | 1061 | ||
| 1063 | force_sig_fault(SIGFPE, si_code, | 1062 | force_sig_fault(SIGFPE, si_code, |
| 1064 | (void __user *)uprobe_get_trap_addr(regs)); | 1063 | (void __user *)uprobe_get_trap_addr(regs)); |
| @@ -13,7 +13,7 @@ · 12 unmodified lines | |||
| 13 | 13 | ||
| 14 | #define orc_warn_current(args...) \ | 14 | #define orc_warn_current(args...) \ |
| 15 | ({ \ | 15 | ({ \ |
| 16 | if (state->task == current) \ | 16 | if (state->task == current && !state->error) \ |
| 17 | orc_warn(args); \ | 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 | if (!stack_access_ok(state, addr, sizeof(struct pt_regs))) | 367 | if (!stack_access_ok(state, addr, sizeof(struct pt_regs))) |
| 368 | return false; | 368 | return false; |
| 369 | 369 | ||
| 370 | *ip = regs->ip; | 370 | *ip = READ_ONCE_NOCHECK(regs->ip); |
| 371 | *sp = regs->sp; | 371 | *sp = READ_ONCE_NOCHECK(regs->sp); |
| 372 | return true; | 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 | if (!stack_access_ok(state, addr, IRET_FRAME_SIZE)) | 380 | if (!stack_access_ok(state, addr, IRET_FRAME_SIZE)) |
| 381 | return false; | 381 | return false; |
| 382 | 382 | ||
| 383 | *ip = regs->ip; | 383 | *ip = READ_ONCE_NOCHECK(regs->ip); |
| 384 | *sp = regs->sp; | 384 | *sp = READ_ONCE_NOCHECK(regs->sp); |
| 385 | return true; | 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 | return false; | 402 | return false; |
| 403 | 403 | ||
| 404 | if (state->full_regs) { | 404 | if (state->full_regs) { |
| 405 | *val = ((unsigned long *)state->regs)[reg]; | 405 | *val = READ_ONCE_NOCHECK(((unsigned long *)state->regs)[reg]); |
| 406 | return true; | 406 | return true; |
| 407 | } | 407 | } |
| 408 | 408 | ||
| 409 | if (state->prev_regs) { | 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 | return true; | 411 | return true; |
| 412 | } | 412 | } |
| 413 | 413 | ||
| @@ -1,6 +1,6 @@ | |||
| 1 | # SPDX-License-Identifier: GPL-2.0 | 1 | # SPDX-License-Identifier: GPL-2.0 |
| 2 | 2 | ||
| 3 | ccflags-y += -Iarch/x86/kvm | 3 | ccflags-y += -I $(srctree)/arch/x86/kvm |
| 4 | ccflags-$(CONFIG_KVM_WERROR) += -Werror | 4 | ccflags-$(CONFIG_KVM_WERROR) += -Werror |
| 5 | 5 | ||
| 6 | ifeq ($(CONFIG_FRAME_POINTER),y) | 6 | ifeq ($(CONFIG_FRAME_POINTER),y) |
| @@ -520,10 +520,10 @@ static u64 get_time_ref_counter(struct kvm *kvm) · 519 unmodified lines | |||
| 520 | u64 tsc; | 520 | u64 tsc; |
| 521 | 521 | ||
| 522 | /* | 522 | /* |
| 523 | * The guest has not set up the TSC page or the clock isn't | 523 | * Fall back to get_kvmclock_ns() when TSC page hasn't been set up, |
| 524 | * stable, fall back to get_kvmclock_ns. | 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 | return div_u64(get_kvmclock_ns(kvm), 100); | 527 | return div_u64(get_kvmclock_ns(kvm), 100); |
| 528 | 528 | ||
| 529 | vcpu = kvm_get_vcpu(kvm, 0); | 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 | return true; | 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 | void kvm_hv_setup_tsc_page(struct kvm *kvm, | 1095 | void kvm_hv_setup_tsc_page(struct kvm *kvm, |
| 1081 | struct pvclock_vcpu_time_info *hv_clock) | 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 | BUILD_BUG_ON(sizeof(tsc_seq) != sizeof(hv->tsc_ref.tsc_sequence)); | 1102 | BUILD_BUG_ON(sizeof(tsc_seq) != sizeof(hv->tsc_ref.tsc_sequence)); |
| 1088 | BUILD_BUG_ON(offsetof(struct ms_hyperv_tsc_page, tsc_sequence) != 0); | 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 | return; | 1107 | return; |
| 1092 | 1108 | ||
| 1093 | mutex_lock(&hv->hv_lock); | 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 | if (unlikely(kvm_read_guest(kvm, gfn_to_gpa(gfn), | 1118 | if (unlikely(kvm_read_guest(kvm, gfn_to_gpa(gfn), |
| 1103 | &tsc_seq, sizeof(tsc_seq)))) | 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 | goto out_unlock; | 1127 | goto out_unlock; |
| 1128 | } | ||
| 1105 | 1129 | ||
| 1106 | /* | 1130 | /* |
| 1107 | * While we're computing and writing the parameters, force the | 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 | hv->tsc_ref.tsc_sequence = 0; | 1134 | hv->tsc_ref.tsc_sequence = 0; |
| 1111 | if (kvm_write_guest(kvm, gfn_to_gpa(gfn), | 1135 | if (kvm_write_guest(kvm, gfn_to_gpa(gfn), |
| 1112 | &hv->tsc_ref, sizeof(hv->tsc_ref.tsc_sequence))) | 1136 | &hv->tsc_ref, sizeof(hv->tsc_ref.tsc_sequence))) |
| 1113 | goto out_unlock; | 1137 | goto out_err; |
| 1114 | 1138 | ||
| 1115 | if (!compute_tsc_page_parameters(hv_clock, &hv->tsc_ref)) | 1139 | if (!compute_tsc_page_parameters(hv_clock, &hv->tsc_ref)) |
| 1116 | goto out_unlock; | 1140 | goto out_err; |
| 1117 | 1141 | ||
| 1118 | /* Ensure sequence is zero before writing the rest of the struct. */ | 1142 | /* Ensure sequence is zero before writing the rest of the struct. */ |
| 1119 | smp_wmb(); | 1143 | smp_wmb(); |
| 1120 | if (kvm_write_guest(kvm, gfn_to_gpa(gfn), &hv->tsc_ref, sizeof(hv->tsc_ref))) | 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 | * Now switch to the TSC page mechanism by writing the sequence. | 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 | smp_wmb(); | 1155 | smp_wmb(); |
| 1132 | 1156 | ||
| 1133 | hv->tsc_ref.tsc_sequence = tsc_seq; | 1157 | hv->tsc_ref.tsc_sequence = tsc_seq; |
| 1134 | kvm_write_guest(kvm, gfn_to_gpa(gfn), | 1158 | if (kvm_write_guest(kvm, gfn_to_gpa(gfn), |
| 1135 | &hv->tsc_ref, sizeof(hv->tsc_ref.tsc_sequence)); | 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 | out_unlock: | 1197 | out_unlock: |
| 1137 | mutex_unlock(&hv->hv_lock); | 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 | case HV_X64_MSR_REFERENCE_TSC: | 1255 | case HV_X64_MSR_REFERENCE_TSC: |
| 1195 | hv->hv_tsc_page = data; | 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 | kvm_make_request(KVM_REQ_MASTERCLOCK_UPDATE, vcpu); | 1262 | kvm_make_request(KVM_REQ_MASTERCLOCK_UPDATE, vcpu); |
| 1263 | } else { | ||
| 1264 | hv->hv_tsc_page_status = HV_TSC_PAGE_UNSET; | ||
| 1265 | } | ||
| 1198 | break; | 1266 | break; |
| 1199 | case HV_X64_MSR_CRASH_P0 ... HV_X64_MSR_CRASH_P4: | 1267 | case HV_X64_MSR_CRASH_P0 ... HV_X64_MSR_CRASH_P4: |
| 1200 | return kvm_hv_msr_set_crash_data(kvm, | 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 | hv->hv_tsc_emulation_control = data; | 1297 | hv->hv_tsc_emulation_control = data; |
| 1230 | break; | 1298 | break; |
| 1231 | case HV_X64_MSR_TSC_EMULATION_STATUS: | 1299 | case HV_X64_MSR_TSC_EMULATION_STATUS: |
| 1300 | if (data && !host) | ||
| 1301 | return 1; | ||
| 1302 | |||
| 1232 | hv->hv_tsc_emulation_status = data; | 1303 | hv->hv_tsc_emulation_status = data; |
| 1233 | break; | 1304 | break; |
| 1234 | case HV_X64_MSR_TIME_REF_COUNT: | 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 | void kvm_hv_setup_tsc_page(struct kvm *kvm, | 134 | void kvm_hv_setup_tsc_page(struct kvm *kvm, |
| 135 | struct pvclock_vcpu_time_info *hv_clock); | 135 | struct pvclock_vcpu_time_info *hv_clock); |
| 136 | void kvm_hv_invalidate_tsc_page(struct kvm *kvm); | ||
| 136 | 137 | ||
| 137 | void kvm_hv_init_vm(struct kvm *kvm); | 138 | void kvm_hv_init_vm(struct kvm *kvm); |
| 138 | void kvm_hv_destroy_vm(struct kvm *kvm); | 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 | if (kvm_use_posted_timer_interrupt(apic->vcpu)) { | 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 | kvm_apic_inject_pending_timer_irqs(apic); | 1655 | kvm_apic_inject_pending_timer_irqs(apic); |
| 1647 | return; | 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 | apic_update_ppr(apic); | 2605 | apic_update_ppr(apic); |
| 2597 | hrtimer_cancel(&apic->lapic_timer.timer); | 2606 | hrtimer_cancel(&apic->lapic_timer.timer); |
| 2607 | apic->lapic_timer.expired_tscdeadline = 0; | ||
| 2598 | apic_update_lvtt(apic); | 2608 | apic_update_lvtt(apic); |
| 2599 | apic_manage_nmi_watchdog(apic, kvm_lapic_get_reg(apic, APIC_LVT0)); | 2609 | apic_manage_nmi_watchdog(apic, kvm_lapic_get_reg(apic, APIC_LVT0)); |
| 2600 | update_divide_count(apic); | 2610 | update_divide_count(apic); |
| @@ -5884,6 +5884,7 @@ static void kvm_recover_nx_lpages(struct kvm *kvm) · 5883 unmodified lines | |||
| 5884 | struct kvm_mmu_page *sp; | 5884 | struct kvm_mmu_page *sp; |
| 5885 | unsigned int ratio; | 5885 | unsigned int ratio; |
| 5886 | LIST_HEAD(invalid_list); | 5886 | LIST_HEAD(invalid_list); |
| 5887 | bool flush = false; | ||
| 5887 | ulong to_zap; | 5888 | ulong to_zap; |
| 5888 | 5889 | ||
| 5889 | rcu_idx = srcu_read_lock(&kvm->srcu); | 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 | lpage_disallowed_link); | 5906 | lpage_disallowed_link); |
| 5906 | WARN_ON_ONCE(!sp->lpage_disallowed); | 5907 | WARN_ON_ONCE(!sp->lpage_disallowed); |
| 5907 | if (is_tdp_mmu_page(sp)) { | 5908 | if (is_tdp_mmu_page(sp)) { |
| 5908 | kvm_tdp_mmu_zap_gfn_range(kvm, sp->gfn, | 5909 | flush |= kvm_tdp_mmu_zap_sp(kvm, sp); |
| 5909 | sp->gfn + KVM_PAGES_PER_HPAGE(sp->role.level)); | ||
| 5910 | } else { | 5910 | } else { |
| 5911 | kvm_mmu_prepare_zap_page(kvm, sp, &invalid_list); | 5911 | kvm_mmu_prepare_zap_page(kvm, sp, &invalid_list); |
| 5912 | WARN_ON_ONCE(sp->lpage_disallowed); | 5912 | WARN_ON_ONCE(sp->lpage_disallowed); |
| 5913 | } | 5913 | } |
| 5914 | 5914 | ||
| 5915 | if (need_resched() || rwlock_needbreak(&kvm->mmu_lock)) { | 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 | cond_resched_rwlock_write(&kvm->mmu_lock); | 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 | write_unlock(&kvm->mmu_lock); | 5923 | write_unlock(&kvm->mmu_lock); |
| 5923 | srcu_read_unlock(&kvm->srcu, rcu_idx); | 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 | return to_shadow_page(__pa(sptep)); | 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 | static inline bool kvm_vcpu_ad_need_write_protect(struct kvm_vcpu *vcpu) | 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 | return gfn & -KVM_PAGES_PER_HPAGE(level); | 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 | * Sets a TDP iterator to walk a pre-order traversal of the paging structure | 39 | * Sets a TDP iterator to walk a pre-order traversal of the paging structure |
| 25 | * rooted at root_pt, starting with the walk to translate next_last_level_gfn. | 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 | WARN_ON(root_level > PT64_ROOT_MAX_LEVEL); | 46 | WARN_ON(root_level > PT64_ROOT_MAX_LEVEL); |
| 32 | 47 | ||
| 33 | iter->next_last_level_gfn = next_last_level_gfn; | 48 | iter->next_last_level_gfn = next_last_level_gfn; |
| 34 | iter->yielded_gfn = iter->next_last_level_gfn; | ||
| 35 | iter->root_level = root_level; | 49 | iter->root_level = root_level; |
| 36 | iter->min_level = min_level; | 50 | iter->min_level = min_level; |
| 37 | iter->level = root_level; | 51 | iter->pt_path[iter->root_level - 1] = (tdp_ptep_t)root_pt; |
| 38 | iter->pt_path[iter->level - 1] = (tdp_ptep_t)root_pt; | 52 | iter->as_id = kvm_mmu_page_as_id(sptep_to_sp(root_pt)); |
| 39 | |||
| 40 | iter->gfn = round_gfn_for_level(iter->next_last_level_gfn, iter->level); | ||
| 41 | tdp_iter_refresh_sptep(iter); | ||
| 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 | iter->valid = false; | 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 | int min_level; | 36 | int min_level; |
| 37 | /* The iterator's current level within the paging structure */ | 37 | /* The iterator's current level within the paging structure */ |
| 38 | int level; | 38 | int level; |
| 39 | /* The address space ID, i.e. SMM vs. regular. */ | ||
| 40 | int as_id; | ||
| 39 | /* A snapshot of the value at sptep */ | 41 | /* A snapshot of the value at sptep */ |
| 40 | u64 old_spte; | 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 | void tdp_iter_start(struct tdp_iter *iter, u64 *root_pt, int root_level, | 64 | void tdp_iter_start(struct tdp_iter *iter, u64 *root_pt, int root_level, |
| 63 | int min_level, gfn_t next_last_level_gfn); | 65 | int min_level, gfn_t next_last_level_gfn); |
| 64 | void tdp_iter_next(struct tdp_iter *iter); | 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 | #endif /* __KVM_X86_MMU_TDP_ITER_H */ | 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 | list_for_each_entry(_root, &_kvm->arch.tdp_mmu_roots, link) | 86 | list_for_each_entry(_root, &_kvm->arch.tdp_mmu_roots, link) |
| 87 | 87 | ||
| 88 | static bool zap_gfn_range(struct kvm *kvm, struct kvm_mmu_page *root, | 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 | void kvm_tdp_mmu_free_root(struct kvm *kvm, struct kvm_mmu_page *root) | 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 | list_del(&root->link); | 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 | free_page((unsigned long)root->spt); | 104 | free_page((unsigned long)root->spt); |
| 105 | kmem_cache_free(mmu_page_header_cache, root); | 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 | u64 old_spte, u64 new_spte, int level, | 203 | u64 old_spte, u64 new_spte, int level, |
| 204 | bool shared); | 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 | static void handle_changed_spte_acc_track(u64 old_spte, u64 new_spte, int level) | 206 | static void handle_changed_spte_acc_track(u64 old_spte, u64 new_spte, int level) |
| 212 | { | 207 | { |
| 213 | bool pfn_changed = spte_to_pfn(old_spte) != spte_to_pfn(new_spte); | 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 | * Given a page table that has been removed from the TDP paging structure, | 297 | * Given a page table that has been removed from the TDP paging structure, |
| 303 | * iterates through the page table to clear SPTEs and free child page tables. | 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 | bool shared) | 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 | int level = sp->role.level; | 309 | int level = sp->role.level; |
| 310 | gfn_t base_gfn = sp->gfn; | 310 | gfn_t base_gfn = sp->gfn; |
| 311 | u64 old_child_spte; | 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 | tdp_mmu_unlink_page(kvm, sp, shared); | 318 | tdp_mmu_unlink_page(kvm, sp, shared); |
| 319 | 319 | ||
| 320 | for (i = 0; i < PT64_ENT_PER_PAGE; i++) { | 320 | for (i = 0; i < PT64_ENT_PER_PAGE; i++) { |
| 321 | sptep = pt + i; | 321 | sptep = rcu_dereference(pt) + i; |
| 322 | gfn = base_gfn + (i * KVM_PAGES_PER_HPAGE(level - 1)); | 322 | gfn = base_gfn + (i * KVM_PAGES_PER_HPAGE(level - 1)); |
| 323 | 323 | ||
| 324 | if (shared) { | 324 | if (shared) { |
| @@ -337,7 +337,18 @@ static void handle_removed_tdp_mmu_page(struct kvm *kvm, u64 *pt, · 12 unmodified lines | |||
| 337 | cpu_relax(); | 337 | cpu_relax(); |
| 338 | } | 338 | } |
| 339 | } else { | 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 | old_child_spte = READ_ONCE(*sptep); | 349 | old_child_spte = READ_ONCE(*sptep); |
| 350 | if (!is_shadow_present_pte(old_child_spte)) | ||
| 351 | continue; | ||
| 341 | 352 | ||
| 342 | /* | 353 | /* |
| 343 | * Marking the SPTE as a removed SPTE is not | 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 | struct tdp_iter *iter, | 492 | struct tdp_iter *iter, |
| 482 | u64 new_spte) | 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 | lockdep_assert_held_read(&kvm->mmu_lock); | 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 | new_spte) != iter->old_spte) | 505 | new_spte) != iter->old_spte) |
| 499 | return false; | 506 | return false; |
| 500 | 507 | ||
| 501 | handle_changed_spte(kvm, as_id, iter->gfn, iter->old_spte, new_spte, | 508 | handle_changed_spte(kvm, iter->as_id, iter->gfn, iter->old_spte, |
| 502 | iter->level, true); | 509 | new_spte, iter->level, true); |
| 503 | 510 | ||
| 504 | return true; | 511 | return true; |
| 505 | } | 512 | } |
| @@ -527,7 +534,7 @@ static inline bool tdp_mmu_zap_spte_atomic(struct kvm *kvm, · 21 unmodified lines | |||
| 527 | * here since the SPTE is going from non-present | 534 | * here since the SPTE is going from non-present |
| 528 | * to non-present. | 535 | * to non-present. |
| 529 | */ | 536 | */ |
| 530 | WRITE_ONCE(*iter->sptep, 0); | 537 | WRITE_ONCE(*rcu_dereference(iter->sptep), 0); |
| 531 | 538 | ||
| 532 | return true; | 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 | u64 new_spte, bool record_acc_track, | 560 | u64 new_spte, bool record_acc_track, |
| 554 | bool record_dirty_log) | 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 | lockdep_assert_held_write(&kvm->mmu_lock); | 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 | WRITE_ONCE(*rcu_dereference(iter->sptep), new_spte); | 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, | 576 | __handle_changed_spte(kvm, iter->as_id, iter->gfn, iter->old_spte, |
| 574 | iter->level, false); | 577 | new_spte, iter->level, false); |
| 575 | if (record_acc_track) | 578 | if (record_acc_track) |
| 576 | handle_changed_spte_acc_track(iter->old_spte, new_spte, | 579 | handle_changed_spte_acc_track(iter->old_spte, new_spte, |
| 577 | iter->level); | 580 | iter->level); |
| 578 | if (record_dirty_log) | 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 | iter->old_spte, new_spte, | 583 | iter->old_spte, new_spte, |
| 581 | iter->level); | 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 | WARN_ON(iter->gfn > iter->next_last_level_gfn); | 652 | WARN_ON(iter->gfn > iter->next_last_level_gfn); |
| 650 | 653 | ||
| 651 | tdp_iter_start(iter, iter->pt_path[iter->root_level - 1], | 654 | tdp_iter_restart(iter); |
| 652 | iter->root_level, iter->min_level, | ||
| 653 | iter->next_last_level_gfn); | ||
| 654 | 655 | ||
| 655 | return true; | 656 | return true; |
| 656 | } | 657 | } |
| @@ -667,20 +668,21 @@ static inline bool tdp_mmu_iter_cond_resched(struct kvm *kvm, · 10 unmodified lines | |||
| 667 | * scheduler needs the CPU or there is contention on the MMU lock. If this | 668 | * scheduler needs the CPU or there is contention on the MMU lock. If this |
| 668 | * function cannot yield, it will not release the MMU lock or reschedule and | 669 | * function cannot yield, it will not release the MMU lock or reschedule and |
| 669 | * the caller must ensure it does not supply too large a GFN range, or the | 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 | static bool zap_gfn_range(struct kvm *kvm, struct kvm_mmu_page *root, | 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 | struct tdp_iter iter; | 678 | struct tdp_iter iter; |
| 676 | bool flush_needed = false; | ||
| 677 | 679 | ||
| 678 | rcu_read_lock(); | 680 | rcu_read_lock(); |
| 679 | 681 | ||
| 680 | tdp_root_for_each_pte(iter, root, start, end) { | 682 | tdp_root_for_each_pte(iter, root, start, end) { |
| 681 | if (can_yield && | 683 | if (can_yield && |
| 682 | tdp_mmu_iter_cond_resched(kvm, &iter, flush_needed)) { | 684 | tdp_mmu_iter_cond_resched(kvm, &iter, flush)) { |
| 683 | flush_needed = false; | 685 | flush = false; |
| 684 | continue; | 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 | continue; | 700 | continue; |
| 699 | 701 | ||
| 700 | tdp_mmu_set_spte(kvm, &iter, 0); | 702 | tdp_mmu_set_spte(kvm, &iter, 0); |
| 701 | flush_needed = true; | 703 | flush = true; |
| 702 | } | 704 | } |
| 703 | 705 | ||
| 704 | rcu_read_unlock(); | 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 | * SPTEs have been cleared and a TLB flush is needed before releasing the | 713 | * SPTEs have been cleared and a TLB flush is needed before releasing the |
| 712 | * MMU lock. | 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 | struct kvm_mmu_page *root; | 719 | struct kvm_mmu_page *root; |
| 717 | bool flush = false; | 720 | bool flush = false; |
| 718 | 721 | ||
| 719 | for_each_tdp_mmu_root_yield_safe(kvm, root) | 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 | return flush; | 725 | return flush; |
| 723 | } | 726 | } |
| @@ -929,7 +932,7 @@ static int zap_gfn_range_hva_wrapper(struct kvm *kvm, · 205 unmodified lines | |||
| 929 | struct kvm_mmu_page *root, gfn_t start, | 932 | struct kvm_mmu_page *root, gfn_t start, |
| 930 | gfn_t end, unsigned long unused) | 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 | int kvm_tdp_mmu_zap_hva_range(struct kvm *kvm, unsigned long start, | 938 | int kvm_tdp_mmu_zap_hva_range(struct kvm *kvm, unsigned long start, |
| @@ -8,7 +8,29 @@ · 7 unmodified lines | |||
| 8 | hpa_t kvm_tdp_mmu_get_vcpu_root_hpa(struct kvm_vcpu *vcpu); | 8 | hpa_t kvm_tdp_mmu_get_vcpu_root_hpa(struct kvm_vcpu *vcpu); |
| 9 | void kvm_tdp_mmu_free_root(struct kvm *kvm, struct kvm_mmu_page *root); | 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 | void kvm_tdp_mmu_zap_all(struct kvm *kvm); | 34 | void kvm_tdp_mmu_zap_all(struct kvm *kvm); |
| 13 | 35 | ||
| 14 | int kvm_tdp_mmu_map(struct kvm_vcpu *vcpu, gpa_t gpa, u32 error_code, | 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 | return true; | 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 | struct kvm_vcpu *vcpu = &svm->vcpu; | 251 | struct kvm_vcpu *vcpu = &svm->vcpu; |
| 252 | bool vmcb12_lma; | 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 | if ((vmcb12->save.efer & EFER_SVME) == 0) | 261 | if ((vmcb12->save.efer & EFER_SVME) == 0) |
| 255 | return false; | 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 | if (!kvm_is_valid_cr4(&svm->vcpu, vmcb12->save.cr4)) | 278 | if (!kvm_is_valid_cr4(&svm->vcpu, vmcb12->save.cr4)) |
| 272 | return false; | 279 | return false; |
| 273 | 280 | ||
| 274 | return nested_vmcb_check_controls(&vmcb12->control); | 281 | return true; |
| 275 | } | 282 | } |
| 276 | 283 | ||
| 277 | static void load_nested_vmcb_control(struct vcpu_svm *svm, | 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 | svm->vmcb->save.gdtr = vmcb12->save.gdtr; | 403 | svm->vmcb->save.gdtr = vmcb12->save.gdtr; |
| 397 | svm->vmcb->save.idtr = vmcb12->save.idtr; | 404 | svm->vmcb->save.idtr = vmcb12->save.idtr; |
| 398 | kvm_set_rflags(&svm->vcpu, vmcb12->save.rflags | X86_EFLAGS_FIXED); | 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 | svm_set_cr0(&svm->vcpu, vmcb12->save.cr0); | 414 | svm_set_cr0(&svm->vcpu, vmcb12->save.cr0); |
| 401 | svm_set_cr4(&svm->vcpu, vmcb12->save.cr4); | 415 | svm_set_cr4(&svm->vcpu, vmcb12->save.cr4); |
| 402 | svm->vmcb->save.cr2 = svm->vcpu.arch.cr2 = vmcb12->save.cr2; | 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 | svm->nested.vmcb12_gpa = vmcb12_gpa; | 484 | svm->nested.vmcb12_gpa = vmcb12_gpa; |
| 471 | load_nested_vmcb_control(svm, &vmcb12->control); | ||
| 472 | nested_prepare_vmcb_control(svm); | 485 | nested_prepare_vmcb_control(svm); |
| 473 | nested_prepare_vmcb_save(svm, vmcb12); | 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 | if (WARN_ON_ONCE(!svm->nested.initialized)) | 528 | if (WARN_ON_ONCE(!svm->nested.initialized)) |
| 516 | return -EINVAL; | 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 | vmcb12->control.exit_code = SVM_EXIT_ERR; | 535 | vmcb12->control.exit_code = SVM_EXIT_ERR; |
| 520 | vmcb12->control.exit_code_hi = 0; | 536 | vmcb12->control.exit_code_hi = 0; |
| 521 | vmcb12->control.exit_info_1 = 0; | 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 | if (!(save->cr0 & X86_CR0_PG)) | 1226 | if (!(save->cr0 & X86_CR0_PG)) |
| 1211 | goto out_free; | 1227 | goto out_free; |
| 1228 | if (!(save->efer & EFER_SVME)) | ||
| 1229 | goto out_free; | ||
| 1212 | 1230 | ||
| 1213 | /* | 1231 | /* |
| 1214 | * All checks done, we can enter guest mode. L1 control fields | 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 | static inline struct kvm_pmc *get_gp_pmc_amd(struct kvm_pmu *pmu, u32 msr, | 98 | static inline struct kvm_pmc *get_gp_pmc_amd(struct kvm_pmu *pmu, u32 msr, |
| 99 | enum pmu_type type) | 99 | enum pmu_type type) |
| 100 | { | 100 | { |
| 101 | struct kvm_vcpu *vcpu = pmu_to_vcpu(pmu); | ||
| 102 | |||
| 101 | switch (msr) { | 103 | switch (msr) { |
| 102 | case MSR_F15H_PERF_CTL0: | 104 | case MSR_F15H_PERF_CTL0: |
| 103 | case MSR_F15H_PERF_CTL1: | 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 | case MSR_F15H_PERF_CTL3: | 107 | case MSR_F15H_PERF_CTL3: |
| 106 | case MSR_F15H_PERF_CTL4: | 108 | case MSR_F15H_PERF_CTL4: |
| 107 | case MSR_F15H_PERF_CTL5: | 109 | case MSR_F15H_PERF_CTL5: |
| 110 | if (!guest_cpuid_has(vcpu, X86_FEATURE_PERFCTR_CORE)) | ||
| 111 | return NULL; | ||
| 112 | fallthrough; | ||
| 108 | case MSR_K7_EVNTSEL0 ... MSR_K7_EVNTSEL3: | 113 | case MSR_K7_EVNTSEL0 ... MSR_K7_EVNTSEL3: |
| 109 | if (type != PMU_TYPE_EVNTSEL) | 114 | if (type != PMU_TYPE_EVNTSEL) |
| 110 | return NULL; | 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 | case MSR_F15H_PERF_CTR3: | 120 | case MSR_F15H_PERF_CTR3: |
| 116 | case MSR_F15H_PERF_CTR4: | 121 | case MSR_F15H_PERF_CTR4: |
| 117 | case MSR_F15H_PERF_CTR5: | 122 | case MSR_F15H_PERF_CTR5: |
| 123 | if (!guest_cpuid_has(vcpu, X86_FEATURE_PERFCTR_CORE)) | ||
| 124 | return NULL; | ||
| 125 | fallthrough; | ||
| 118 | case MSR_K7_PERFCTR0 ... MSR_K7_PERFCTR3: | 126 | case MSR_K7_PERFCTR0 ... MSR_K7_PERFCTR3: |
| 119 | if (type != PMU_TYPE_COUNTER) | 127 | if (type != PMU_TYPE_COUNTER) |
| 120 | return NULL; | 128 | return NULL; |
| @@ -115,13 +115,6 @@ static const struct svm_direct_access_msrs { · 114 unmodified lines | |||
| 115 | { .index = MSR_INVALID, .always = false }, | 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 | * These 2 parameters are used to config the controls for Pause-Loop Exiting: | 119 | * These 2 parameters are used to config the controls for Pause-Loop Exiting: |
| 127 | * pause_filter_count: On processors that support Pause filtering(indicated | 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 | static unsigned short pause_filter_count_max = KVM_SVM_DEFAULT_PLE_WINDOW_MAX; | 163 | static unsigned short pause_filter_count_max = KVM_SVM_DEFAULT_PLE_WINDOW_MAX; |
| 171 | module_param(pause_filter_count_max, ushort, 0444); | 164 | module_param(pause_filter_count_max, ushort, 0444); |
| 172 | 165 | ||
| 173 | /* allow nested paging (virtualized MMU) for all guests */ | 166 | /* |
| 174 | static int npt = true; | 167 | * Use nested page tables by default. Note, NPT may get forced off by |
| 175 | module_param(npt, int, S_IRUGO); | 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 | /* allow nested virtualization in KVM/SVM */ | 173 | /* allow nested virtualization in KVM/SVM */ |
| 178 | static int nested = true; | 174 | static int nested = true; |
| @@ -988,10 +984,15 @@ static __init int svm_hardware_setup(void) · 809 unmodified lines | |||
| 988 | goto err; | 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 | npt_enabled = false; | 993 | npt_enabled = false; |
| 993 | 994 | ||
| 994 | if (npt_enabled && !npt) | 995 | if (!boot_cpu_has(X86_FEATURE_NPT)) |
| 995 | npt_enabled = false; | 996 | npt_enabled = false; |
| 996 | 997 | ||
| 997 | kvm_configure_mmu(npt_enabled, get_max_npt_level(), PG_LEVEL_1G); | 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 | exit_reason.basic != EXIT_REASON_PML_FULL && | 6027 | exit_reason.basic != EXIT_REASON_PML_FULL && |
| 6028 | exit_reason.basic != EXIT_REASON_APIC_ACCESS && | 6028 | exit_reason.basic != EXIT_REASON_APIC_ACCESS && |
| 6029 | exit_reason.basic != EXIT_REASON_TASK_SWITCH)) { | 6029 | exit_reason.basic != EXIT_REASON_TASK_SWITCH)) { |
| 6030 | int ndata = 3; | ||
| 6031 | |||
| 6030 | vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR; | 6032 | vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR; |
| 6031 | vcpu->run->internal.suberror = KVM_INTERNAL_ERROR_DELIVERY_EV; | 6033 | vcpu->run->internal.suberror = KVM_INTERNAL_ERROR_DELIVERY_EV; |
| 6032 | vcpu->run->internal.ndata = 3; | ||
| 6033 | vcpu->run->internal.data[0] = vectoring_info; | 6034 | vcpu->run->internal.data[0] = vectoring_info; |
| 6034 | vcpu->run->internal.data[1] = exit_reason.full; | 6035 | vcpu->run->internal.data[1] = exit_reason.full; |
| 6035 | vcpu->run->internal.data[2] = vcpu->arch.exit_qualification; | 6036 | vcpu->run->internal.data[2] = vcpu->arch.exit_qualification; |
| 6036 | if (exit_reason.basic == EXIT_REASON_EPT_MISCONFIG) { | 6037 | if (exit_reason.basic == EXIT_REASON_EPT_MISCONFIG) { |
| 6037 | vcpu->run->internal.ndata++; | 6038 | vcpu->run->internal.data[ndata++] = |
| 6038 | vcpu->run->internal.data[3] = | ||
| 6039 | vmcs_read64(GUEST_PHYSICAL_ADDRESS); | 6039 | vmcs_read64(GUEST_PHYSICAL_ADDRESS); |
| 6040 | } | 6040 | } |
| 6041 | vcpu->run->internal.data[vcpu->run->internal.ndata++] = | 6041 | vcpu->run->internal.data[ndata++] = vcpu->arch.last_vmentry_cpu; |
| 6042 | vcpu->arch.last_vmentry_cpu; | 6042 | vcpu->run->internal.ndata = ndata; |
| 6043 | return 0; | 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 | int i, nr_msrs; | 6580 | int i, nr_msrs; |
| 6581 | struct perf_guest_switch_msr *msrs; | 6581 | struct perf_guest_switch_msr *msrs; |
| 6582 | 6582 | ||
| 6583 | /* Note, nr_msrs may be garbage if perf_guest_get_msrs() returns NULL. */ | ||
| 6583 | msrs = perf_guest_get_msrs(&nr_msrs); | 6584 | msrs = perf_guest_get_msrs(&nr_msrs); |
| 6584 | |||
| 6585 | if (!msrs) | 6585 | if (!msrs) |
| 6586 | return; | 6586 | return; |
| 6587 | 6587 | ||
| @@ -271,8 +271,7 @@ static struct kmem_cache *x86_emulator_cache; · 270 unmodified lines | |||
| 271 | * When called, it means the previous get/set msr reached an invalid msr. | 271 | * When called, it means the previous get/set msr reached an invalid msr. |
| 272 | * Return true if we want to ignore/silent this failed msr access. | 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, | 274 | static bool kvm_msr_ignored_check(u32 msr, u64 data, bool write) |
| 275 | u64 data, bool write) | ||
| 276 | { | 275 | { |
| 277 | const char *op = write ? "wrmsr" : "rdmsr"; | 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 | if (r == KVM_MSR_RET_INVALID) { | 1444 | if (r == KVM_MSR_RET_INVALID) { |
| 1446 | /* Unconditionally clear the output for simplicity */ | 1445 | /* Unconditionally clear the output for simplicity */ |
| 1447 | *data = 0; | 1446 | *data = 0; |
| 1448 | if (kvm_msr_ignored_check(vcpu, index, 0, false)) | 1447 | if (kvm_msr_ignored_check(index, 0, false)) |
| 1449 | r = 0; | 1448 | r = 0; |
| 1450 | } | 1449 | } |
| 1451 | 1450 | ||
| @@ -1526,35 +1525,44 @@ EXPORT_SYMBOL_GPL(kvm_enable_efer_bits); · 74 unmodified lines | |||
| 1526 | 1525 | ||
| 1527 | bool kvm_msr_allowed(struct kvm_vcpu *vcpu, u32 index, u32 type) | 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 | struct kvm *kvm = vcpu->kvm; | 1530 | struct kvm *kvm = vcpu->kvm; |
| 1530 | struct msr_bitmap_range *ranges = kvm->arch.msr_filter.ranges; | 1531 | bool allowed; |
| 1531 | u32 count = kvm->arch.msr_filter.count; | ||
| 1532 | u32 i; | ||
| 1533 | bool r = kvm->arch.msr_filter.default_allow; | ||
| 1534 | int idx; | 1532 | int idx; |
| 1533 | u32 i; | ||
| 1535 | 1534 | ||
| 1536 | /* MSR filtering not set up or x2APIC enabled, allow everything */ | 1535 | /* x2APIC MSRs do not support filtering. */ |
| 1537 | if (!count || (index >= 0x800 && index <= 0x8ff)) | 1536 | if (index >= 0x800 && index <= 0x8ff) |
| 1538 | return true; | 1537 | return true; |
| 1539 | 1538 | ||
| 1540 | /* Prevent collision with set_msr_filter */ | ||
| 1541 | idx = srcu_read_lock(&kvm->srcu); | 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 | u32 start = ranges[i].base; | 1551 | u32 start = ranges[i].base; |
| 1545 | u32 end = start + ranges[i].nmsrs; | 1552 | u32 end = start + ranges[i].nmsrs; |
| 1546 | u32 flags = ranges[i].flags; | 1553 | u32 flags = ranges[i].flags; |
| 1547 | unsigned long *bitmap = ranges[i].bitmap; | 1554 | unsigned long *bitmap = ranges[i].bitmap; |
| 1548 | 1555 | ||
| 1549 | if ((index >= start) && (index < end) && (flags & type)) { | 1556 | if ((index >= start) && (index < end) && (flags & type)) { |
| 1550 | r = !!test_bit(index - start, bitmap); | 1557 | allowed = !!test_bit(index - start, bitmap); |
| 1551 | break; | 1558 | break; |
| 1552 | } | 1559 | } |
| 1553 | } | 1560 | } |
| 1554 | 1561 | ||
| 1562 | out: | ||
| 1555 | srcu_read_unlock(&kvm->srcu, idx); | 1563 | srcu_read_unlock(&kvm->srcu, idx); |
| 1556 | 1564 | ||
| 1557 | return r; | 1565 | return allowed; |
| 1558 | } | 1566 | } |
| 1559 | EXPORT_SYMBOL_GPL(kvm_msr_allowed); | 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 | int ret = __kvm_set_msr(vcpu, index, data, host_initiated); | 1619 | int ret = __kvm_set_msr(vcpu, index, data, host_initiated); |
| 1612 | 1620 | ||
| 1613 | if (ret == KVM_MSR_RET_INVALID) | 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 | ret = 0; | 1623 | ret = 0; |
| 1616 | 1624 | ||
| 1617 | return ret; | 1625 | return ret; |
| @@ -1649,7 +1657,7 @@ static int kvm_get_msr_ignored_check(struct kvm_vcpu *vcpu, · 31 unmodified lines | |||
| 1649 | if (ret == KVM_MSR_RET_INVALID) { | 1657 | if (ret == KVM_MSR_RET_INVALID) { |
| 1650 | /* Unconditionally clear *data for simplicity */ | 1658 | /* Unconditionally clear *data for simplicity */ |
| 1651 | *data = 0; | 1659 | *data = 0; |
| 1652 | if (kvm_msr_ignored_check(vcpu, index, 0, false)) | 1660 | if (kvm_msr_ignored_check(index, 0, false)) |
| 1653 | ret = 0; | 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 | kvm_vcpu_write_tsc_offset(vcpu, offset); | 2328 | kvm_vcpu_write_tsc_offset(vcpu, offset); |
| 2321 | raw_spin_unlock_irqrestore(&kvm->arch.tsc_write_lock, flags); | 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 | if (!matched) { | 2332 | if (!matched) { |
| 2325 | kvm->arch.nr_vcpus_matched_tsc = 0; | 2333 | kvm->arch.nr_vcpus_matched_tsc = 0; |
| 2326 | } else if (!already_matched) { | 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 | kvm_track_tsc_matching(vcpu); | 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 | static inline void adjust_tsc_offset_guest(struct kvm_vcpu *vcpu, | 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 | int i; | 2558 | int i; |
| 2551 | struct kvm_vcpu *vcpu; | 2559 | struct kvm_vcpu *vcpu; |
| 2552 | struct kvm_arch *ka = &kvm->arch; | 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 | kvm_make_mclock_inprogress_request(kvm); | 2565 | kvm_make_mclock_inprogress_request(kvm); |
| 2566 | |||
| 2556 | /* no guest entries from this point */ | 2567 | /* no guest entries from this point */ |
| 2568 | spin_lock_irqsave(&ka->pvclock_gtod_sync_lock, flags); | ||
| 2557 | pvclock_update_vm_gtod_copy(kvm); | 2569 | pvclock_update_vm_gtod_copy(kvm); |
| 2570 | spin_unlock_irqrestore(&ka->pvclock_gtod_sync_lock, flags); | ||
| 2558 | 2571 | ||
| 2559 | kvm_for_each_vcpu(i, vcpu, kvm) | 2572 | kvm_for_each_vcpu(i, vcpu, kvm) |
| 2560 | kvm_make_request(KVM_REQ_CLOCK_UPDATE, vcpu); | 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 | /* guest entries allowed */ | 2575 | /* guest entries allowed */ |
| 2563 | kvm_for_each_vcpu(i, vcpu, kvm) | 2576 | kvm_for_each_vcpu(i, vcpu, kvm) |
| 2564 | kvm_clear_request(KVM_REQ_MCLOCK_INPROGRESS, vcpu); | 2577 | kvm_clear_request(KVM_REQ_MCLOCK_INPROGRESS, vcpu); |
| 2565 | |||
| 2566 | spin_unlock(&ka->pvclock_gtod_sync_lock); | ||
| 2567 | #endif | 2578 | #endif |
| 2568 | } | 2579 | } |
| 2569 | 2580 | ||
| @@ -2571,17 +2582,18 @@ u64 get_kvmclock_ns(struct kvm *kvm) · 1 unmodified line | |||
| 2571 | { | 2582 | { |
| 2572 | struct kvm_arch *ka = &kvm->arch; | 2583 | struct kvm_arch *ka = &kvm->arch; |
| 2573 | struct pvclock_vcpu_time_info hv_clock; | 2584 | struct pvclock_vcpu_time_info hv_clock; |
| 2585 | unsigned long flags; | ||
| 2574 | u64 ret; | 2586 | u64 ret; |
| 2575 | 2587 | ||
| 2576 | spin_lock(&ka->pvclock_gtod_sync_lock); | 2588 | spin_lock_irqsave(&ka->pvclock_gtod_sync_lock, flags); |
| 2577 | if (!ka->use_master_clock) { | 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 | return get_kvmclock_base_ns() + ka->kvmclock_offset; | 2591 | return get_kvmclock_base_ns() + ka->kvmclock_offset; |
| 2580 | } | 2592 | } |
| 2581 | 2593 | ||
| 2582 | hv_clock.tsc_timestamp = ka->master_cycle_now; | 2594 | hv_clock.tsc_timestamp = ka->master_cycle_now; |
| 2583 | hv_clock.system_time = ka->master_kernel_ns + ka->kvmclock_offset; | 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 | /* both __this_cpu_read() and rdtsc() should be on the same cpu */ | 2598 | /* both __this_cpu_read() and rdtsc() should be on the same cpu */ |
| 2587 | get_cpu(); | 2599 | get_cpu(); |
| @@ -2675,13 +2687,13 @@ static int kvm_guest_time_update(struct kvm_vcpu *v) · 87 unmodified lines | |||
| 2675 | * If the host uses TSC clock, then passthrough TSC as stable | 2687 | * If the host uses TSC clock, then passthrough TSC as stable |
| 2676 | * to the guest. | 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 | use_master_clock = ka->use_master_clock; | 2691 | use_master_clock = ka->use_master_clock; |
| 2680 | if (use_master_clock) { | 2692 | if (use_master_clock) { |
| 2681 | host_tsc = ka->master_cycle_now; | 2693 | host_tsc = ka->master_cycle_now; |
| 2682 | kernel_ns = ka->master_kernel_ns; | 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 | /* Keep irq disabled to prevent changes to the clock */ | 2698 | /* Keep irq disabled to prevent changes to the clock */ |
| 2687 | local_irq_save(flags); | 2699 | local_irq_save(flags); |
| @@ -5352,25 +5364,34 @@ split_irqchip_unlock: · 2664 unmodified lines | |||
| 5352 | return r; | 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 | u32 i; | 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); | 5383 | if (!msr_filter) |
| 5362 | kvm->arch.msr_filter.count = 0; | 5384 | return; |
| 5363 | memcpy(ranges, kvm->arch.msr_filter.ranges, count * sizeof(ranges[0])); | 5385 | |
| 5364 | mutex_unlock(&kvm->lock); | 5386 | for (i = 0; i < msr_filter->count; i++) |
| 5365 | synchronize_srcu(&kvm->srcu); | 5387 | kfree(msr_filter->ranges[i].bitmap); |
| 5366 | 5388 | ||
| 5367 | for (i = 0; i < count; i++) | 5389 | kfree(msr_filter); |
| 5368 | kfree(ranges[i].bitmap); | ||
| 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 | struct msr_bitmap_range range; | 5395 | struct msr_bitmap_range range; |
| 5375 | unsigned long *bitmap = NULL; | 5396 | unsigned long *bitmap = NULL; |
| 5376 | size_t bitmap_size; | 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 | goto err; | 5425 | goto err; |
| 5405 | } | 5426 | } |
| 5406 | 5427 | ||
| 5407 | /* Everything ok, add this range identifier to our global pool */ | 5428 | /* Everything ok, add this range identifier. */ |
| 5408 | ranges[kvm->arch.msr_filter.count] = range; | 5429 | msr_filter->ranges[msr_filter->count] = range; |
| 5409 | /* Make sure we filled the array before we tell anyone to walk it */ | 5430 | msr_filter->count++; |
| 5410 | smp_wmb(); | ||
| 5411 | kvm->arch.msr_filter.count++; | ||
| 5412 | 5431 | ||
| 5413 | return 0; | 5432 | return 0; |
| 5414 | err: | 5433 | err: |
| @@ -5419,10 +5438,11 @@ err: · 4 unmodified lines | |||
| 5419 | static int kvm_vm_ioctl_set_msr_filter(struct kvm *kvm, void __user *argp) | 5438 | static int kvm_vm_ioctl_set_msr_filter(struct kvm *kvm, void __user *argp) |
| 5420 | { | 5439 | { |
| 5421 | struct kvm_msr_filter __user *user_msr_filter = argp; | 5440 | struct kvm_msr_filter __user *user_msr_filter = argp; |
| 5441 | struct kvm_x86_msr_filter *new_filter, *old_filter; | ||
| 5422 | struct kvm_msr_filter filter; | 5442 | struct kvm_msr_filter filter; |
| 5423 | bool default_allow; | 5443 | bool default_allow; |
| 5424 | int r = 0; | ||
| 5425 | bool empty = true; | 5444 | bool empty = true; |
| 5445 | int r = 0; | ||
| 5426 | u32 i; | 5446 | u32 i; |
| 5427 | 5447 | ||
| 5428 | if (copy_from_user(&filter, user_msr_filter, sizeof(filter))) | 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 | if (empty && !default_allow) | 5455 | if (empty && !default_allow) |
| 5436 | return -EINVAL; | 5456 | return -EINVAL; |
| 5437 | 5457 | ||
| 5438 | kvm_clear_msr_filter(kvm); | 5458 | new_filter = kvm_alloc_msr_filter(default_allow); |
| 5439 | 5459 | if (!new_filter) | |
| 5440 | kvm->arch.msr_filter.default_allow = default_allow; | 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 | for (i = 0; i < ARRAY_SIZE(filter.ranges); i++) { | 5462 | for (i = 0; i < ARRAY_SIZE(filter.ranges); i++) { |
| 5448 | r = kvm_add_msr_filter(kvm, &filter.ranges[i]); | 5463 | r = kvm_add_msr_filter(new_filter, &filter.ranges[i]); |
| 5449 | if (r) | 5464 | if (r) { |
| 5450 | break; | 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 | kvm_make_all_cpus_request(kvm, KVM_REQ_MSR_FILTER_CHANGED); | 5480 | kvm_make_all_cpus_request(kvm, KVM_REQ_MSR_FILTER_CHANGED); |
| 5454 | mutex_unlock(&kvm->lock); | 5481 | mutex_unlock(&kvm->lock); |
| 5455 | 5482 | ||
| 5456 | return r; | 5483 | return 0; |
| 5457 | } | 5484 | } |
| 5458 | 5485 | ||
| 5459 | long kvm_arch_vm_ioctl(struct file *filp, | 5486 | long kvm_arch_vm_ioctl(struct file *filp, |
| @@ -5700,6 +5727,7 @@ set_pit2_out: · 240 unmodified lines | |||
| 5700 | } | 5727 | } |
| 5701 | #endif | 5728 | #endif |
| 5702 | case KVM_SET_CLOCK: { | 5729 | case KVM_SET_CLOCK: { |
| 5730 | struct kvm_arch *ka = &kvm->arch; | ||
| 5703 | struct kvm_clock_data user_ns; | 5731 | struct kvm_clock_data user_ns; |
| 5704 | u64 now_ns; | 5732 | u64 now_ns; |
| 5705 | 5733 | ||
| @@ -5718,8 +5746,22 @@ set_pit2_out: · 12 unmodified lines | |||
| 5718 | * pvclock_update_vm_gtod_copy(). | 5746 | * pvclock_update_vm_gtod_copy(). |
| 5719 | */ | 5747 | */ |
| 5720 | kvm_gen_update_masterclock(kvm); | 5748 | kvm_gen_update_masterclock(kvm); |
| 5721 | now_ns = get_kvmclock_ns(kvm); | 5749 | |
| 5722 | kvm->arch.kvmclock_offset += user_ns.clock - now_ns; | 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 | kvm_make_all_cpus_request(kvm, KVM_REQ_CLOCK_UPDATE); | 5765 | kvm_make_all_cpus_request(kvm, KVM_REQ_CLOCK_UPDATE); |
| 5724 | break; | 5766 | break; |
| 5725 | } | 5767 | } |
| @@ -6603,7 +6645,7 @@ static int kvm_emulate_wbinvd_noskip(struct kvm_vcpu *vcpu) · 877 unmodified lines | |||
| 6603 | int cpu = get_cpu(); | 6645 | int cpu = get_cpu(); |
| 6604 | 6646 | ||
| 6605 | cpumask_set_cpu(cpu, vcpu->arch.wbinvd_dirty_mask); | 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 | wbinvd_ipi, NULL, 1); | 6649 | wbinvd_ipi, NULL, 1); |
| 6608 | put_cpu(); | 6650 | put_cpu(); |
| 6609 | cpumask_clear(vcpu->arch.wbinvd_dirty_mask); | 6651 | cpumask_clear(vcpu->arch.wbinvd_dirty_mask); |
| @@ -7698,6 +7740,7 @@ static void kvm_hyperv_tsc_notifier(void) · 1088 unmodified lines | |||
| 7698 | struct kvm *kvm; | 7740 | struct kvm *kvm; |
| 7699 | struct kvm_vcpu *vcpu; | 7741 | struct kvm_vcpu *vcpu; |
| 7700 | int cpu; | 7742 | int cpu; |
| 7743 | unsigned long flags; | ||
| 7701 | 7744 | ||
| 7702 | mutex_lock(&kvm_lock); | 7745 | mutex_lock(&kvm_lock); |
| 7703 | list_for_each_entry(kvm, &vm_list, vm_list) | 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 | list_for_each_entry(kvm, &vm_list, vm_list) { | 7756 | list_for_each_entry(kvm, &vm_list, vm_list) { |
| 7714 | struct kvm_arch *ka = &kvm->arch; | 7757 | struct kvm_arch *ka = &kvm->arch; |
| 7715 | 7758 | ||
| 7716 | spin_lock(&ka->pvclock_gtod_sync_lock); | 7759 | spin_lock_irqsave(&ka->pvclock_gtod_sync_lock, flags); |
| 7717 | |||
| 7718 | pvclock_update_vm_gtod_copy(kvm); | 7760 | pvclock_update_vm_gtod_copy(kvm); |
| 7761 | spin_unlock_irqrestore(&ka->pvclock_gtod_sync_lock, flags); | ||
| 7719 | 7762 | ||
| 7720 | kvm_for_each_vcpu(cpu, vcpu, kvm) | 7763 | kvm_for_each_vcpu(cpu, vcpu, kvm) |
| 7721 | kvm_make_request(KVM_REQ_CLOCK_UPDATE, vcpu); | 7764 | kvm_make_request(KVM_REQ_CLOCK_UPDATE, vcpu); |
| 7722 | 7765 | ||
| 7723 | kvm_for_each_vcpu(cpu, vcpu, kvm) | 7766 | kvm_for_each_vcpu(cpu, vcpu, kvm) |
| 7724 | kvm_clear_request(KVM_REQ_MCLOCK_INPROGRESS, vcpu); | 7767 | kvm_clear_request(KVM_REQ_MCLOCK_INPROGRESS, vcpu); |
| 7725 | |||
| 7726 | spin_unlock(&ka->pvclock_gtod_sync_lock); | ||
| 7727 | } | 7768 | } |
| 7728 | mutex_unlock(&kvm_lock); | 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 | return (void __user *)hva; | 10642 | return (void __user *)hva; |
| 10602 | } else { | 10643 | } else { |
| 10603 | if (!slot || !slot->npages) | 10644 | if (!slot || !slot->npages) |
| 10604 | return 0; | 10645 | return NULL; |
| 10605 | 10646 | ||
| 10606 | old_npages = slot->npages; | 10647 | old_npages = slot->npages; |
| 10607 | hva = slot->userspace_addr; | 10648 | hva = slot->userspace_addr; |
| @@ -10634,8 +10675,6 @@ void kvm_arch_pre_destroy_vm(struct kvm *kvm) · 26 unmodified lines | |||
| 10634 | 10675 | ||
| 10635 | void kvm_arch_destroy_vm(struct kvm *kvm) | 10676 | void kvm_arch_destroy_vm(struct kvm *kvm) |
| 10636 | { | 10677 | { |
| 10637 | u32 i; | ||
| 10638 | |||
| 10639 | if (current->mm == kvm->mm) { | 10678 | if (current->mm == kvm->mm) { |
| 10640 | /* | 10679 | /* |
| 10641 | * Free memory regions allocated on behalf of userspace, | 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 | mutex_unlock(&kvm->slots_lock); | 10690 | mutex_unlock(&kvm->slots_lock); |
| 10652 | } | 10691 | } |
| 10653 | static_call_cond(kvm_x86_vm_destroy)(kvm); | 10692 | static_call_cond(kvm_x86_vm_destroy)(kvm); |
| 10654 | for (i = 0; i < kvm->arch.msr_filter.count; i++) | 10693 | kvm_free_msr_filter(srcu_dereference_check(kvm->arch.msr_filter, &kvm->srcu, 1)); |
| 10655 | kfree(kvm->arch.msr_filter.ranges[i].bitmap); | ||
| 10656 | kvm_pic_destroy(kvm); | 10694 | kvm_pic_destroy(kvm); |
| 10657 | kvm_ioapic_destroy(kvm); | 10695 | kvm_ioapic_destroy(kvm); |
| 10658 | kvm_free_vcpus(kvm); | 10696 | kvm_free_vcpus(kvm); |
| @@ -250,7 +250,6 @@ static inline bool kvm_vcpu_latch_init(struct kvm_vcpu *vcpu) · 249 unmodified lines | |||
| 250 | void kvm_write_wall_clock(struct kvm *kvm, gpa_t wall_clock, int sec_hi_ofs); | 250 | void kvm_write_wall_clock(struct kvm *kvm, gpa_t wall_clock, int sec_hi_ofs); |
| 251 | void kvm_inject_realmode_interrupt(struct kvm_vcpu *vcpu, int irq, int inc_eip); | 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 | u64 get_kvmclock_ns(struct kvm *kvm); | 253 | u64 get_kvmclock_ns(struct kvm *kvm); |
| 255 | 254 | ||
| 256 | int kvm_read_guest_virt(struct kvm_vcpu *vcpu, | 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 | * insn_fetch_from_user() - Copy instruction bytes from user-space memory | 1438 | * insn_fetch_from_user() - Copy instruction bytes from user-space memory |
| 1420 | * @regs: Structure with register values as seen when entering kernel mode | 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 | int insn_fetch_from_user(struct pt_regs *regs, unsigned char buf[MAX_INSN_SIZE]) | 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 | int not_copied; | 1454 | int not_copied; |
| 1436 | 1455 | ||
| 1437 | /* | 1456 | ip = insn_get_effective_ip(regs); |
| 1438 | * If not in user-space long mode, a custom code segment could be in | 1457 | if (!ip) |
| 1439 | * use. This is true in protected mode (if the process defined a local | 1458 | return 0; |
| 1440 | * descriptor table), or virtual-8086 mode. In most of the cases | 1459 | |
| 1441 | * seg_base will be zero as in USER_CS. | 1460 | not_copied = copy_from_user(buf, (void __user *)ip, MAX_INSN_SIZE); |
| 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 | } | ||
| 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), | 1489 | not_copied = __copy_from_user_inatomic(buf, (void __user *)ip, MAX_INSN_SIZE); |
| 1451 | MAX_INSN_SIZE); | ||
| 1452 | 1490 | ||
| 1453 | return MAX_INSN_SIZE - not_copied; | 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 | if (pgprot_val(old_prot) == pgprot_val(new_prot)) | 262 | if (pgprot_val(old_prot) == pgprot_val(new_prot)) |
| 263 | return; | 263 | return; |
| 264 | 264 | ||
| 265 | pa = pfn << page_level_shift(level); | 265 | pa = pfn << PAGE_SHIFT; |
| 266 | size = page_level_size(level); | 266 | size = page_level_size(level); |
| 267 | 267 | ||
| 268 | /* | 268 | /* |
| @@ -1349,6 +1349,7 @@ st: if (is_imm8(insn->off)) · 1348 unmodified lines | |||
| 1349 | insn->imm == (BPF_XOR | BPF_FETCH)) { | 1349 | insn->imm == (BPF_XOR | BPF_FETCH)) { |
| 1350 | u8 *branch_target; | 1350 | u8 *branch_target; |
| 1351 | bool is64 = BPF_SIZE(insn->code) == BPF_DW; | 1351 | bool is64 = BPF_SIZE(insn->code) == BPF_DW; |
| 1352 | u32 real_src_reg = src_reg; | ||
| 1352 | 1353 | ||
| 1353 | /* | 1354 | /* |
| 1354 | * Can't be implemented with a single x86 insn. | 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 | /* Will need RAX as a CMPXCHG operand so save R0 */ | 1359 | /* Will need RAX as a CMPXCHG operand so save R0 */ |
| 1359 | emit_mov_reg(&prog, true, BPF_REG_AX, BPF_REG_0); | 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 | branch_target = prog; | 1364 | branch_target = prog; |
| 1361 | /* Load old value */ | 1365 | /* Load old value */ |
| 1362 | emit_ldx(&prog, BPF_SIZE(insn->code), | 1366 | emit_ldx(&prog, BPF_SIZE(insn->code), |
| @@ -1366,9 +1370,9 @@ st: if (is_imm8(insn->off)) · 3 unmodified lines | |||
| 1366 | * put the result in the AUX_REG. | 1370 | * put the result in the AUX_REG. |
| 1367 | */ | 1371 | */ |
| 1368 | emit_mov_reg(&prog, is64, AUX_REG, BPF_REG_0); | 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 | EMIT2(simple_alu_opcodes[BPF_OP(insn->imm)], | 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 | /* Attempt to swap in new value */ | 1376 | /* Attempt to swap in new value */ |
| 1373 | err = emit_atomic(&prog, BPF_CMPXCHG, | 1377 | err = emit_atomic(&prog, BPF_CMPXCHG, |
| 1374 | dst_reg, AUX_REG, insn->off, | 1378 | dst_reg, AUX_REG, insn->off, |
| @@ -1381,7 +1385,7 @@ st: if (is_imm8(insn->off)) · 6 unmodified lines | |||
| 1381 | */ | 1385 | */ |
| 1382 | EMIT2(X86_JNE, -(prog - branch_target) - 2); | 1386 | EMIT2(X86_JNE, -(prog - branch_target) - 2); |
| 1383 | /* Return the pre-modification value */ | 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 | /* Restore R0 after clobbering RAX */ | 1389 | /* Restore R0 after clobbering RAX */ |
| 1386 | emit_mov_reg(&prog, true, BPF_REG_0, BPF_REG_AX); | 1390 | emit_mov_reg(&prog, true, BPF_REG_0, BPF_REG_AX); |
| 1387 | break; | 1391 | break; |
| @@ -1685,7 +1689,16 @@ emit_jmp: · 297 unmodified lines | |||
| 1685 | } | 1689 | } |
| 1686 | 1690 | ||
| 1687 | if (image) { | 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 | pr_err("bpf_jit: fatal error\n"); | 1702 | pr_err("bpf_jit: fatal error\n"); |
| 1690 | return -EFAULT; | 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 | * add rsp, 8 // skip eth_type_trans's frame | 1945 | * add rsp, 8 // skip eth_type_trans's frame |
| 1933 | * ret // return to its caller | 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 | const struct btf_func_model *m, u32 flags, | 1949 | const struct btf_func_model *m, u32 flags, |
| 1937 | struct bpf_tramp_progs *tprogs, | 1950 | struct bpf_tramp_progs *tprogs, |
| 1938 | void *orig_call) | 1951 | void *orig_call) |
| @@ -1971,6 +1984,15 @@ int arch_prepare_bpf_trampoline(void *image, void *image_end, · 32 unmodified lines | |||
| 1971 | 1984 | ||
| 1972 | save_regs(m, &prog, nr_args, stack_size); | 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 | if (fentry->nr_progs) | 1996 | if (fentry->nr_progs) |
| 1975 | if (invoke_bpf(m, &prog, fentry, stack_size)) | 1997 | if (invoke_bpf(m, &prog, fentry, stack_size)) |
| 1976 | return -EINVAL; | 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 | if (flags & BPF_TRAMP_F_CALL_ORIG) { | 2013 | if (flags & BPF_TRAMP_F_CALL_ORIG) { |
| 1992 | if (fentry->nr_progs || fmod_ret->nr_progs) | 2014 | restore_regs(m, &prog, nr_args, stack_size); |
| 1993 | restore_regs(m, &prog, nr_args, stack_size); | ||
| 1994 | 2015 | ||
| 1995 | /* call original function */ | 2016 | /* call original function */ |
| 1996 | if (emit_call(&prog, orig_call, prog)) { | 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 | /* remember return value in a stack for bpf prog to access */ | 2021 | /* remember return value in a stack for bpf prog to access */ |
| 2001 | emit_stx(&prog, BPF_DW, BPF_REG_FP, BPF_REG_0, -8); | 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 | if (fmod_ret->nr_progs) { | 2028 | if (fmod_ret->nr_progs) { |
| @@ -2029,9 +2053,17 @@ int arch_prepare_bpf_trampoline(void *image, void *image_end, · 24 unmodified lines | |||
| 2029 | * the return value is only updated on the stack and still needs to be | 2053 | * the return value is only updated on the stack and still needs to be |
| 2030 | * restored to R0. | 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 | /* restore original return value back into RAX */ | 2064 | /* restore original return value back into RAX */ |
| 2034 | emit_ldx(&prog, BPF_DW, BPF_REG_0, BPF_REG_FP, -8); | 2065 | emit_ldx(&prog, BPF_DW, BPF_REG_0, BPF_REG_FP, -8); |
| 2066 | } | ||
| 2035 | 2067 | ||
| 2036 | EMIT1(0x5B); /* pop rbx */ | 2068 | EMIT1(0x5B); /* pop rbx */ |
| 2037 | EMIT1(0xC9); /* leave */ | 2069 | EMIT1(0xC9); /* leave */ |
| @@ -2221,7 +2253,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog) · 183 unmodified lines | |||
| 2221 | padding = true; | 2253 | padding = true; |
| 2222 | goto skip_init_addrs; | 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 | if (!addrs) { | 2257 | if (!addrs) { |
| 2226 | prog = orig_prog; | 2258 | prog = orig_prog; |
| 2227 | goto out_addrs; | 2259 | goto out_addrs; |
| @@ -2313,7 +2345,7 @@ out_image: · 85 unmodified lines | |||
| 2313 | if (image) | 2345 | if (image) |
| 2314 | bpf_prog_fill_jited_linfo(prog, addrs + 1); | 2346 | bpf_prog_fill_jited_linfo(prog, addrs + 1); |
| 2315 | out_addrs: | 2347 | out_addrs: |
| 2316 | kfree(addrs); | 2348 | kvfree(addrs); |
| 2317 | kfree(jit_data); | 2349 | kfree(jit_data); |
| 2318 | prog->aux->jit_data = NULL; | 2350 | prog->aux->jit_data = NULL; |
| 2319 | } | 2351 | } |
| @@ -2276,7 +2276,16 @@ notyet: · 2275 unmodified lines | |||
| 2276 | } | 2276 | } |
| 2277 | 2277 | ||
| 2278 | if (image) { | 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 | pr_err("bpf_jit: fatal error\n"); | 2289 | pr_err("bpf_jit: fatal error\n"); |
| 2281 | return -EFAULT; | 2290 | return -EFAULT; |
| 2282 | } | 2291 | } |
| @@ -27,7 +27,6 @@ · 26 unmodified lines | |||
| 27 | MODULE_LICENSE("GPL"); | 27 | MODULE_LICENSE("GPL"); |
| 28 | MODULE_AUTHOR("Sébastien Hinderer <Sebastien.Hinderer@ens-lyon.org>"); | 28 | MODULE_AUTHOR("Sébastien Hinderer <Sebastien.Hinderer@ens-lyon.org>"); |
| 29 | MODULE_DESCRIPTION("A power_off handler for Iris devices from EuroBraille"); | 29 | MODULE_DESCRIPTION("A power_off handler for Iris devices from EuroBraille"); |
| 30 | MODULE_SUPPORTED_DEVICE("Eurobraille/Iris"); | ||
| 31 | 30 | ||
| 32 | static bool force; | 31 | static bool force; |
| 33 | 32 | ||
| @@ -98,8 +98,8 @@ EXPORT_SYMBOL_GPL(xen_p2m_size); · 97 unmodified lines | |||
| 98 | unsigned long xen_max_p2m_pfn __read_mostly; | 98 | unsigned long xen_max_p2m_pfn __read_mostly; |
| 99 | EXPORT_SYMBOL_GPL(xen_max_p2m_pfn); | 99 | EXPORT_SYMBOL_GPL(xen_max_p2m_pfn); |
| 100 | 100 | ||
| 101 | #ifdef CONFIG_XEN_BALLOON_MEMORY_HOTPLUG_LIMIT | 101 | #ifdef CONFIG_XEN_MEMORY_HOTPLUG_LIMIT |
| 102 | #define P2M_LIMIT CONFIG_XEN_BALLOON_MEMORY_HOTPLUG_LIMIT | 102 | #define P2M_LIMIT CONFIG_XEN_MEMORY_HOTPLUG_LIMIT |
| 103 | #else | 103 | #else |
| 104 | #define P2M_LIMIT 0 | 104 | #define P2M_LIMIT 0 |
| 105 | #endif | 105 | #endif |
| @@ -416,9 +416,6 @@ void __init xen_vmalloc_p2m_tree(void) · 310 unmodified lines | |||
| 416 | xen_p2m_last_pfn = xen_max_p2m_pfn; | 416 | xen_p2m_last_pfn = xen_max_p2m_pfn; |
| 417 | 417 | ||
| 418 | p2m_limit = (phys_addr_t)P2M_LIMIT * 1024 * 1024 * 1024 / PAGE_SIZE; | 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 | vm.flags = VM_ALLOC; | 419 | vm.flags = VM_ALLOC; |
| 423 | vm.size = ALIGN(sizeof(unsigned long) * max(xen_max_p2m_pfn, p2m_limit), | 420 | vm.size = ALIGN(sizeof(unsigned long) * max(xen_max_p2m_pfn, p2m_limit), |
| 424 | PMD_SIZE * PMDS_PER_MID_PAGE); | 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 | map_ops[i].status = GNTST_general_error; | 738 | map_ops[i].status = GNTST_general_error; |
| 742 | unmap[0].host_addr = map_ops[i].host_addr, | 739 | unmap[0].host_addr = map_ops[i].host_addr, |
| 743 | unmap[0].handle = map_ops[i].handle; | 740 | unmap[0].handle = map_ops[i].handle; |
| 744 | map_ops[i].handle = ~0; | 741 | map_ops[i].handle = INVALID_GRANT_HANDLE; |
| 745 | if (map_ops[i].flags & GNTMAP_device_map) | 742 | if (map_ops[i].flags & GNTMAP_device_map) |
| 746 | unmap[0].dev_bus_addr = map_ops[i].dev_bus_addr; | 743 | unmap[0].dev_bus_addr = map_ops[i].dev_bus_addr; |
| 747 | else | 744 | else |
| @@ -751,7 +748,7 @@ int set_foreign_p2m_mapping(struct gnttab_map_grant_ref *map_ops, · 3 unmodified lines | |||
| 751 | kmap_ops[i].status = GNTST_general_error; | 748 | kmap_ops[i].status = GNTST_general_error; |
| 752 | unmap[1].host_addr = kmap_ops[i].host_addr, | 749 | unmap[1].host_addr = kmap_ops[i].host_addr, |
| 753 | unmap[1].handle = kmap_ops[i].handle; | 750 | unmap[1].handle = kmap_ops[i].handle; |
| 754 | kmap_ops[i].handle = ~0; | 751 | kmap_ops[i].handle = INVALID_GRANT_HANDLE; |
| 755 | if (kmap_ops[i].flags & GNTMAP_device_map) | 752 | if (kmap_ops[i].flags & GNTMAP_device_map) |
| 756 | unmap[1].dev_bus_addr = kmap_ops[i].dev_bus_addr; | 753 | unmap[1].dev_bus_addr = kmap_ops[i].dev_bus_addr; |
| 757 | else | 754 | else |
| @@ -776,7 +773,6 @@ int set_foreign_p2m_mapping(struct gnttab_map_grant_ref *map_ops, · 18 unmodified lines | |||
| 776 | out: | 773 | out: |
| 777 | return ret; | 774 | return ret; |
| 778 | } | 775 | } |
| 779 | EXPORT_SYMBOL_GPL(set_foreign_p2m_mapping); | ||
| 780 | 776 | ||
| 781 | int clear_foreign_p2m_mapping(struct gnttab_unmap_grant_ref *unmap_ops, | 777 | int clear_foreign_p2m_mapping(struct gnttab_unmap_grant_ref *unmap_ops, |
| 782 | struct gnttab_unmap_grant_ref *kunmap_ops, | 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 | return ret; | 799 | return ret; |
| 804 | } | 800 | } |
| 805 | EXPORT_SYMBOL_GPL(clear_foreign_p2m_mapping); | ||
| 806 | 801 | ||
| 807 | #ifdef CONFIG_XEN_DEBUG_FS | 802 | #ifdef CONFIG_XEN_DEBUG_FS |
| 808 | #include <linux/debugfs.h> | 803 | #include <linux/debugfs.h> |
| @@ -59,6 +59,18 @@ static struct { · 58 unmodified lines | |||
| 59 | } xen_remap_buf __initdata __aligned(PAGE_SIZE); | 59 | } xen_remap_buf __initdata __aligned(PAGE_SIZE); |
| 60 | static unsigned long xen_remap_mfn __initdata = INVALID_P2M_ENTRY; | 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 | static bool xen_512gb_limit __initdata = IS_ENABLED(CONFIG_XEN_512GB); | 74 | static bool xen_512gb_limit __initdata = IS_ENABLED(CONFIG_XEN_512GB); |
| 63 | 75 | ||
| 64 | static void __init xen_parse_512gb(void) | 76 | static void __init xen_parse_512gb(void) |
| @@ -778,13 +790,13 @@ char * __init xen_memory_setup(void) · 713 unmodified lines | |||
| 778 | extra_pages += max_pages - max_pfn; | 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 | * factor the base size. | 794 | * factor the base size. |
| 783 | * | 795 | * |
| 784 | * Make sure we have no memory above max_pages, as this area | 796 | * Make sure we have no memory above max_pages, as this area |
| 785 | * isn't handled by the p2m management. | 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 | extra_pages, max_pages - max_pfn); | 800 | extra_pages, max_pages - max_pfn); |
| 789 | i = 0; | 801 | i = 0; |
| 790 | addr = xen_e820_table.entries[0].addr; | 802 | addr = xen_e820_table.entries[0].addr; |
| @@ -99,37 +99,6 @@ · 98 unmodified lines | |||
| 99 | LOAD_CP_REGS_TAB(6) | 99 | LOAD_CP_REGS_TAB(6) |
| 100 | LOAD_CP_REGS_TAB(7) | 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 | * Entry condition: | 103 | * Entry condition: |
| 135 | * | 104 | * |
| @@ -245,6 +214,39 @@ ENTRY(fast_coprocessor) · 109 unmodified lines | |||
| 245 | 214 | ||
| 246 | ENDPROC(fast_coprocessor) | 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 | .data | 250 | .data |
| 249 | 251 | ||
| 250 | ENTRY(coprocessor_owner) | 252 | ENTRY(coprocessor_owner) |
| @@ -112,8 +112,11 @@ good_area: · 111 unmodified lines | |||
| 112 | */ | 112 | */ |
| 113 | fault = handle_mm_fault(vma, address, flags, regs); | 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 | return; | 118 | return; |
| 119 | } | ||
| 117 | 120 | ||
| 118 | if (unlikely(fault & VM_FAULT_ERROR)) { | 121 | if (unlikely(fault & VM_FAULT_ERROR)) { |
| 119 | if (fault & VM_FAULT_OOM) | 122 | if (fault & VM_FAULT_OOM) |
| @@ -33,7 +33,7 @@ static struct biovec_slab { · 32 unmodified lines | |||
| 33 | { .nr_vecs = 16, .name = "biovec-16" }, | 33 | { .nr_vecs = 16, .name = "biovec-16" }, |
| 34 | { .nr_vecs = 64, .name = "biovec-64" }, | 34 | { .nr_vecs = 64, .name = "biovec-64" }, |
| 35 | { .nr_vecs = 128, .name = "biovec-128" }, | 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 | static struct biovec_slab *biovec_slab(unsigned short nr_vecs) | 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 | return &bvec_slabs[1]; | 46 | return &bvec_slabs[1]; |
| 47 | case 65 ... 128: | 47 | case 65 ... 128: |
| 48 | return &bvec_slabs[2]; | 48 | return &bvec_slabs[2]; |
| 49 | case 129 ... BIO_MAX_PAGES: | 49 | case 129 ... BIO_MAX_VECS: |
| 50 | return &bvec_slabs[3]; | 50 | return &bvec_slabs[3]; |
| 51 | default: | 51 | default: |
| 52 | BUG(); | 52 | BUG(); |
| @@ -151,9 +151,9 @@ out: · 98 unmodified lines | |||
| 151 | 151 | ||
| 152 | void bvec_free(mempool_t *pool, struct bio_vec *bv, unsigned short nr_vecs) | 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 | mempool_free(bv, pool); | 157 | mempool_free(bv, pool); |
| 158 | else if (nr_vecs > BIO_INLINE_VECS) | 158 | else if (nr_vecs > BIO_INLINE_VECS) |
| 159 | kmem_cache_free(biovec_slab(nr_vecs)->slab, bv); | 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 | * Try a slab allocation first for all smaller allocations. If that | 187 | * Try a slab allocation first for all smaller allocations. If that |
| 188 | * fails and __GFP_DIRECT_RECLAIM is set retry with the mempool. | 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 | struct bio_vec *bvl; | 192 | struct bio_vec *bvl; |
| 193 | 193 | ||
| 194 | bvl = kmem_cache_alloc(bvs->slab, bvec_alloc_gfp(gfp_mask)); | 194 | bvl = kmem_cache_alloc(bvs->slab, bvec_alloc_gfp(gfp_mask)); |
| 195 | if (likely(bvl) || !(gfp_mask & __GFP_DIRECT_RECLAIM)) | 195 | if (likely(bvl) || !(gfp_mask & __GFP_DIRECT_RECLAIM)) |
| 196 | return bvl; | 196 | return bvl; |
| 197 | *nr_vecs = BIO_MAX_PAGES; | 197 | *nr_vecs = BIO_MAX_VECS; |
| 198 | } | 198 | } |
| 199 | 199 | ||
| 200 | return mempool_alloc(pool, gfp_mask); | 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 | struct bio *parent = bio->bi_private; | 278 | struct bio *parent = bio->bi_private; |
| 279 | 279 | ||
| 280 | if (!parent->bi_status) | 280 | if (bio->bi_status && !parent->bi_status) |
| 281 | parent->bi_status = bio->bi_status; | 281 | parent->bi_status = bio->bi_status; |
| 282 | bio_put(bio); | 282 | bio_put(bio); |
| 283 | return parent; | 283 | return parent; |
| @@ -949,7 +949,7 @@ void bio_release_pages(struct bio *bio, bool mark_dirty) · 665 unmodified lines | |||
| 949 | } | 949 | } |
| 950 | EXPORT_SYMBOL_GPL(bio_release_pages); | 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 | WARN_ON_ONCE(bio->bi_max_vecs); | 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 | bio->bi_iter.bi_size = iter->count; | 959 | bio->bi_iter.bi_size = iter->count; |
| 960 | bio_set_flag(bio, BIO_NO_PAGE_REF); | 960 | bio_set_flag(bio, BIO_NO_PAGE_REF); |
| 961 | bio_set_flag(bio, BIO_CLONED); | 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 | iov_iter_advance(iter, iter->count); | 967 | iov_iter_advance(iter, iter->count); |
| 964 | return 0; | 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 | #define PAGE_PTRS_PER_BVEC (sizeof(struct bio_vec) / sizeof(struct page *)) | 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 | int ret = 0; | 1109 | int ret = 0; |
| 1095 | 1110 | ||
| 1096 | if (iov_iter_is_bvec(iter)) { | 1111 | if (iov_iter_is_bvec(iter)) { |
| 1097 | if (WARN_ON_ONCE(bio_op(bio) == REQ_OP_ZONE_APPEND)) | 1112 | if (bio_op(bio) == REQ_OP_ZONE_APPEND) |
| 1098 | return -EINVAL; | 1113 | return bio_iov_bvec_set_append(bio, iter); |
| 1099 | return bio_iov_bvec_set(bio, iter); | 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 | lockdep_assert_held(&blkg->q->queue_lock); | 110 | lockdep_assert_held(&blkg->q->queue_lock); |
| 111 | 111 | ||
| 112 | memset(sum, 0, sizeof(*sum)); | ||
| 112 | rcu_read_lock(); | 113 | rcu_read_lock(); |
| 113 | blkg_for_each_descendant_pre(pos_blkg, pos_css, blkg) { | 114 | blkg_for_each_descendant_pre(pos_blkg, pos_css, blkg) { |
| 114 | struct blkg_rwstat *rwstat; | 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 | rwstat = (void *)pos_blkg + off; | 123 | rwstat = (void *)pos_blkg + off; |
| 123 | 124 | ||
| 124 | for (i = 0; i < BLKG_RWSTAT_NR; i++) | 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 | rcu_read_unlock(); | 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 | bio_for_each_segment(bv, bio, iter) { | 220 | bio_for_each_segment(bv, bio, iter) { |
| 221 | num_sectors += bv.bv_len >> SECTOR_SHIFT; | 221 | num_sectors += bv.bv_len >> SECTOR_SHIFT; |
| 222 | if (++i == BIO_MAX_PAGES) | 222 | if (++i == BIO_MAX_VECS) |
| 223 | break; | 223 | break; |
| 224 | } | 224 | } |
| 225 | if (num_sectors < bio_sectors(bio)) { | 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 | sector_t pages = DIV_ROUND_UP_SECTOR_T(nr_sects, PAGE_SIZE / 512); | 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 | static int __blkdev_issue_zero_pages(struct block_device *bdev, | 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 | if (!iov_iter_count(iter)) | 249 | if (!iov_iter_count(iter)) |
| 250 | return -EINVAL; | 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 | if (!bio) | 253 | if (!bio) |
| 254 | return -ENOMEM; | 254 | return -ENOMEM; |
| 255 | bio->bi_opf |= req_op(rq); | 255 | bio->bi_opf |= req_op(rq); |
| @@ -382,6 +382,14 @@ unsigned int blk_recalc_rq_segments(struct request *rq) · 381 unmodified lines | |||
| 382 | switch (bio_op(rq->bio)) { | 382 | switch (bio_op(rq->bio)) { |
| 383 | case REQ_OP_DISCARD: | 383 | case REQ_OP_DISCARD: |
| 384 | case REQ_OP_SECURE_ERASE: | 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 | case REQ_OP_WRITE_ZEROES: | 393 | case REQ_OP_WRITE_ZEROES: |
| 386 | return 0; | 394 | return 0; |
| 387 | case REQ_OP_WRITE_SAME: | 395 | case REQ_OP_WRITE_SAME: |
| @@ -302,7 +302,6 @@ static const char *const rqf_name[] = { · 301 unmodified lines | |||
| 302 | RQF_NAME(QUIET), | 302 | RQF_NAME(QUIET), |
| 303 | RQF_NAME(ELVPRIV), | 303 | RQF_NAME(ELVPRIV), |
| 304 | RQF_NAME(IO_STAT), | 304 | RQF_NAME(IO_STAT), |
| 305 | RQF_NAME(ALLOCED), | ||
| 306 | RQF_NAME(PM), | 305 | RQF_NAME(PM), |
| 307 | RQF_NAME(HASHED), | 306 | RQF_NAME(HASHED), |
| 308 | RQF_NAME(STATS), | 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 | if (op == REQ_OP_ZONE_RESET && | 241 | if (op == REQ_OP_ZONE_RESET && |
| 242 | blkdev_allow_reset_all_zones(bdev, sector, nr_sectors)) { | 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 | break; | 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 | return 0; | 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 | * BLKRESETZONE, BLKOPENZONE, BLKCLOSEZONE and BLKFINISHZONE ioctl processing. | 338 | * BLKRESETZONE, BLKOPENZONE, BLKCLOSEZONE and BLKFINISHZONE ioctl processing. |
| 323 | * Called from blkdev_ioctl. | 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 | struct request_queue *q; | 345 | struct request_queue *q; |
| 330 | struct blk_zone_range zrange; | 346 | struct blk_zone_range zrange; |
| 331 | enum req_opf op; | 347 | enum req_opf op; |
| 348 | int ret; | ||
| 332 | 349 | ||
| 333 | if (!argp) | 350 | if (!argp) |
| 334 | return -EINVAL; | 351 | return -EINVAL; |
| @@ -352,6 +369,11 @@ int blkdev_zone_mgmt_ioctl(struct block_device *bdev, fmode_t mode, · 17 unmodified lines | |||
| 352 | switch (cmd) { | 369 | switch (cmd) { |
| 353 | case BLKRESETZONE: | 370 | case BLKRESETZONE: |
| 354 | op = REQ_OP_ZONE_RESET; | 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 | break; | 377 | break; |
| 356 | case BLKOPENZONE: | 378 | case BLKOPENZONE: |
| 357 | op = REQ_OP_ZONE_OPEN; | 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 | return -ENOTTY; | 388 | return -ENOTTY; |
| 367 | } | 389 | } |
| 368 | 390 | ||
| 369 | return blkdev_zone_mgmt(bdev, op, zrange.sector, zrange.nr_sectors, | 391 | ret = blkdev_zone_mgmt(bdev, op, zrange.sector, zrange.nr_sectors, |
| 370 | GFP_KERNEL); | 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 | static inline unsigned long *blk_alloc_zone_bitmap(int node, | 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 | * - The point of cloning the biovec is to produce a bio with a biovec | 229 | * - The point of cloning the biovec is to produce a bio with a biovec |
| 230 | * the caller can modify: bi_idx and bi_bvec_done should be 0. | 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 | * we tried to clone the whole thing bio_alloc_bioset() would fail. | 233 | * we tried to clone the whole thing bio_alloc_bioset() would fail. |
| 234 | * But the clone should succeed as long as the number of biovecs we | 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 | * - Lastly, bi_vcnt should not be looked at or relied upon by code | 237 | * - Lastly, bi_vcnt should not be looked at or relied upon by code |
| 238 | * that does not own the bio - reason being drivers don't use it for | 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 | int sectors = 0; | 299 | int sectors = 0; |
| 300 | 300 | ||
| 301 | bio_for_each_segment(from, *bio_orig, iter) { | 301 | bio_for_each_segment(from, *bio_orig, iter) { |
| 302 | if (i++ < BIO_MAX_PAGES) | 302 | if (i++ < BIO_MAX_VECS) |
| 303 | sectors += from.bv_len >> 9; | 303 | sectors += from.bv_len >> 9; |
| 304 | if (page_to_pfn(from.bv_page) > q->limits.bounce_pfn) | 304 | if (page_to_pfn(from.bv_page) > q->limits.bounce_pfn) |
| 305 | bounce = true; | 305 | bounce = true; |
| @@ -534,10 +534,8 @@ static void register_disk(struct device *parent, struct gendisk *disk, · 533 unmodified lines | |||
| 534 | kobject_create_and_add("holders", &ddev->kobj); | 534 | kobject_create_and_add("holders", &ddev->kobj); |
| 535 | disk->slave_dir = kobject_create_and_add("slaves", &ddev->kobj); | 535 | disk->slave_dir = kobject_create_and_add("slaves", &ddev->kobj); |
| 536 | 536 | ||
| 537 | if (disk->flags & GENHD_FL_HIDDEN) { | 537 | if (disk->flags & GENHD_FL_HIDDEN) |
| 538 | dev_set_uevent_suppress(ddev, 0); | ||
| 539 | return; | 538 | return; |
| 540 | } | ||
| 541 | 539 | ||
| 542 | disk_scan_partitions(disk); | 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 | const char *dname; | 322 | const char *dname; |
| 323 | int err; | 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 | * Partitions are not supported on zoned block devices that are used as | 333 | * Partitions are not supported on zoned block devices that are used as |
| 327 | * such. | 334 | * such. |
| @@ -767,7 +767,7 @@ config CRYPTO_POLY1305_X86_64 · 766 unmodified lines | |||
| 767 | 767 | ||
| 768 | config CRYPTO_POLY1305_MIPS | 768 | config CRYPTO_POLY1305_MIPS |
| 769 | tristate "Poly1305 authenticator algorithm (MIPS optimized)" | 769 | tristate "Poly1305 authenticator algorithm (MIPS optimized)" |
| 770 | depends on CPU_MIPS32 || (CPU_MIPS64 && 64BIT) | 770 | depends on MIPS |
| 771 | select CRYPTO_ARCH_HAVE_LIB_POLY1305 | 771 | select CRYPTO_ARCH_HAVE_LIB_POLY1305 |
| 772 | 772 | ||
| 773 | config CRYPTO_MD4 | 773 | config CRYPTO_MD4 |
| @@ -99,13 +99,12 @@ acpi_status acpi_ns_root_initialize(void) · 98 unmodified lines | |||
| 99 | * just create and link the new node(s) here. | 99 | * just create and link the new node(s) here. |
| 100 | */ | 100 | */ |
| 101 | new_node = | 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 | if (!new_node) { | 103 | if (!new_node) { |
| 104 | status = AE_NO_MEMORY; | 104 | status = AE_NO_MEMORY; |
| 105 | goto unlock_and_exit; | 105 | goto unlock_and_exit; |
| 106 | } | 106 | } |
| 107 | 107 | ||
| 108 | ACPI_COPY_NAMESEG(new_node->name.ascii, init_val->name); | ||
| 109 | new_node->descriptor_type = ACPI_DESC_TYPE_NAMED; | 108 | new_node->descriptor_type = ACPI_DESC_TYPE_NAMED; |
| 110 | new_node->type = init_val->type; | 109 | new_node->type = init_val->type; |
| 111 | 110 | ||
| @@ -9,6 +9,8 @@ · 8 unmodified lines | |||
| 9 | #ifndef _ACPI_INTERNAL_H_ | 9 | #ifndef _ACPI_INTERNAL_H_ |
| 10 | #define _ACPI_INTERNAL_H_ | 10 | #define _ACPI_INTERNAL_H_ |
| 11 | 11 | ||
| 12 | #include <linux/idr.h> | ||
| 13 | |||
| 12 | #define PREFIX "ACPI: " | 14 | #define PREFIX "ACPI: " |
| 13 | 15 | ||
| 14 | int early_acpi_osi_init(void); | 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 | extern struct list_head acpi_bus_id_list; | 99 | extern struct list_head acpi_bus_id_list; |
| 98 | 100 | ||
| 101 | #define ACPI_MAX_DEVICE_INSTANCES 4096 | ||
| 102 | |||
| 99 | struct acpi_device_bus_id { | 103 | struct acpi_device_bus_id { |
| 100 | const char *bus_id; | 104 | const char *bus_id; |
| 101 | unsigned int instance_no; | 105 | struct ida instance_ida; |
| 102 | struct list_head node; | 106 | struct list_head node; |
| 103 | }; | 107 | }; |
| 104 | 108 | ||
| @@ -29,6 +29,7 @@ · 28 unmodified lines | |||
| 29 | */ | 29 | */ |
| 30 | #ifdef CONFIG_X86 | 30 | #ifdef CONFIG_X86 |
| 31 | #include <asm/apic.h> | 31 | #include <asm/apic.h> |
| 32 | #include <asm/cpu.h> | ||
| 32 | #endif | 33 | #endif |
| 33 | 34 | ||
| 34 | #define _COMPONENT ACPI_PROCESSOR_COMPONENT | 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 | wait_for_freeze(); | 542 | wait_for_freeze(); |
| 542 | } else | 543 | } else |
| 543 | return -ENODEV; | 544 | return -ENODEV; |
| 545 | |||
| 546 | #if defined(CONFIG_X86) && defined(CONFIG_HOTPLUG_CPU) | ||
| 547 | cond_wakeup_cpu0(); | ||
| 548 | #endif | ||
| 544 | } | 549 | } |
| 545 | 550 | ||
| 546 | /* Never reached */ | 551 | /* Never reached */ |
| @@ -479,9 +479,8 @@ static void acpi_device_del(struct acpi_device *device) · 478 unmodified lines | |||
| 479 | list_for_each_entry(acpi_device_bus_id, &acpi_bus_id_list, node) | 479 | list_for_each_entry(acpi_device_bus_id, &acpi_bus_id_list, node) |
| 480 | if (!strcmp(acpi_device_bus_id->bus_id, | 480 | if (!strcmp(acpi_device_bus_id->bus_id, |
| 481 | acpi_device_hid(device))) { | 481 | acpi_device_hid(device))) { |
| 482 | if (acpi_device_bus_id->instance_no > 0) | 482 | ida_simple_remove(&acpi_device_bus_id->instance_ida, device->pnp.instance_no); |
| 483 | acpi_device_bus_id->instance_no--; | 483 | if (ida_is_empty(&acpi_device_bus_id->instance_ida)) { |
| 484 | else { | ||
| 485 | list_del(&acpi_device_bus_id->node); | 484 | list_del(&acpi_device_bus_id->node); |
| 486 | kfree_const(acpi_device_bus_id->bus_id); | 485 | kfree_const(acpi_device_bus_id->bus_id); |
| 487 | kfree(acpi_device_bus_id); | 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 | return NULL; | 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 | int acpi_device_add(struct acpi_device *device, | 648 | int acpi_device_add(struct acpi_device *device, |
| 635 | void (*release)(struct device *)) | 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 | acpi_device_bus_id = acpi_device_bus_id_match(acpi_device_hid(device)); | 680 | acpi_device_bus_id = acpi_device_bus_id_match(acpi_device_hid(device)); |
| 667 | if (acpi_device_bus_id) { | 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 | } else { | 685 | } else { |
| 670 | acpi_device_bus_id = kzalloc(sizeof(*acpi_device_bus_id), | 686 | acpi_device_bus_id = kzalloc(sizeof(*acpi_device_bus_id), |
| 671 | GFP_KERNEL); | 687 | GFP_KERNEL); |
| @@ -681,9 +697,16 @@ int acpi_device_add(struct acpi_device *device, · 9 unmodified lines | |||
| 681 | goto err_unlock; | 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 | list_add_tail(&acpi_device_bus_id->node, &acpi_bus_id_list); | 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 | if (device->parent) | 711 | if (device->parent) |
| 689 | list_add_tail(&device->node, &device->parent->children); | 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 | device_initialize(&device->dev); | 1670 | device_initialize(&device->dev); |
| 1648 | dev_set_uevent_suppress(&device->dev, true); | 1671 | dev_set_uevent_suppress(&device->dev, true); |
| 1649 | acpi_init_coherency(device); | 1672 | acpi_init_coherency(device); |
| 1673 | /* Assume there are unmet deps to start with. */ | ||
| 1674 | device->dep_unmet = 1; | ||
| 1650 | } | 1675 | } |
| 1651 | 1676 | ||
| 1652 | void acpi_device_add_finalize(struct acpi_device *device) | 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 | struct acpi_dep_data *dep; | 1936 | struct acpi_dep_data *dep; |
| 1912 | 1937 | ||
| 1938 | adev->dep_unmet = 0; | ||
| 1939 | |||
| 1913 | mutex_lock(&acpi_dep_list_lock); | 1940 | mutex_lock(&acpi_dep_list_lock); |
| 1914 | 1941 | ||
| 1915 | list_for_each_entry(dep, &acpi_dep_list, node) { | 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 | return AE_CTRL_DEPTH; | 1984 | return AE_CTRL_DEPTH; |
| 1958 | 1985 | ||
| 1959 | acpi_scan_init_hotplug(device); | 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 | acpi_scan_dep_init(device); | 1994 | acpi_scan_dep_init(device); |
| 1962 | 1995 | ||
| 1963 | out: | 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 | * find RSDP, find and checksum SDT/XSDT. | 785 | * find RSDP, find and checksum SDT/XSDT. |
| 786 | * checksum all tables, print SDT/XSDT | 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 | * result: sdt_entry[] is initialized | 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 | acpi_status status; | 793 | acpi_status status; |
| 794 | 794 | ||
| @@ -803,9 +803,45 @@ int __init acpi_table_init(void) · 8 unmodified lines | |||
| 803 | status = acpi_initialize_tables(initial_tables, ACPI_MAX_TABLES, 0); | 803 | status = acpi_initialize_tables(initial_tables, ACPI_MAX_TABLES, 0); |
| 804 | if (ACPI_FAILURE(status)) | 804 | if (ACPI_FAILURE(status)) |
| 805 | return -EINVAL; | 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 | check_multiple_madt(); | 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 | return 0; | 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 | .ident = "Sony VPCEH3U1E", | 151 | .ident = "Sony VPCEH3U1E", |
| 151 | .matches = { | 152 | .matches = { |
| 152 | DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), | 153 | DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), |
| @@ -2260,7 +2260,8 @@ out: · 2259 unmodified lines | |||
| 2260 | return rc; | 2260 | return rc; |
| 2261 | 2261 | ||
| 2262 | err_eni_release: | 2262 | err_eni_release: |
| 2263 | eni_do_release(dev); | 2263 | dev->phy = NULL; |
| 2264 | iounmap(ENI_DEV(dev)->ioaddr); | ||
| 2264 | err_unregister: | 2265 | err_unregister: |
| 2265 | atm_dev_deregister(dev); | 2266 | atm_dev_deregister(dev); |
| 2266 | err_free_consistent: | 2267 | err_free_consistent: |
| @@ -100,8 +100,6 @@ static LIST_HEAD(fore200e_boards); · 99 unmodified lines | |||
| 100 | 100 | ||
| 101 | MODULE_AUTHOR("Christophe Lizzi - credits to Uwe Dannowski and Heikki Vatiainen"); | 101 | MODULE_AUTHOR("Christophe Lizzi - credits to Uwe Dannowski and Heikki Vatiainen"); |
| 102 | MODULE_DESCRIPTION("FORE Systems 200E-series ATM driver - version " FORE200E_VERSION); | 102 | MODULE_DESCRIPTION("FORE Systems 200E-series ATM driver - version " FORE200E_VERSION); |
| 103 | MODULE_SUPPORTED_DEVICE("PCA-200E, SBA-200E"); | ||
| 104 | |||
| 105 | 103 | ||
| 106 | static const int fore200e_rx_buf_nbr[ BUFFER_SCHEME_NBR ][ BUFFER_MAGN_NBR ] = { | 104 | static const int fore200e_rx_buf_nbr[ BUFFER_SCHEME_NBR ][ BUFFER_MAGN_NBR ] = { |
| 107 | { BUFFER_S1_NBR, BUFFER_L1_NBR }, | 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 | unsigned long flags; | 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 | return -ENOMEM; | 266 | return -ENOMEM; |
| 267 | PRIV(dev)->dev = dev; | 267 | PRIV(dev)->dev = dev; |
| 268 | spin_lock_irqsave(&idt77105_priv_lock, flags); | 268 | spin_lock_irqsave(&idt77105_priv_lock, flags); |
| @@ -337,7 +337,7 @@ static int idt77105_stop(struct atm_dev *dev) · 68 unmodified lines | |||
| 337 | else | 337 | else |
| 338 | idt77105_all = walk->next; | 338 | idt77105_all = walk->next; |
| 339 | dev->phy = NULL; | 339 | dev->phy = NULL; |
| 340 | dev->dev_data = NULL; | 340 | dev->phy_data = NULL; |
| 341 | kfree(walk); | 341 | kfree(walk); |
| 342 | break; | 342 | break; |
| 343 | } | 343 | } |
| @@ -2233,6 +2233,7 @@ static int lanai_dev_open(struct atm_dev *atmdev) · 2232 unmodified lines | |||
| 2233 | conf1_write(lanai); | 2233 | conf1_write(lanai); |
| 2234 | #endif | 2234 | #endif |
| 2235 | iounmap(lanai->base); | 2235 | iounmap(lanai->base); |
| 2236 | lanai->base = NULL; | ||
| 2236 | error_pci: | 2237 | error_pci: |
| 2237 | pci_disable_device(lanai->pci); | 2238 | pci_disable_device(lanai->pci); |
| 2238 | error: | 2239 | error: |
| @@ -2245,6 +2246,8 @@ static int lanai_dev_open(struct atm_dev *atmdev) · 6 unmodified lines | |||
| 2245 | static void lanai_dev_close(struct atm_dev *atmdev) | 2246 | static void lanai_dev_close(struct atm_dev *atmdev) |
| 2246 | { | 2247 | { |
| 2247 | struct lanai_dev *lanai = (struct lanai_dev *) atmdev->dev_data; | 2248 | struct lanai_dev *lanai = (struct lanai_dev *) atmdev->dev_data; |
| 2249 | if (lanai->base==NULL) | ||
| 2250 | return; | ||
| 2248 | printk(KERN_INFO DEV_LABEL "(itf %d): shutting down interface\n", | 2251 | printk(KERN_INFO DEV_LABEL "(itf %d): shutting down interface\n", |
| 2249 | lanai->number); | 2252 | lanai->number); |
| 2250 | lanai_timed_poll_stop(lanai); | 2253 | lanai_timed_poll_stop(lanai); |
| @@ -2552,7 +2555,7 @@ static int lanai_init_one(struct pci_dev *pci, · 301 unmodified lines | |||
| 2552 | struct atm_dev *atmdev; | 2555 | struct atm_dev *atmdev; |
| 2553 | int result; | 2556 | int result; |
| 2554 | 2557 | ||
| 2555 | lanai = kmalloc(sizeof(*lanai), GFP_KERNEL); | 2558 | lanai = kzalloc(sizeof(*lanai), GFP_KERNEL); |
| 2556 | if (lanai == NULL) { | 2559 | if (lanai == NULL) { |
| 2557 | printk(KERN_ERR DEV_LABEL | 2560 | printk(KERN_ERR DEV_LABEL |
| 2558 | ": couldn't allocate dev_data structure!\n"); | 2561 | ": couldn't allocate dev_data structure!\n"); |
| @@ -211,7 +211,7 @@ static void uPD98402_int(struct atm_dev *dev) · 210 unmodified lines | |||
| 211 | static int uPD98402_start(struct atm_dev *dev) | 211 | static int uPD98402_start(struct atm_dev *dev) |
| 212 | { | 212 | { |
| 213 | DPRINTK("phy_start\n"); | 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 | return -ENOMEM; | 215 | return -ENOMEM; |
| 216 | spin_lock_init(&PRIV(dev)->lock); | 216 | spin_lock_init(&PRIV(dev)->lock); |
| 217 | memset(&PRIV(dev)->sonet_stats,0,sizeof(struct k_sonet_stats)); | 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 | char c; | 470 | char c; |
| 471 | 471 | ||
| 472 | for (; count-- > 0; (*ppos)++, tmp++) { | 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 | 475 | * charlcd_write() is invoked as a VFS->write() callback |
| 476 | * that need some CPU | 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 | if (get_user(c, tmp)) | 482 | if (get_user(c, tmp)) |
| 481 | return -EFAULT; | 483 | return -EFAULT; |
| @@ -537,12 +539,8 @@ static void charlcd_puts(struct charlcd *lcd, const char *s) · 55 unmodified lines | |||
| 537 | int count = strlen(s); | 539 | int count = strlen(s); |
| 538 | 540 | ||
| 539 | for (; count-- > 0; tmp++) { | 541 | for (; count-- > 0; tmp++) { |
| 540 | if (!in_interrupt() && (((count + 1) & 0x1f) == 0)) | 542 | if (((count + 1) & 0x1f) == 0) |
| 541 | /* | 543 | cond_resched(); |
| 542 | * let's be a little nice with other processes | ||
| 543 | * that need some CPU | ||
| 544 | */ | ||
| 545 | schedule(); | ||
| 546 | 544 | ||
| 547 | charlcd_write_char(lcd, *tmp); | 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 | get_device(dev); | 98 | get_device(dev); |
| 99 | 99 | ||
| 100 | kfree(dev->p->deferred_probe_reason); | ||
| 101 | dev->p->deferred_probe_reason = NULL; | ||
| 102 | |||
| 100 | /* | 103 | /* |
| 101 | * Drop the mutex while probing each device; the probe path may | 104 | * Drop the mutex while probing each device; the probe path may |
| 102 | * manipulate the deferred list | 105 | * manipulate the deferred list |
| @@ -289,14 +292,16 @@ int driver_deferred_probe_check_state(struct device *dev) · 186 unmodified lines | |||
| 289 | 292 | ||
| 290 | static void deferred_probe_timeout_work_func(struct work_struct *work) | 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 | driver_deferred_probe_timeout = 0; | 297 | driver_deferred_probe_timeout = 0; |
| 295 | driver_deferred_probe_trigger(); | 298 | driver_deferred_probe_trigger(); |
| 296 | flush_work(&deferred_probe_work); | 299 | flush_work(&deferred_probe_work); |
| 297 | 300 | ||
| 298 | list_for_each_entry_safe(private, p, &deferred_probe_pending_list, deferred_probe) | 301 | mutex_lock(&deferred_probe_mutex); |
| 299 | dev_info(private->device, "deferred probe pending\n"); | 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 | wake_up_all(&probe_timeout_waitqueue); | 305 | wake_up_all(&probe_timeout_waitqueue); |
| 301 | } | 306 | } |
| 302 | static DECLARE_DELAYED_WORK(deferred_probe_timeout_work, deferred_probe_timeout_work_func); | 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 | return 0; | 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 | struct device_link *link; | 310 | struct device_link *link; |
| 311 | 311 | ||
| @@ -313,10 +313,30 @@ static void rpm_put_suppliers(struct device *dev) · 1 unmodified line | |||
| 313 | device_links_read_lock_held()) { | 313 | device_links_read_lock_held()) { |
| 314 | 314 | ||
| 315 | while (refcount_dec_not_one(&link->rpm_active)) | 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 | * __rpm_callback - Run a given runtime PM callback for a given device. | 341 | * __rpm_callback - Run a given runtime PM callback for a given device. |
| 322 | * @cb: Runtime PM callback to run. | 342 | * @cb: Runtime PM callback to run. |
| @@ -325,27 +345,29 @@ static void rpm_put_suppliers(struct device *dev) · 2 unmodified lines | |||
| 325 | static int __rpm_callback(int (*cb)(struct device *), struct device *dev) | 345 | static int __rpm_callback(int (*cb)(struct device *), struct device *dev) |
| 326 | __releases(&dev->power.lock) __acquires(&dev->power.lock) | 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 | int retval, idx; | 348 | int retval, idx; |
| 331 | bool put; | 349 | bool use_links = dev->power.links_count > 0; |
| 332 | 350 | ||
| 333 | if (dev->power.irq_safe) { | 351 | if (dev->power.irq_safe) { |
| 334 | spin_unlock(&dev->power.lock); | 352 | spin_unlock(&dev->power.lock); |
| 335 | } else if (!use_links) { | ||
| 336 | spin_unlock_irq(&dev->power.lock); | ||
| 337 | } else { | 353 | } else { |
| 338 | get = dev->power.runtime_status == RPM_RESUMING; | ||
| 339 | |||
| 340 | spin_unlock_irq(&dev->power.lock); | 354 | spin_unlock_irq(&dev->power.lock); |
| 341 | 355 | ||
| 342 | /* Resume suppliers if necessary. */ | 356 | /* |
| 343 | if (get) { | 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 | idx = device_links_read_lock(); | 364 | idx = device_links_read_lock(); |
| 345 | 365 | ||
| 346 | retval = rpm_get_suppliers(dev); | 366 | retval = rpm_get_suppliers(dev); |
| 347 | if (retval) | 367 | if (retval) { |
| 368 | rpm_put_suppliers(dev); | ||
| 348 | goto fail; | 369 | goto fail; |
| 370 | } | ||
| 349 | 371 | ||
| 350 | device_links_read_unlock(idx); | 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 | if (dev->power.irq_safe) { | 378 | if (dev->power.irq_safe) { |
| 357 | spin_lock(&dev->power.lock); | 379 | spin_lock(&dev->power.lock); |
| 358 | return retval; | 380 | } else { |
| 359 | } | 381 | /* |
| 360 | 382 | * If the device is suspending and the callback has returned | |
| 361 | spin_lock_irq(&dev->power.lock); | 383 | * success, drop the usage counters of the suppliers that have |
| 362 | 384 | * been reference counted on its resume. | |
| 363 | if (!use_links) | 385 | * |
| 364 | return retval; | 386 | * Do that if resume fails too. |
| 365 | 387 | */ | |
| 366 | /* | 388 | if (use_links |
| 367 | * If the device is suspending and the callback has returned success, | 389 | && ((dev->power.runtime_status == RPM_SUSPENDING && !retval) |
| 368 | * drop the usage counters of the suppliers that have been reference | 390 | || (dev->power.runtime_status == RPM_RESUMING && retval))) { |
| 369 | * counted on its resume. | 391 | idx = device_links_read_lock(); |
| 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); | ||
| 381 | 392 | ||
| 382 | idx = device_links_read_lock(); | 393 | __rpm_put_suppliers(dev, false); |
| 383 | 394 | ||
| 384 | fail: | 395 | fail: |
| 385 | rpm_put_suppliers(dev); | 396 | device_links_read_unlock(idx); |
| 386 | 397 | } | |
| 387 | device_links_read_unlock(idx); | ||
| 388 | 398 | ||
| 389 | spin_lock_irq(&dev->power.lock); | 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 | goto out; | 664 | goto out; |
| 655 | } | 665 | } |
| 656 | 666 | ||
| 667 | if (dev->power.irq_safe) | ||
| 668 | goto out; | ||
| 669 | |||
| 657 | /* Maybe the parent is now able to suspend. */ | 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 | spin_unlock(&dev->power.lock); | 672 | spin_unlock(&dev->power.lock); |
| 660 | 673 | ||
| 661 | spin_lock(&parent->power.lock); | 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 | spin_lock(&dev->power.lock); | 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 | out: | 689 | out: |
| 669 | trace_rpm_return_int_rcuidle(dev, _THIS_IP_, retval); | 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 | device_links_read_lock_held()) | 1690 | device_links_read_lock_held()) |
| 1670 | if (link->flags & DL_FLAG_PM_RUNTIME) { | 1691 | if (link->flags & DL_FLAG_PM_RUNTIME) { |
| 1671 | link->supplier_preactivated = true; | 1692 | link->supplier_preactivated = true; |
| 1672 | refcount_inc(&link->rpm_active); | ||
| 1673 | pm_runtime_get_sync(link->supplier); | 1693 | pm_runtime_get_sync(link->supplier); |
| 1694 | refcount_inc(&link->rpm_active); | ||
| 1674 | } | 1695 | } |
| 1675 | 1696 | ||
| 1676 | device_links_read_unlock(idx); | 1697 | device_links_read_unlock(idx); |
| @@ -1683,6 +1704,8 @@ void pm_runtime_get_suppliers(struct device *dev) · 6 unmodified lines | |||
| 1683 | void pm_runtime_put_suppliers(struct device *dev) | 1704 | void pm_runtime_put_suppliers(struct device *dev) |
| 1684 | { | 1705 | { |
| 1685 | struct device_link *link; | 1706 | struct device_link *link; |
| 1707 | unsigned long flags; | ||
| 1708 | bool put; | ||
| 1686 | int idx; | 1709 | int idx; |
| 1687 | 1710 | ||
| 1688 | idx = device_links_read_lock(); | 1711 | idx = device_links_read_lock(); |
| @@ -1691,7 +1714,11 @@ void pm_runtime_put_suppliers(struct device *dev) · 2 unmodified lines | |||
| 1691 | device_links_read_lock_held()) | 1714 | device_links_read_lock_held()) |
| 1692 | if (link->supplier_preactivated) { | 1715 | if (link->supplier_preactivated) { |
| 1693 | link->supplier_preactivated = false; | 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 | pm_runtime_put(link->supplier); | 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 | if (software_node_to_swnode(node)) | 938 | if (software_node_to_swnode(node)) |
| 939 | return -EEXIST; | 939 | return -EEXIST; |
| 940 | 940 | ||
| 941 | if (node->parent && !parent) | ||
| 942 | return -EINVAL; | ||
| 943 | |||
| 941 | return PTR_ERR_OR_ZERO(swnode_register(node, parent, 0)); | 944 | return PTR_ERR_OR_ZERO(swnode_register(node, parent, 0)); |
| 942 | } | 945 | } |
| 943 | EXPORT_SYMBOL_GPL(software_node_register); | 946 | EXPORT_SYMBOL_GPL(software_node_register); |
| @@ -1002,25 +1005,33 @@ EXPORT_SYMBOL_GPL(fwnode_remove_software_node); · 58 unmodified lines | |||
| 1002 | /** | 1005 | /** |
| 1003 | * device_add_software_node - Assign software node to a device | 1006 | * device_add_software_node - Assign software node to a device |
| 1004 | * @dev: The device the software node is meant for. | 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 | 1010 | * This function will make @node the secondary firmware node pointer of @dev. If |
| 1008 | * pointer of @dev. If @dev has no primary node, then @swnode will become the primary | 1011 | * @dev has no primary node, then @node will become the primary node. The |
| 1009 | * node. | 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 | int ret; | 1017 | int ret; |
| 1014 | 1018 | ||
| 1015 | /* Only one software node per device. */ | 1019 | /* Only one software node per device. */ |
| 1016 | if (dev_to_swnode(dev)) | 1020 | if (dev_to_swnode(dev)) |
| 1017 | return -EBUSY; | 1021 | return -EBUSY; |
| 1018 | 1022 | ||
| 1019 | ret = software_node_register(swnode); | 1023 | swnode = software_node_to_swnode(node); |
| 1020 | if (ret) | 1024 | if (swnode) { |
| 1021 | return ret; | 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 | return 0; | 1036 | return 0; |
| 1026 | } | 1037 | } |
| @@ -1324,7 +1324,7 @@ struct bm_extent { · 1323 unmodified lines | |||
| 1324 | * A followup commit may allow even bigger BIO sizes, | 1324 | * A followup commit may allow even bigger BIO sizes, |
| 1325 | * once we thought that through. */ | 1325 | * once we thought that through. */ |
| 1326 | #define DRBD_MAX_BIO_SIZE (1U << 20) | 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 | #error Architecture not supported: DRBD_MAX_BIO_SIZE > BIO_MAX_SIZE | 1328 | #error Architecture not supported: DRBD_MAX_BIO_SIZE > BIO_MAX_SIZE |
| 1329 | #endif | 1329 | #endif |
| 1330 | #define DRBD_MAX_BIO_SIZE_SAFE (1U << 12) /* Works always = 4k */ | 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 | module_param(FLOPPY_IRQ, int, 0); | 5091 | module_param(FLOPPY_IRQ, int, 0); |
| 5092 | module_param(FLOPPY_DMA, int, 0); | 5092 | module_param(FLOPPY_DMA, int, 0); |
| 5093 | MODULE_AUTHOR("Alain L. Knaff"); | 5093 | MODULE_AUTHOR("Alain L. Knaff"); |
| 5094 | MODULE_SUPPORTED_DEVICE("fd"); | ||
| 5095 | MODULE_LICENSE("GPL"); | 5094 | MODULE_LICENSE("GPL"); |
| 5096 | 5095 | ||
| 5097 | /* This doesn't actually get used other than for module information */ | 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 | if (dev->zoned) | 1371 | if (dev->zoned) |
| 1372 | cmd->error = null_process_zoned_cmd(cmd, op, | 1372 | sts = null_process_zoned_cmd(cmd, op, sector, nr_sectors); |
| 1373 | sector, nr_sectors); | ||
| 1374 | else | 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 | out: | 1380 | out: |
| 1378 | nullb_complete_cmd(cmd); | 1381 | nullb_complete_cmd(cmd); |
| @@ -1451,8 +1454,20 @@ static bool should_requeue_request(struct request *rq) · 72 unmodified lines | |||
| 1451 | 1454 | ||
| 1452 | static enum blk_eh_timer_return null_timeout_rq(struct request *rq, bool res) | 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 | pr_info("rq %p timed out\n", rq); | 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 | return BLK_EH_DONE; | 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 | cmd->rq = bd->rq; | 1488 | cmd->rq = bd->rq; |
| 1474 | cmd->error = BLK_STS_OK; | 1489 | cmd->error = BLK_STS_OK; |
| 1475 | cmd->nq = nq; | 1490 | cmd->nq = nq; |
| 1491 | cmd->fake_timeout = should_timeout_request(bd->rq); | ||
| 1476 | 1492 | ||
| 1477 | blk_mq_start_request(bd->rq); | 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 | return BLK_STS_OK; | 1505 | return BLK_STS_OK; |
| 1490 | } | 1506 | } |
| 1491 | } | 1507 | } |
| 1492 | if (should_timeout_request(bd->rq)) | 1508 | if (cmd->fake_timeout) |
| 1493 | return BLK_STS_OK; | 1509 | return BLK_STS_OK; |
| 1494 | 1510 | ||
| 1495 | return null_handle_cmd(cmd, sector, nr_sectors, req_op(bd->rq)); | 1511 | return null_handle_cmd(cmd, sector, nr_sectors, req_op(bd->rq)); |
| @@ -22,6 +22,7 @@ struct nullb_cmd { · 21 unmodified lines | |||
| 22 | blk_status_t error; | 22 | blk_status_t error; |
| 23 | struct nullb_queue *nq; | 23 | struct nullb_queue *nq; |
| 24 | struct hrtimer timer; | 24 | struct hrtimer timer; |
| 25 | bool fake_timeout; | ||
| 25 | }; | 26 | }; |
| 26 | 27 | ||
| 27 | struct nullb_queue { | 28 | struct nullb_queue { |
| @@ -871,6 +871,7 @@ static int rsxx_pci_probe(struct pci_dev *dev, · 870 unmodified lines | |||
| 871 | card->event_wq = create_singlethread_workqueue(DRIVER_NAME"_event"); | 871 | card->event_wq = create_singlethread_workqueue(DRIVER_NAME"_event"); |
| 872 | if (!card->event_wq) { | 872 | if (!card->event_wq) { |
| 873 | dev_err(CARD_TO_DEV(card), "Failed card event setup.\n"); | 873 | dev_err(CARD_TO_DEV(card), "Failed card event setup.\n"); |
| 874 | st = -ENOMEM; | ||
| 874 | goto failed_event_handler; | 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 | if (card->mm_pages[0].desc == NULL || | 877 | if (card->mm_pages[0].desc == NULL || |
| 878 | card->mm_pages[1].desc == NULL) { | 878 | card->mm_pages[1].desc == NULL) { |
| 879 | dev_printk(KERN_ERR, &card->dev->dev, "alloc failed\n"); | 879 | dev_printk(KERN_ERR, &card->dev->dev, "alloc failed\n"); |
| 880 | ret = -ENOMEM; | ||
| 880 | goto failed_alloc; | 881 | goto failed_alloc; |
| 881 | } | 882 | } |
| 882 | reset_page(&card->mm_pages[0]); | 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 | spin_lock_init(&card->lock); | 889 | spin_lock_init(&card->lock); |
| 889 | 890 | ||
| 890 | card->queue = blk_alloc_queue(NUMA_NO_NODE); | 891 | card->queue = blk_alloc_queue(NUMA_NO_NODE); |
| 891 | if (!card->queue) | 892 | if (!card->queue) { |
| 893 | ret = -ENOMEM; | ||
| 892 | goto failed_alloc; | 894 | goto failed_alloc; |
| 895 | } | ||
| 893 | 896 | ||
| 894 | tasklet_init(&card->tasklet, process_page, (unsigned long)card); | 897 | tasklet_init(&card->tasklet, process_page, (unsigned long)card); |
| 895 | 898 | ||
| @@ -891,7 +891,7 @@ next: · 890 unmodified lines | |||
| 891 | out: | 891 | out: |
| 892 | for (i = last_map; i < num; i++) { | 892 | for (i = last_map; i < num; i++) { |
| 893 | /* Don't zap current batch's valid persistent grants. */ | 893 | /* Don't zap current batch's valid persistent grants. */ |
| 894 | if(i >= last_map + segs_to_map) | 894 | if(i >= map_until) |
| 895 | pages[i]->persistent_gnt = NULL; | 895 | pages[i]->persistent_gnt = NULL; |
| 896 | pages[i]->handle = BLKBACK_INVALID_HANDLE; | 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 | struct bio_vec bio_vec; | 627 | struct bio_vec bio_vec; |
| 628 | struct page *page; | 628 | struct page *page; |
| 629 | ssize_t ret = len; | 629 | ssize_t ret = len; |
| 630 | int mode; | 630 | int mode, err; |
| 631 | unsigned long blk_idx = 0; | 631 | unsigned long blk_idx = 0; |
| 632 | 632 | ||
| 633 | if (sysfs_streq(buf, "idle")) | 633 | if (sysfs_streq(buf, "idle")) |
| @@ -638,8 +638,8 @@ static ssize_t writeback_store(struct device *dev, · 4 unmodified lines | |||
| 638 | if (strncmp(buf, PAGE_WB_SIG, sizeof(PAGE_WB_SIG) - 1)) | 638 | if (strncmp(buf, PAGE_WB_SIG, sizeof(PAGE_WB_SIG) - 1)) |
| 639 | return -EINVAL; | 639 | return -EINVAL; |
| 640 | 640 | ||
| 641 | ret = kstrtol(buf + sizeof(PAGE_WB_SIG) - 1, 10, &index); | 641 | if (kstrtol(buf + sizeof(PAGE_WB_SIG) - 1, 10, &index) || |
| 642 | if (ret || index >= nr_pages) | 642 | index >= nr_pages) |
| 643 | return -EINVAL; | 643 | return -EINVAL; |
| 644 | 644 | ||
| 645 | nr_pages = 1; | 645 | nr_pages = 1; |
| @@ -663,7 +663,7 @@ static ssize_t writeback_store(struct device *dev, · 17 unmodified lines | |||
| 663 | goto release_init_lock; | 663 | goto release_init_lock; |
| 664 | } | 664 | } |
| 665 | 665 | ||
| 666 | while (nr_pages--) { | 666 | for (; nr_pages != 0; index++, nr_pages--) { |
| 667 | struct bio_vec bvec; | 667 | struct bio_vec bvec; |
| 668 | 668 | ||
| 669 | bvec.bv_page = page; | 669 | bvec.bv_page = page; |
| @@ -728,12 +728,17 @@ static ssize_t writeback_store(struct device *dev, · 58 unmodified lines | |||
| 728 | * XXX: A single page IO would be inefficient for write | 728 | * XXX: A single page IO would be inefficient for write |
| 729 | * but it would be not bad as starter. | 729 | * but it would be not bad as starter. |
| 730 | */ | 730 | */ |
| 731 | ret = submit_bio_wait(&bio); | 731 | err = submit_bio_wait(&bio); |
| 732 | if (ret) { | 732 | if (err) { |
| 733 | zram_slot_lock(zram, index); | 733 | zram_slot_lock(zram, index); |
| 734 | zram_clear_flag(zram, index, ZRAM_UNDER_WB); | 734 | zram_clear_flag(zram, index, ZRAM_UNDER_WB); |
| 735 | zram_clear_flag(zram, index, ZRAM_IDLE); | 735 | zram_clear_flag(zram, index, ZRAM_IDLE); |
| 736 | zram_slot_unlock(zram, index); | 736 | zram_slot_unlock(zram, index); |
| 737 | /* | ||
| 738 | * Return last IO error unless every IO were | ||
| 739 | * not suceeded. | ||
| 740 | */ | ||
| 741 | ret = err; | ||
| 737 | continue; | 742 | continue; |
| 738 | } | 743 | } |
| 739 | 744 | ||
| @@ -194,5 +194,4 @@ module_init(rsi_91x_bt_module_init); · 193 unmodified lines | |||
| 194 | module_exit(rsi_91x_bt_module_exit); | 194 | module_exit(rsi_91x_bt_module_exit); |
| 195 | MODULE_AUTHOR("Redpine Signals Inc"); | 195 | MODULE_AUTHOR("Redpine Signals Inc"); |
| 196 | MODULE_DESCRIPTION("RSI BT driver"); | 196 | MODULE_DESCRIPTION("RSI BT driver"); |
| 197 | MODULE_SUPPORTED_DEVICE("RSI-BT"); | ||
| 198 | MODULE_LICENSE("Dual BSD/GPL"); | 197 | MODULE_LICENSE("Dual BSD/GPL"); |
| @@ -4849,8 +4849,8 @@ static int btusb_probe(struct usb_interface *intf, · 4848 unmodified lines | |||
| 4849 | data->diag = NULL; | 4849 | data->diag = NULL; |
| 4850 | } | 4850 | } |
| 4851 | 4851 | ||
| 4852 | if (!enable_autosuspend) | 4852 | if (enable_autosuspend) |
| 4853 | usb_disable_autosuspend(data->udev); | 4853 | usb_enable_autosuspend(data->udev); |
| 4854 | 4854 | ||
| 4855 | err = hci_register_dev(hdev); | 4855 | err = hci_register_dev(hdev); |
| 4856 | if (err < 0) | 4856 | if (err < 0) |
| @@ -4910,9 +4910,6 @@ static void btusb_disconnect(struct usb_interface *intf) · 53 unmodified lines | |||
| 4910 | gpiod_put(data->reset_gpio); | 4910 | gpiod_put(data->reset_gpio); |
| 4911 | 4911 | ||
| 4912 | hci_free_dev(hdev); | 4912 | hci_free_dev(hdev); |
| 4913 | |||
| 4914 | if (!enable_autosuspend) | ||
| 4915 | usb_enable_autosuspend(data->udev); | ||
| 4916 | } | 4913 | } |
| 4917 | 4914 | ||
| 4918 | #ifdef CONFIG_PM | 4915 | #ifdef CONFIG_PM |
| @@ -2,7 +2,7 @@ · 1 unmodified line | |||
| 2 | /* | 2 | /* |
| 3 | * Turris Mox module configuration bus driver | 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 | #include <dt-bindings/bus/moxtet.h> | 8 | #include <dt-bindings/bus/moxtet.h> |
| @@ -879,6 +879,6 @@ static void __exit moxtet_exit(void) · 870 unmodified lines | |||
| 879 | } | 879 | } |
| 880 | module_exit(moxtet_exit); | 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 | MODULE_DESCRIPTION("CZ.NIC's Turris Mox module configuration bus"); | 883 | MODULE_DESCRIPTION("CZ.NIC's Turris Mox module configuration bus"); |
| 884 | MODULE_LICENSE("GPL v2"); | 884 | MODULE_LICENSE("GPL v2"); |
| @@ -618,7 +618,7 @@ mvebu_mbus_find_bridge_hole(uint64_t *start, uint64_t *end) · 617 unmodified lines | |||
| 618 | * This part of the memory is above 4 GB, so we don't | 618 | * This part of the memory is above 4 GB, so we don't |
| 619 | * care for the MBus bridge hole. | 619 | * care for the MBus bridge hole. |
| 620 | */ | 620 | */ |
| 621 | if (reg_start >= 0x100000000ULL) | 621 | if ((u64)reg_start >= 0x100000000ULL) |
| 622 | continue; | 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 | l3->debug_irq = platform_get_irq(pdev, 0); | 286 | l3->debug_irq = platform_get_irq(pdev, 0); |
| 287 | ret = devm_request_irq(l3->dev, l3->debug_irq, l3_interrupt_handler, | 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 | if (ret) { | 289 | if (ret) { |
| 290 | dev_err(l3->dev, "request_irq failed for %d\n", | 290 | dev_err(l3->dev, "request_irq failed for %d\n", |
| 291 | l3->debug_irq); | 291 | l3->debug_irq); |
| @@ -294,7 +294,7 @@ static int omap_l3_probe(struct platform_device *pdev) · 2 unmodified lines | |||
| 294 | 294 | ||
| 295 | l3->app_irq = platform_get_irq(pdev, 1); | 295 | l3->app_irq = platform_get_irq(pdev, 1); |
| 296 | ret = devm_request_irq(l3->dev, l3->app_irq, l3_interrupt_handler, | 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 | if (ret) | 298 | if (ret) |
| 299 | dev_err(l3->dev, "request_irq failed for %d\n", l3->app_irq); | 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 | pm_runtime_put_sync(&pdev->dev); | 3054 | pm_runtime_put_sync(&pdev->dev); |
| 3055 | pm_runtime_disable(&pdev->dev); | 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 | unprepare: | 3060 | unprepare: |
| 3059 | sysc_unprepare(ddata); | 3061 | sysc_unprepare(ddata); |
| @@ -125,7 +125,7 @@ config AGP_HP_ZX1 · 124 unmodified lines | |||
| 125 | 125 | ||
| 126 | config AGP_PARISC | 126 | config AGP_PARISC |
| 127 | tristate "HP Quicksilver AGP support" | 127 | tristate "HP Quicksilver AGP support" |
| 128 | depends on AGP && PARISC && 64BIT | 128 | depends on AGP && PARISC && 64BIT && IOMMU_SBA |
| 129 | help | 129 | help |
| 130 | This option gives you AGP GART support for the HP Quicksilver | 130 | This option gives you AGP GART support for the HP Quicksilver |
| 131 | AGP bus adapter on HP PA-RISC machines (Ok, just on the C8000 | 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 | MODULE_LICENSE("GPL"); | 81 | MODULE_LICENSE("GPL"); |
| 82 | MODULE_ALIAS_MISCDEV(AC_MINOR); | 82 | MODULE_ALIAS_MISCDEV(AC_MINOR); |
| 83 | 83 | ||
| 84 | MODULE_SUPPORTED_DEVICE("ac"); | ||
| 85 | |||
| 86 | |||
| 87 | static struct applicom_board { | 84 | static struct applicom_board { |
| 88 | unsigned long PhysIO; | 85 | unsigned long PhysIO; |
| 89 | void __iomem *RamIO; | 86 | void __iomem *RamIO; |
| @@ -54,10 +54,9 @@ static int pseries_rng_probe(struct vio_dev *dev, · 53 unmodified lines | |||
| 54 | return hwrng_register(&pseries_rng); | 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 | hwrng_unregister(&pseries_rng); | 59 | hwrng_unregister(&pseries_rng); |
| 60 | return 0; | ||
| 61 | } | 60 | } |
| 62 | 61 | ||
| 63 | static const struct vio_device_id pseries_rng_driver_ids[] = { | 62 | static const struct vio_device_id pseries_rng_driver_ids[] = { |
| @@ -64,7 +64,6 @@ · 63 unmodified lines | |||
| 64 | MODULE_LICENSE("GPL"); | 64 | MODULE_LICENSE("GPL"); |
| 65 | MODULE_AUTHOR("Jonathan Buzzard <jonathan@buzzard.org.uk>"); | 65 | MODULE_AUTHOR("Jonathan Buzzard <jonathan@buzzard.org.uk>"); |
| 66 | MODULE_DESCRIPTION("Toshiba laptop SMM driver"); | 66 | MODULE_DESCRIPTION("Toshiba laptop SMM driver"); |
| 67 | MODULE_SUPPORTED_DEVICE("toshiba"); | ||
| 68 | 67 | ||
| 69 | static DEFINE_MUTEX(tosh_mutex); | 68 | static DEFINE_MUTEX(tosh_mutex); |
| 70 | static int tosh_fn; | 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 | * Return: Always 0. | 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 | struct tpm_chip *chip = dev_get_drvdata(&vdev->dev); | 348 | struct tpm_chip *chip = dev_get_drvdata(&vdev->dev); |
| 349 | struct ibmvtpm_dev *ibmvtpm = dev_get_drvdata(&chip->dev); | 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 | kfree(ibmvtpm); | 372 | kfree(ibmvtpm); |
| 373 | /* For tpm_ibmvtpm_get_desired_dma */ | 373 | /* For tpm_ibmvtpm_get_desired_dma */ |
| 374 | dev_set_drvdata(&vdev->dev, NULL); | 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 | static void devm_clk_hw_register_fixed_factor_release(struct device *dev, void *res) | 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 | static struct clk_hw * | 79 | static struct clk_hw * |
| @@ -4357,20 +4357,19 @@ int clk_notifier_register(struct clk *clk, struct notifier_block *nb) · 4356 unmodified lines | |||
| 4357 | /* search the list of notifiers for this clk */ | 4357 | /* search the list of notifiers for this clk */ |
| 4358 | list_for_each_entry(cn, &clk_notifier_list, node) | 4358 | list_for_each_entry(cn, &clk_notifier_list, node) |
| 4359 | if (cn->clk == clk) | 4359 | if (cn->clk == clk) |
| 4360 | break; | 4360 | goto found; |
| 4361 | 4361 | ||
| 4362 | /* if clk wasn't in the notifier list, allocate new clk_notifier */ | 4362 | /* if clk wasn't in the notifier list, allocate new clk_notifier */ |
| 4363 | if (cn->clk != clk) { | 4363 | cn = kzalloc(sizeof(*cn), GFP_KERNEL); |
| 4364 | cn = kzalloc(sizeof(*cn), GFP_KERNEL); | 4364 | if (!cn) |
| 4365 | if (!cn) | 4365 | goto out; |
| 4366 | goto out; | ||
| 4367 | 4366 | ||
| 4368 | cn->clk = clk; | 4367 | cn->clk = clk; |
| 4369 | srcu_init_notifier_head(&cn->notifier_head); | 4368 | srcu_init_notifier_head(&cn->notifier_head); |
| 4370 | 4369 | ||
| 4371 | list_add(&cn->node, &clk_notifier_list); | 4370 | list_add(&cn->node, &clk_notifier_list); |
| 4372 | } | ||
| 4373 | 4371 | ||
| 4372 | found: | ||
| 4374 | ret = srcu_notifier_chain_register(&cn->notifier_head, nb); | 4373 | ret = srcu_notifier_chain_register(&cn->notifier_head, nb); |
| 4375 | 4374 | ||
| 4376 | clk->core->notifier_count++; | 4375 | clk->core->notifier_count++; |
| @@ -4395,32 +4394,28 @@ EXPORT_SYMBOL_GPL(clk_notifier_register); · 18 unmodified lines | |||
| 4395 | */ | 4394 | */ |
| 4396 | int clk_notifier_unregister(struct clk *clk, struct notifier_block *nb) | 4395 | int clk_notifier_unregister(struct clk *clk, struct notifier_block *nb) |
| 4397 | { | 4396 | { |
| 4398 | struct clk_notifier *cn = NULL; | 4397 | struct clk_notifier *cn; |
| 4399 | int ret = -EINVAL; | 4398 | int ret = -ENOENT; |
| 4400 | 4399 | ||
| 4401 | if (!clk || !nb) | 4400 | if (!clk || !nb) |
| 4402 | return -EINVAL; | 4401 | return -EINVAL; |
| 4403 | 4402 | ||
| 4404 | clk_prepare_lock(); | 4403 | clk_prepare_lock(); |
| 4405 | 4404 | ||
| 4406 | list_for_each_entry(cn, &clk_notifier_list, node) | 4405 | list_for_each_entry(cn, &clk_notifier_list, node) { |
| 4407 | if (cn->clk == clk) | 4406 | if (cn->clk == clk) { |
| 4408 | break; | 4407 | ret = srcu_notifier_chain_unregister(&cn->notifier_head, nb); |
| 4409 | |||
| 4410 | if (cn->clk == clk) { | ||
| 4411 | 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 */ | 4411 | /* XXX the notifier code should handle this better */ |
| 4416 | if (!cn->notifier_head.head) { | 4412 | if (!cn->notifier_head.head) { |
| 4417 | srcu_cleanup_notifier_head(&cn->notifier_head); | 4413 | srcu_cleanup_notifier_head(&cn->notifier_head); |
| 4418 | list_del(&cn->node); | 4414 | list_del(&cn->node); |
| 4419 | kfree(cn); | 4415 | kfree(cn); |
| 4416 | } | ||
| 4417 | break; | ||
| 4420 | } | 4418 | } |
| 4421 | |||
| 4422 | } else { | ||
| 4423 | ret = -ENOENT; | ||
| 4424 | } | 4419 | } |
| 4425 | 4420 | ||
| 4426 | clk_prepare_unlock(); | 4421 | clk_prepare_unlock(); |
| @@ -304,7 +304,7 @@ static struct clk_rcg2 cam_cc_bps_clk_src = { · 303 unmodified lines | |||
| 304 | .name = "cam_cc_bps_clk_src", | 304 | .name = "cam_cc_bps_clk_src", |
| 305 | .parent_data = cam_cc_parent_data_2, | 305 | .parent_data = cam_cc_parent_data_2, |
| 306 | .num_parents = 5, | 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 | .name = "cam_cc_cci_0_clk_src", | 325 | .name = "cam_cc_cci_0_clk_src", |
| 326 | .parent_data = cam_cc_parent_data_5, | 326 | .parent_data = cam_cc_parent_data_5, |
| 327 | .num_parents = 3, | 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 | .name = "cam_cc_cci_1_clk_src", | 339 | .name = "cam_cc_cci_1_clk_src", |
| 340 | .parent_data = cam_cc_parent_data_5, | 340 | .parent_data = cam_cc_parent_data_5, |
| 341 | .num_parents = 3, | 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 | .name = "cam_cc_cphy_rx_clk_src", | 360 | .name = "cam_cc_cphy_rx_clk_src", |
| 361 | .parent_data = cam_cc_parent_data_3, | 361 | .parent_data = cam_cc_parent_data_3, |
| 362 | .num_parents = 6, | 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 | .name = "cam_cc_csi0phytimer_clk_src", | 379 | .name = "cam_cc_csi0phytimer_clk_src", |
| 380 | .parent_data = cam_cc_parent_data_0, | 380 | .parent_data = cam_cc_parent_data_0, |
| 381 | .num_parents = 4, | 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 | .name = "cam_cc_csi1phytimer_clk_src", | 393 | .name = "cam_cc_csi1phytimer_clk_src", |
| 394 | .parent_data = cam_cc_parent_data_0, | 394 | .parent_data = cam_cc_parent_data_0, |
| 395 | .num_parents = 4, | 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 | .name = "cam_cc_csi2phytimer_clk_src", | 407 | .name = "cam_cc_csi2phytimer_clk_src", |
| 408 | .parent_data = cam_cc_parent_data_0, | 408 | .parent_data = cam_cc_parent_data_0, |
| 409 | .num_parents = 4, | 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 | .name = "cam_cc_csi3phytimer_clk_src", | 421 | .name = "cam_cc_csi3phytimer_clk_src", |
| 422 | .parent_data = cam_cc_parent_data_0, | 422 | .parent_data = cam_cc_parent_data_0, |
| 423 | .num_parents = 4, | 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 | .name = "cam_cc_fast_ahb_clk_src", | 443 | .name = "cam_cc_fast_ahb_clk_src", |
| 444 | .parent_data = cam_cc_parent_data_0, | 444 | .parent_data = cam_cc_parent_data_0, |
| 445 | .num_parents = 4, | 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 | .name = "cam_cc_icp_clk_src", | 466 | .name = "cam_cc_icp_clk_src", |
| 467 | .parent_data = cam_cc_parent_data_2, | 467 | .parent_data = cam_cc_parent_data_2, |
| 468 | .num_parents = 5, | 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 | .name = "cam_cc_ife_0_clk_src", | 488 | .name = "cam_cc_ife_0_clk_src", |
| 489 | .parent_data = cam_cc_parent_data_4, | 489 | .parent_data = cam_cc_parent_data_4, |
| 490 | .num_parents = 4, | 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 | .name = "cam_cc_ife_0_csid_clk_src", | 510 | .name = "cam_cc_ife_0_csid_clk_src", |
| 511 | .parent_data = cam_cc_parent_data_3, | 511 | .parent_data = cam_cc_parent_data_3, |
| 512 | .num_parents = 6, | 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 | .name = "cam_cc_ife_1_clk_src", | 524 | .name = "cam_cc_ife_1_clk_src", |
| 525 | .parent_data = cam_cc_parent_data_4, | 525 | .parent_data = cam_cc_parent_data_4, |
| 526 | .num_parents = 4, | 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 | .name = "cam_cc_ife_1_csid_clk_src", | 538 | .name = "cam_cc_ife_1_csid_clk_src", |
| 539 | .parent_data = cam_cc_parent_data_3, | 539 | .parent_data = cam_cc_parent_data_3, |
| 540 | .num_parents = 6, | 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 | .parent_data = cam_cc_parent_data_4, | 553 | .parent_data = cam_cc_parent_data_4, |
| 554 | .num_parents = 4, | 554 | .num_parents = 4, |
| 555 | .flags = CLK_SET_RATE_PARENT, | 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 | .name = "cam_cc_ife_lite_csid_clk_src", | 567 | .name = "cam_cc_ife_lite_csid_clk_src", |
| 568 | .parent_data = cam_cc_parent_data_3, | 568 | .parent_data = cam_cc_parent_data_3, |
| 569 | .num_parents = 6, | 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 | .name = "cam_cc_ipe_0_clk_src", | 590 | .name = "cam_cc_ipe_0_clk_src", |
| 591 | .parent_data = cam_cc_parent_data_2, | 591 | .parent_data = cam_cc_parent_data_2, |
| 592 | .num_parents = 5, | 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 | .name = "cam_cc_jpeg_clk_src", | 613 | .name = "cam_cc_jpeg_clk_src", |
| 614 | .parent_data = cam_cc_parent_data_2, | 614 | .parent_data = cam_cc_parent_data_2, |
| 615 | .num_parents = 5, | 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 | .name = "cam_cc_lrme_clk_src", | 635 | .name = "cam_cc_lrme_clk_src", |
| 636 | .parent_data = cam_cc_parent_data_6, | 636 | .parent_data = cam_cc_parent_data_6, |
| 637 | .num_parents = 5, | 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 | .name = "cam_cc_mclk0_clk_src", | 656 | .name = "cam_cc_mclk0_clk_src", |
| 657 | .parent_data = cam_cc_parent_data_1, | 657 | .parent_data = cam_cc_parent_data_1, |
| 658 | .num_parents = 3, | 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 | .name = "cam_cc_mclk1_clk_src", | 670 | .name = "cam_cc_mclk1_clk_src", |
| 671 | .parent_data = cam_cc_parent_data_1, | 671 | .parent_data = cam_cc_parent_data_1, |
| 672 | .num_parents = 3, | 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 | .name = "cam_cc_mclk2_clk_src", | 684 | .name = "cam_cc_mclk2_clk_src", |
| 685 | .parent_data = cam_cc_parent_data_1, | 685 | .parent_data = cam_cc_parent_data_1, |
| 686 | .num_parents = 3, | 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 | .name = "cam_cc_mclk3_clk_src", | 698 | .name = "cam_cc_mclk3_clk_src", |
| 699 | .parent_data = cam_cc_parent_data_1, | 699 | .parent_data = cam_cc_parent_data_1, |
| 700 | .num_parents = 3, | 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 | .name = "cam_cc_mclk4_clk_src", | 712 | .name = "cam_cc_mclk4_clk_src", |
| 713 | .parent_data = cam_cc_parent_data_1, | 713 | .parent_data = cam_cc_parent_data_1, |
| 714 | .num_parents = 3, | 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 | .parent_data = cam_cc_parent_data_0, | 732 | .parent_data = cam_cc_parent_data_0, |
| 733 | .num_parents = 4, | 733 | .num_parents = 4, |
| 734 | .flags = CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE, | 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 | struct clk_rate_request parent_req = { }; | 730 | struct clk_rate_request parent_req = { }; |
| 731 | struct clk_rcg2_gfx3d *cgfx = to_clk_rcg2_gfx3d(hw); | 731 | struct clk_rcg2_gfx3d *cgfx = to_clk_rcg2_gfx3d(hw); |
| 732 | struct clk_hw *xo, *p0, *p1, *p2; | 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 | int ret; | 735 | int ret; |
| 735 | 736 | ||
| 736 | p0 = cgfx->hws[0]; | 737 | p0 = cgfx->hws[0]; |
| @@ -750,14 +751,15 @@ static int clk_gfx3d_determine_rate(struct clk_hw *hw, · 13 unmodified lines | |||
| 750 | return 0; | 751 | return 0; |
| 751 | } | 752 | } |
| 752 | 753 | ||
| 753 | request = req->rate; | 754 | if (mux_div == 0) |
| 754 | if (cgfx->div > 1) | 755 | mux_div = 1; |
| 755 | parent_req.rate = request = request * cgfx->div; | 756 | |
| 757 | parent_req.rate = req->rate * mux_div; | ||
| 756 | 758 | ||
| 757 | /* This has to be a fixed rate PLL */ | 759 | /* This has to be a fixed rate PLL */ |
| 758 | p0_rate = clk_hw_get_rate(p0); | 760 | p0_rate = clk_hw_get_rate(p0); |
| 759 | 761 | ||
| 760 | if (request == p0_rate) { | 762 | if (parent_req.rate == p0_rate) { |
| 761 | req->rate = req->best_parent_rate = p0_rate; | 763 | req->rate = req->best_parent_rate = p0_rate; |
| 762 | req->best_parent_hw = p0; | 764 | req->best_parent_hw = p0; |
| 763 | return 0; | 765 | return 0; |
| @@ -765,7 +767,7 @@ static int clk_gfx3d_determine_rate(struct clk_hw *hw, · 1 unmodified line | |||
| 765 | 767 | ||
| 766 | if (req->best_parent_hw == p0) { | 768 | if (req->best_parent_hw == p0) { |
| 767 | /* Are we going back to a previously used rate? */ | 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 | req->best_parent_hw = p2; | 771 | req->best_parent_hw = p2; |
| 770 | else | 772 | else |
| 771 | req->best_parent_hw = p1; | 773 | req->best_parent_hw = p1; |
| @@ -780,8 +782,7 @@ static int clk_gfx3d_determine_rate(struct clk_hw *hw, · 8 unmodified lines | |||
| 780 | return ret; | 782 | return ret; |
| 781 | 783 | ||
| 782 | req->rate = req->best_parent_rate = parent_req.rate; | 784 | req->rate = req->best_parent_rate = parent_req.rate; |
| 783 | if (cgfx->div > 1) | 785 | req->rate /= mux_div; |
| 784 | req->rate /= cgfx->div; | ||
| 785 | 786 | ||
| 786 | return 0; | 787 | return 0; |
| 787 | } | 788 | } |
| @@ -510,9 +510,12 @@ static const struct clk_rpmh_desc clk_rpmh_sm8350 = { · 509 unmodified lines | |||
| 510 | .num_clks = ARRAY_SIZE(sm8350_rpmh_clocks), | 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 | static struct clk_hw *sc7280_rpmh_clocks[] = { | 516 | static struct clk_hw *sc7280_rpmh_clocks[] = { |
| 514 | [RPMH_CXO_CLK] = &sdm845_bi_tcxo.hw, | 517 | [RPMH_CXO_CLK] = &sc7280_bi_tcxo.hw, |
| 515 | [RPMH_CXO_CLK_A] = &sdm845_bi_tcxo_ao.hw, | 518 | [RPMH_CXO_CLK_A] = &sc7280_bi_tcxo_ao.hw, |
| 516 | [RPMH_LN_BB_CLK2] = &sdm845_ln_bb_clk2.hw, | 519 | [RPMH_LN_BB_CLK2] = &sdm845_ln_bb_clk2.hw, |
| 517 | [RPMH_LN_BB_CLK2_A] = &sdm845_ln_bb_clk2_ao.hw, | 520 | [RPMH_LN_BB_CLK2_A] = &sdm845_ln_bb_clk2_ao.hw, |
| 518 | [RPMH_RF_CLK1] = &sdm845_rf_clk1.hw, | 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 | .name = "gcc_sdcc1_apps_clk_src", | 620 | .name = "gcc_sdcc1_apps_clk_src", |
| 621 | .parent_data = gcc_parent_data_1, | 621 | .parent_data = gcc_parent_data_1, |
| 622 | .num_parents = 5, | 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 | .name = "gcc_sdcc1_ice_core_clk_src", | 642 | .name = "gcc_sdcc1_ice_core_clk_src", |
| 643 | .parent_data = gcc_parent_data_0, | 643 | .parent_data = gcc_parent_data_0, |
| 644 | .num_parents = 4, | 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 | val = readl(socfpgaclk->div_reg) >> socfpgaclk->shift; | 99 | val = readl(socfpgaclk->div_reg) >> socfpgaclk->shift; |
| 100 | val &= GENMASK(socfpgaclk->width - 1, 0); | 100 | val &= GENMASK(socfpgaclk->width - 1, 0); |
| 101 | /* Check for GPIO_DB_CLK by its offset */ | 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 | div = val + 1; | 103 | div = val + 1; |
| 104 | else | 104 | else |
| 105 | div = (1 << val); | 105 | div = (1 << val); |
| @@ -31,7 +31,7 @@ struct stm32_timer_cnt { · 30 unmodified lines | |||
| 31 | struct counter_device counter; | 31 | struct counter_device counter; |
| 32 | struct regmap *regmap; | 32 | struct regmap *regmap; |
| 33 | struct clk *clk; | 33 | struct clk *clk; |
| 34 | u32 ceiling; | 34 | u32 max_arr; |
| 35 | bool enabled; | 35 | bool enabled; |
| 36 | struct stm32_timer_regs bak; | 36 | struct stm32_timer_regs bak; |
| 37 | }; | 37 | }; |
| @@ -44,13 +44,14 @@ struct stm32_timer_cnt { · 6 unmodified lines | |||
| 44 | * @STM32_COUNT_ENCODER_MODE_3: counts on both TI1FP1 and TI2FP2 edges | 44 | * @STM32_COUNT_ENCODER_MODE_3: counts on both TI1FP1 and TI2FP2 edges |
| 45 | */ | 45 | */ |
| 46 | enum stm32_count_function { | 46 | enum stm32_count_function { |
| 47 | STM32_COUNT_SLAVE_MODE_DISABLED = -1, | 47 | STM32_COUNT_SLAVE_MODE_DISABLED, |
| 48 | STM32_COUNT_ENCODER_MODE_1, | 48 | STM32_COUNT_ENCODER_MODE_1, |
| 49 | STM32_COUNT_ENCODER_MODE_2, | 49 | STM32_COUNT_ENCODER_MODE_2, |
| 50 | STM32_COUNT_ENCODER_MODE_3, | 50 | STM32_COUNT_ENCODER_MODE_3, |
| 51 | }; | 51 | }; |
| 52 | 52 | ||
| 53 | static enum counter_count_function stm32_count_functions[] = { | 53 | static enum counter_count_function stm32_count_functions[] = { |
| 54 | [STM32_COUNT_SLAVE_MODE_DISABLED] = COUNTER_COUNT_FUNCTION_INCREASE, | ||
| 54 | [STM32_COUNT_ENCODER_MODE_1] = COUNTER_COUNT_FUNCTION_QUADRATURE_X2_A, | 55 | [STM32_COUNT_ENCODER_MODE_1] = COUNTER_COUNT_FUNCTION_QUADRATURE_X2_A, |
| 55 | [STM32_COUNT_ENCODER_MODE_2] = COUNTER_COUNT_FUNCTION_QUADRATURE_X2_B, | 56 | [STM32_COUNT_ENCODER_MODE_2] = COUNTER_COUNT_FUNCTION_QUADRATURE_X2_B, |
| 56 | [STM32_COUNT_ENCODER_MODE_3] = COUNTER_COUNT_FUNCTION_QUADRATURE_X4, | 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 | const unsigned long val) | 74 | const unsigned long val) |
| 74 | { | 75 | { |
| 75 | struct stm32_timer_cnt *const priv = counter->priv; | 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 | return -EINVAL; | 81 | return -EINVAL; |
| 79 | 82 | ||
| 80 | return regmap_write(priv->regmap, TIM_CNT, val); | 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 | regmap_read(priv->regmap, TIM_SMCR, &smcr); | 93 | regmap_read(priv->regmap, TIM_SMCR, &smcr); |
| 91 | 94 | ||
| 92 | switch (smcr & TIM_SMCR_SMS) { | 95 | switch (smcr & TIM_SMCR_SMS) { |
| 96 | case 0: | ||
| 97 | *function = STM32_COUNT_SLAVE_MODE_DISABLED; | ||
| 98 | return 0; | ||
| 93 | case 1: | 99 | case 1: |
| 94 | *function = STM32_COUNT_ENCODER_MODE_1; | 100 | *function = STM32_COUNT_ENCODER_MODE_1; |
| 95 | return 0; | 101 | return 0; |
| @@ -99,9 +105,9 @@ static int stm32_count_function_get(struct counter_device *counter, · 3 unmodified lines | |||
| 99 | case 3: | 105 | case 3: |
| 100 | *function = STM32_COUNT_ENCODER_MODE_3; | 106 | *function = STM32_COUNT_ENCODER_MODE_3; |
| 101 | return 0; | 107 | return 0; |
| 108 | default: | ||
| 109 | return -EINVAL; | ||
| 102 | } | 110 | } |
| 103 | |||
| 104 | return -EINVAL; | ||
| 105 | } | 111 | } |
| 106 | 112 | ||
| 107 | static int stm32_count_function_set(struct counter_device *counter, | 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 | u32 cr1, sms; | 118 | u32 cr1, sms; |
| 113 | 119 | ||
| 114 | switch (function) { | 120 | switch (function) { |
| 121 | case STM32_COUNT_SLAVE_MODE_DISABLED: | ||
| 122 | sms = 0; | ||
| 123 | break; | ||
| 115 | case STM32_COUNT_ENCODER_MODE_1: | 124 | case STM32_COUNT_ENCODER_MODE_1: |
| 116 | sms = 1; | 125 | sms = 1; |
| 117 | break; | 126 | break; |
| @@ -122,8 +131,7 @@ static int stm32_count_function_set(struct counter_device *counter, · 4 unmodified lines | |||
| 122 | sms = 3; | 131 | sms = 3; |
| 123 | break; | 132 | break; |
| 124 | default: | 133 | default: |
| 125 | sms = 0; | 134 | return -EINVAL; |
| 126 | break; | ||
| 127 | } | 135 | } |
| 128 | 136 | ||
| 129 | /* Store enable status */ | 137 | /* Store enable status */ |
| @@ -131,10 +139,6 @@ static int stm32_count_function_set(struct counter_device *counter, · 1 unmodified line | |||
| 131 | 139 | ||
| 132 | regmap_update_bits(priv->regmap, TIM_CR1, TIM_CR1_CEN, 0); | 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 | regmap_update_bits(priv->regmap, TIM_SMCR, TIM_SMCR_SMS, sms); | 142 | regmap_update_bits(priv->regmap, TIM_SMCR, TIM_SMCR_SMS, sms); |
| 139 | 143 | ||
| 140 | /* Make sure that registers are updated */ | 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 | if (ret) | 189 | if (ret) |
| 186 | return ret; | 190 | return ret; |
| 187 | 191 | ||
| 192 | if (ceiling > priv->max_arr) | ||
| 193 | return -ERANGE; | ||
| 194 | |||
| 188 | /* TIMx_ARR register shouldn't be buffered (ARPE=0) */ | 195 | /* TIMx_ARR register shouldn't be buffered (ARPE=0) */ |
| 189 | regmap_update_bits(priv->regmap, TIM_CR1, TIM_CR1_ARPE, 0); | 196 | regmap_update_bits(priv->regmap, TIM_CR1, TIM_CR1_ARPE, 0); |
| 190 | regmap_write(priv->regmap, TIM_ARR, ceiling); | 197 | regmap_write(priv->regmap, TIM_ARR, ceiling); |
| 191 | 198 | ||
| 192 | priv->ceiling = ceiling; | ||
| 193 | return len; | 199 | return len; |
| 194 | } | 200 | } |
| 195 | 201 | ||
| @@ -274,31 +280,36 @@ static int stm32_action_get(struct counter_device *counter, · 78 unmodified lines | |||
| 274 | size_t function; | 280 | size_t function; |
| 275 | int err; | 281 | int err; |
| 276 | 282 | ||
| 277 | /* Default action mode (e.g. STM32_COUNT_SLAVE_MODE_DISABLED) */ | ||
| 278 | *action = STM32_SYNAPSE_ACTION_NONE; | ||
| 279 | |||
| 280 | err = stm32_count_function_get(counter, count, &function); | 283 | err = stm32_count_function_get(counter, count, &function); |
| 281 | if (err) | 284 | if (err) |
| 282 | return 0; | 285 | return err; |
| 283 | 286 | ||
| 284 | switch (function) { | 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 | case STM32_COUNT_ENCODER_MODE_1: | 292 | case STM32_COUNT_ENCODER_MODE_1: |
| 286 | /* counts up/down on TI1FP1 edge depending on TI2FP2 level */ | 293 | /* counts up/down on TI1FP1 edge depending on TI2FP2 level */ |
| 287 | if (synapse->signal->id == count->synapses[0].signal->id) | 294 | if (synapse->signal->id == count->synapses[0].signal->id) |
| 288 | *action = STM32_SYNAPSE_ACTION_BOTH_EDGES; | 295 | *action = STM32_SYNAPSE_ACTION_BOTH_EDGES; |
| 289 | break; | 296 | else |
| 297 | *action = STM32_SYNAPSE_ACTION_NONE; | ||
| 298 | return 0; | ||
| 290 | case STM32_COUNT_ENCODER_MODE_2: | 299 | case STM32_COUNT_ENCODER_MODE_2: |
| 291 | /* counts up/down on TI2FP2 edge depending on TI1FP1 level */ | 300 | /* counts up/down on TI2FP2 edge depending on TI1FP1 level */ |
| 292 | if (synapse->signal->id == count->synapses[1].signal->id) | 301 | if (synapse->signal->id == count->synapses[1].signal->id) |
| 293 | *action = STM32_SYNAPSE_ACTION_BOTH_EDGES; | 302 | *action = STM32_SYNAPSE_ACTION_BOTH_EDGES; |
| 294 | break; | 303 | else |
| 304 | *action = STM32_SYNAPSE_ACTION_NONE; | ||
| 305 | return 0; | ||
| 295 | case STM32_COUNT_ENCODER_MODE_3: | 306 | case STM32_COUNT_ENCODER_MODE_3: |
| 296 | /* counts up/down on both TI1FP1 and TI2FP2 edges */ | 307 | /* counts up/down on both TI1FP1 and TI2FP2 edges */ |
| 297 | *action = STM32_SYNAPSE_ACTION_BOTH_EDGES; | 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 | static const struct counter_ops stm32_timer_cnt_ops = { | 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 | priv->regmap = ddata->regmap; | 371 | priv->regmap = ddata->regmap; |
| 361 | priv->clk = ddata->clk; | 372 | priv->clk = ddata->clk; |
| 362 | priv->ceiling = ddata->max_arr; | 373 | priv->max_arr = ddata->max_arr; |
| 363 | 374 | ||
| 364 | priv->counter.name = dev_name(dev); | 375 | priv->counter.name = dev_name(dev); |
| 365 | priv->counter.parent = dev; | 376 | priv->counter.parent = dev; |
| @@ -103,6 +103,8 @@ static const struct of_device_id whitelist[] __initconst = { · 102 unmodified lines | |||
| 103 | static const struct of_device_id blacklist[] __initconst = { | 103 | static const struct of_device_id blacklist[] __initconst = { |
| 104 | { .compatible = "allwinner,sun50i-h6", }, | 104 | { .compatible = "allwinner,sun50i-h6", }, |
| 105 | 105 | ||
| 106 | { .compatible = "arm,vexpress", }, | ||
| 107 | |||
| 106 | { .compatible = "calxeda,highbank", }, | 108 | { .compatible = "calxeda,highbank", }, |
| 107 | { .compatible = "calxeda,ecx-2000", }, | 109 | { .compatible = "calxeda,ecx-2000", }, |
| 108 | 110 | ||
| @@ -267,7 +267,7 @@ struct freq_attr cpufreq_freq_attr_##_name##_freqs = \ · 266 unmodified lines | |||
| 267 | __ATTR_RO(_name##_frequencies) | 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 | * the specified CPU | 271 | * the specified CPU |
| 272 | */ | 272 | */ |
| 273 | static ssize_t scaling_available_frequencies_show(struct cpufreq_policy *policy, | 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 | EXPORT_SYMBOL_GPL(cpufreq_freq_attr_scaling_available_freqs); | 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 | * the specified CPU | 283 | * the specified CPU |
| 284 | */ | 284 | */ |
| 285 | static ssize_t scaling_boost_frequencies_show(struct cpufreq_policy *policy, | 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 | base = ioremap(res->start, resource_size(res)); | 319 | base = ioremap(res->start, resource_size(res)); |
| 320 | if (IS_ERR(base)) { | 320 | if (!base) { |
| 321 | dev_err(dev, "failed to map resource %pR\n", res); | 321 | dev_err(dev, "failed to map resource %pR\n", res); |
| 322 | ret = PTR_ERR(base); | 322 | ret = -ENOMEM; |
| 323 | goto release_region; | 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 | error: | 374 | error: |
| 375 | kfree(data); | 375 | kfree(data); |
| 376 | unmap_base: | 376 | unmap_base: |
| 377 | iounmap(data->base); | 377 | iounmap(base); |
| 378 | release_region: | 378 | release_region: |
| 379 | release_mem_region(res->start, resource_size(res)); | 379 | release_mem_region(res->start, resource_size(res)); |
| 380 | return ret; | 380 | return ret; |
| @@ -1042,7 +1042,7 @@ error: · 1041 unmodified lines | |||
| 1042 | return ret; | 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 | struct nx842_devdata *old_devdata; | 1047 | struct nx842_devdata *old_devdata; |
| 1048 | unsigned long flags; | 1048 | unsigned long flags; |
| @@ -1063,8 +1063,6 @@ static int nx842_remove(struct vio_dev *viodev) · 14 unmodified lines | |||
| 1063 | if (old_devdata) | 1063 | if (old_devdata) |
| 1064 | kfree(old_devdata->counters); | 1064 | kfree(old_devdata->counters); |
| 1065 | kfree(old_devdata); | 1065 | kfree(old_devdata); |
| 1066 | |||
| 1067 | return 0; | ||
| 1068 | } | 1066 | } |
| 1069 | 1067 | ||
| 1070 | static const struct vio_device_id nx842_vio_driver_ids[] = { | 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 | return nx_register_algs(); | 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 | dev_dbg(&viodev->dev, "entering nx_remove for UA 0x%x\n", | 788 | dev_dbg(&viodev->dev, "entering nx_remove for UA 0x%x\n", |
| 789 | viodev->unit_address); | 789 | viodev->unit_address); |
| @@ -811,8 +811,6 @@ static int nx_remove(struct vio_dev *viodev) · 21 unmodified lines | |||
| 811 | nx_unregister_skcipher(&nx_ecb_aes_alg, NX_FC_AES, | 811 | nx_unregister_skcipher(&nx_ecb_aes_alg, NX_FC_AES, |
| 812 | NX_MODE_AES_ECB); | 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 | #include <linux/security.h> | 4 | #include <linux/security.h> |
| 5 | #include <linux/debugfs.h> | 5 | #include <linux/debugfs.h> |
| 6 | #include <linux/module.h> | 6 | #include <linux/module.h> |
| 7 | #include <linux/sizes.h> | ||
| 7 | #include <linux/mutex.h> | 8 | #include <linux/mutex.h> |
| 8 | #include <linux/cdev.h> | 9 | #include <linux/cdev.h> |
| 9 | #include <linux/idr.h> | 10 | #include <linux/idr.h> |
| @@ -96,21 +97,18 @@ struct mbox_cmd { · 86 unmodified lines | |||
| 96 | * @dev: driver core device object | 97 | * @dev: driver core device object |
| 97 | * @cdev: char dev core object for ioctl operations | 98 | * @cdev: char dev core object for ioctl operations |
| 98 | * @cxlm: pointer to the parent device driver data | 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 | * @id: id number of this memdev instance. | 100 | * @id: id number of this memdev instance. |
| 102 | */ | 101 | */ |
| 103 | struct cxl_memdev { | 102 | struct cxl_memdev { |
| 104 | struct device dev; | 103 | struct device dev; |
| 105 | struct cdev cdev; | 104 | struct cdev cdev; |
| 106 | struct cxl_mem *cxlm; | 105 | struct cxl_mem *cxlm; |
| 107 | struct percpu_ref ops_active; | ||
| 108 | struct completion ops_dead; | ||
| 109 | int id; | 106 | int id; |
| 110 | }; | 107 | }; |
| 111 | 108 | ||
| 112 | static int cxl_mem_major; | 109 | static int cxl_mem_major; |
| 113 | static DEFINE_IDA(cxl_memdev_ida); | 110 | static DEFINE_IDA(cxl_memdev_ida); |
| 111 | static DECLARE_RWSEM(cxl_memdev_rwsem); | ||
| 114 | static struct dentry *cxl_debugfs; | 112 | static struct dentry *cxl_debugfs; |
| 115 | static bool cxl_raw_allow_all; | 113 | static bool cxl_raw_allow_all; |
| 116 | 114 | ||
| @@ -169,7 +167,7 @@ struct cxl_mem_command { · 52 unmodified lines | |||
| 169 | * table will be validated against the user's input. For example, if size_in is | 167 | * table will be validated against the user's input. For example, if size_in is |
| 170 | * 0, and the user passed in 1, it is an error. | 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 | CXL_CMD(IDENTIFY, 0, 0x43, CXL_CMD_FLAG_FORCE_ENABLE), | 171 | CXL_CMD(IDENTIFY, 0, 0x43, CXL_CMD_FLAG_FORCE_ENABLE), |
| 174 | #ifdef CONFIG_CXL_MEM_RAW_COMMANDS | 172 | #ifdef CONFIG_CXL_MEM_RAW_COMMANDS |
| 175 | CXL_CMD(RAW, ~0, ~0, 0), | 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 | static long cxl_memdev_ioctl(struct file *file, unsigned int cmd, | 774 | static long cxl_memdev_ioctl(struct file *file, unsigned int cmd, |
| 777 | unsigned long arg) | 775 | unsigned long arg) |
| 778 | { | 776 | { |
| 779 | struct cxl_memdev *cxlmd; | 777 | struct cxl_memdev *cxlmd = file->private_data; |
| 780 | struct inode *inode; | 778 | int rc = -ENXIO; |
| 781 | int rc = -ENOTTY; | ||
| 782 | 779 | ||
| 783 | inode = file_inode(file); | 780 | down_read(&cxl_memdev_rwsem); |
| 784 | cxlmd = container_of(inode->i_cdev, typeof(*cxlmd), cdev); | 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)) | 785 | return rc; |
| 787 | return -ENXIO; | 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 | static const struct file_operations cxl_memdev_fops = { | 809 | static const struct file_operations cxl_memdev_fops = { |
| 797 | .owner = THIS_MODULE, | 810 | .owner = THIS_MODULE, |
| 798 | .unlocked_ioctl = cxl_memdev_ioctl, | 811 | .unlocked_ioctl = cxl_memdev_ioctl, |
| 812 | .open = cxl_memdev_open, | ||
| 813 | .release = cxl_memdev_release_file, | ||
| 799 | .compat_ioctl = compat_ptr_ioctl, | 814 | .compat_ioctl = compat_ptr_ioctl, |
| 800 | .llseek = noop_llseek, | 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 | return NULL; | 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 | bar = FIELD_GET(CXL_REGLOC_BIR_MASK, reg_lo); | 1003 | bar = FIELD_GET(CXL_REGLOC_BIR_MASK, reg_lo); |
| 989 | 1004 | ||
| 990 | /* Basic sanity check that BAR is big enough */ | 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 | struct cxl_memdev *cxlmd = to_cxl_memdev(dev); | 1065 | struct cxl_memdev *cxlmd = to_cxl_memdev(dev); |
| 1051 | 1066 | ||
| 1052 | percpu_ref_exit(&cxlmd->ops_active); | ||
| 1053 | ida_free(&cxl_memdev_ida, cxlmd->id); | 1067 | ida_free(&cxl_memdev_ida, cxlmd->id); |
| 1054 | kfree(cxlmd); | 1068 | kfree(cxlmd); |
| 1055 | } | 1069 | } |
| @@ -1066,7 +1080,7 @@ static ssize_t firmware_version_show(struct device *dev, · 10 unmodified lines | |||
| 1066 | struct cxl_memdev *cxlmd = to_cxl_memdev(dev); | 1080 | struct cxl_memdev *cxlmd = to_cxl_memdev(dev); |
| 1067 | struct cxl_mem *cxlm = cxlmd->cxlm; | 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 | static DEVICE_ATTR_RO(firmware_version); | 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 | struct cxl_memdev *cxlmd = to_cxl_memdev(dev); | 1090 | struct cxl_memdev *cxlmd = to_cxl_memdev(dev); |
| 1077 | struct cxl_mem *cxlm = cxlmd->cxlm; | 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 | static DEVICE_ATTR_RO(payload_max); | 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 | struct cxl_mem *cxlm = cxlmd->cxlm; | 1101 | struct cxl_mem *cxlm = cxlmd->cxlm; |
| 1088 | unsigned long long len = range_len(&cxlm->ram_range); | 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 | static struct device_attribute dev_attr_ram_size = | 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 | struct cxl_mem *cxlm = cxlmd->cxlm; | 1114 | struct cxl_mem *cxlm = cxlmd->cxlm; |
| 1101 | unsigned long long len = range_len(&cxlm->pmem_range); | 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 | static struct device_attribute dev_attr_pmem_size = | 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 | .groups = cxl_memdev_attribute_groups, | 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; | 1169 | down_write(&cxl_memdev_rwsem); |
| 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); | ||
| 1161 | cxlmd->cxlm = NULL; | 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 = | 1176 | struct cxl_memdev *cxlmd = _cxlmd; |
| 1168 | container_of(ref, typeof(*cxlmd), ops_active); | 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 | struct pci_dev *pdev = cxlm->pdev; | 1186 | struct pci_dev *pdev = cxlm->pdev; |
| 1176 | struct cxl_memdev *cxlmd; | 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 | cxlmd = kzalloc(sizeof(*cxlmd), GFP_KERNEL); | 1192 | cxlmd = kzalloc(sizeof(*cxlmd), GFP_KERNEL); |
| 1182 | if (!cxlmd) | 1193 | if (!cxlmd) |
| 1183 | return -ENOMEM; | 1194 | return ERR_PTR(-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; | ||
| 1195 | 1195 | ||
| 1196 | rc = ida_alloc_range(&cxl_memdev_ida, 0, CXL_MEM_MAX_DEVS, GFP_KERNEL); | 1196 | rc = ida_alloc_range(&cxl_memdev_ida, 0, CXL_MEM_MAX_DEVS, GFP_KERNEL); |
| 1197 | if (rc < 0) | 1197 | if (rc < 0) |
| 1198 | goto err_id; | 1198 | goto err; |
| 1199 | cxlmd->id = rc; | 1199 | cxlmd->id = rc; |
| 1200 | 1200 | ||
| 1201 | dev = &cxlmd->dev; | 1201 | dev = &cxlmd->dev; |
| @@ -1204,30 +1204,54 @@ static int cxl_mem_add_memdev(struct cxl_mem *cxlm) · 2 unmodified lines | |||
| 1204 | dev->bus = &cxl_bus_type; | 1204 | dev->bus = &cxl_bus_type; |
| 1205 | dev->devt = MKDEV(cxl_mem_major, cxlmd->id); | 1205 | dev->devt = MKDEV(cxl_mem_major, cxlmd->id); |
| 1206 | dev->type = &cxl_memdev_type; | 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 | cdev = &cxlmd->cdev; | 1209 | cdev = &cxlmd->cdev; |
| 1210 | cdev_init(cdev, &cxl_memdev_fops); | 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 | rc = cdev_device_add(cdev, dev); | 1241 | rc = cdev_device_add(cdev, dev); |
| 1213 | if (rc) | 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: | 1248 | err: |
| 1219 | ida_free(&cxl_memdev_ida, cxlmd->id); | ||
| 1220 | err_id: | ||
| 1221 | /* | 1249 | /* |
| 1222 | * Theoretically userspace could have already entered the fops, | 1250 | * The cdev was briefly live, shutdown any ioctl operations that |
| 1223 | * so flush ops_active. | 1251 | * saw that state. |
| 1224 | */ | 1252 | */ |
| 1225 | percpu_ref_kill(&cxlmd->ops_active); | 1253 | cxl_memdev_shutdown(cxlmd); |
| 1226 | wait_for_completion(&cxlmd->ops_dead); | 1254 | put_device(dev); |
| 1227 | percpu_ref_exit(&cxlmd->ops_active); | ||
| 1228 | err_ref: | ||
| 1229 | kfree(cxlmd); | ||
| 1230 | |||
| 1231 | return rc; | 1255 | return rc; |
| 1232 | } | 1256 | } |
| 1233 | 1257 | ||
| @@ -1396,6 +1420,7 @@ out: · 162 unmodified lines | |||
| 1396 | */ | 1420 | */ |
| 1397 | static int cxl_mem_identify(struct cxl_mem *cxlm) | 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 | struct cxl_mbox_identify { | 1424 | struct cxl_mbox_identify { |
| 1400 | char fw_revision[0x10]; | 1425 | char fw_revision[0x10]; |
| 1401 | __le64 total_capacity; | 1426 | __le64 total_capacity; |
| @@ -1424,10 +1449,11 @@ static int cxl_mem_identify(struct cxl_mem *cxlm) · 22 unmodified lines | |||
| 1424 | * For now, only the capacity is exported in sysfs | 1449 | * For now, only the capacity is exported in sysfs |
| 1425 | */ | 1450 | */ |
| 1426 | cxlm->ram_range.start = 0; | 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 | cxlm->pmem_range.start = 0; | 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 | memcpy(cxlm->firmware_version, id.fw_revision, sizeof(id.fw_revision)); | 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 | list_add(&dax_id->list, &dax_drv->ids); | 90 | list_add(&dax_id->list, &dax_drv->ids); |
| 91 | } else | 91 | } else |
| 92 | rc = -ENOMEM; | 92 | rc = -ENOMEM; |
| 93 | } else | 93 | } |
| 94 | /* nothing to remove */; | ||
| 95 | } else if (action == ID_REMOVE) { | 94 | } else if (action == ID_REMOVE) { |
| 96 | list_del(&dax_id->list); | 95 | list_del(&dax_id->list); |
| 97 | kfree(dax_id); | 96 | kfree(dax_id); |
| 98 | } else | 97 | } |
| 99 | /* dax_id already added */; | ||
| 100 | mutex_unlock(&dax_bus_lock); | 98 | mutex_unlock(&dax_bus_lock); |
| 101 | 99 | ||
| 102 | if (rc < 0) | 100 | if (rc < 0) |
| @@ -1086,6 +1086,7 @@ static int __dma_async_device_channel_register(struct dma_device *device, · 1085 unmodified lines | |||
| 1086 | kfree(chan->dev); | 1086 | kfree(chan->dev); |
| 1087 | err_free_local: | 1087 | err_free_local: |
| 1088 | free_percpu(chan->local); | 1088 | free_percpu(chan->local); |
| 1089 | chan->local = NULL; | ||
| 1089 | return rc; | 1090 | return rc; |
| 1090 | } | 1091 | } |
| 1091 | 1092 | ||
| @@ -10,6 +10,7 @@ config DW_DMAC_CORE · 9 unmodified lines | |||
| 10 | 10 | ||
| 11 | config DW_DMAC | 11 | config DW_DMAC |
| 12 | tristate "Synopsys DesignWare AHB DMA platform driver" | 12 | tristate "Synopsys DesignWare AHB DMA platform driver" |
| 13 | depends on HAS_IOMEM | ||
| 13 | select DW_DMAC_CORE | 14 | select DW_DMAC_CORE |
| 14 | help | 15 | help |
| 15 | Support the Synopsys DesignWare AHB DMA controller. This | 16 | Support the Synopsys DesignWare AHB DMA controller. This |
| @@ -18,6 +19,7 @@ config DW_DMAC · 2 unmodified lines | |||
| 18 | config DW_DMAC_PCI | 19 | config DW_DMAC_PCI |
| 19 | tristate "Synopsys DesignWare AHB DMA PCI driver" | 20 | tristate "Synopsys DesignWare AHB DMA PCI driver" |
| 20 | depends on PCI | 21 | depends on PCI |
| 22 | depends on HAS_IOMEM | ||
| 21 | select DW_DMAC_CORE | 23 | select DW_DMAC_CORE |
| 22 | help | 24 | help |
| 23 | Support the Synopsys DesignWare AHB DMA controller on the | 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 | idxd_cmd_exec(idxd, IDXD_CMD_DRAIN_WQ, operand, NULL); | 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 | int idxd_wq_map_portal(struct idxd_wq *wq) | 301 | int idxd_wq_map_portal(struct idxd_wq *wq) |
| 286 | { | 302 | { |
| 287 | struct idxd_device *idxd = wq->idxd; | 303 | struct idxd_device *idxd = wq->idxd; |
| @@ -363,8 +379,6 @@ int idxd_wq_disable_pasid(struct idxd_wq *wq) · 75 unmodified lines | |||
| 363 | void idxd_wq_disable_cleanup(struct idxd_wq *wq) | 379 | void idxd_wq_disable_cleanup(struct idxd_wq *wq) |
| 364 | { | 380 | { |
| 365 | struct idxd_device *idxd = wq->idxd; | 381 | struct idxd_device *idxd = wq->idxd; |
| 366 | struct device *dev = &idxd->pdev->dev; | ||
| 367 | int i, wq_offset; | ||
| 368 | 382 | ||
| 369 | lockdep_assert_held(&idxd->dev_lock); | 383 | lockdep_assert_held(&idxd->dev_lock); |
| 370 | memset(wq->wqcfg, 0, idxd->wqcfg_size); | 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 | wq->ats_dis = 0; | 390 | wq->ats_dis = 0; |
| 377 | clear_bit(WQ_FLAG_DEDICATED, &wq->flags); | 391 | clear_bit(WQ_FLAG_DEDICATED, &wq->flags); |
| 378 | memset(wq->name, 0, WQ_NAME_SIZE); | 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 | /* Device control bits */ | 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 | /* Device configuration bits */ | 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 | static void idxd_group_config_write(struct idxd_group *group) | 613 | static void idxd_group_config_write(struct idxd_group *group) |
| 578 | { | 614 | { |
| 579 | struct idxd_device *idxd = group->idxd; | 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 | if (!wq->group) | 678 | if (!wq->group) |
| 643 | return 0; | 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 | /* byte 0-3 */ | 690 | /* byte 0-3 */ |
| 648 | wq->wqcfg->wq_size = wq->size; | 691 | wq->wqcfg->wq_size = wq->size; |
| @@ -316,6 +316,8 @@ void idxd_unregister_driver(void); · 315 unmodified lines | |||
| 316 | struct bus_type *idxd_get_bus_type(struct idxd_device *idxd); | 316 | struct bus_type *idxd_get_bus_type(struct idxd_device *idxd); |
| 317 | 317 | ||
| 318 | /* device interrupt control */ | 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 | irqreturn_t idxd_irq_handler(int vec, void *data); | 321 | irqreturn_t idxd_irq_handler(int vec, void *data); |
| 320 | irqreturn_t idxd_misc_thread(int vec, void *data); | 322 | irqreturn_t idxd_misc_thread(int vec, void *data); |
| 321 | irqreturn_t idxd_wq_thread(int irq, void *data); | 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 | int idxd_wq_enable(struct idxd_wq *wq); | 343 | int idxd_wq_enable(struct idxd_wq *wq); |
| 342 | int idxd_wq_disable(struct idxd_wq *wq); | 344 | int idxd_wq_disable(struct idxd_wq *wq); |
| 343 | void idxd_wq_drain(struct idxd_wq *wq); | 345 | void idxd_wq_drain(struct idxd_wq *wq); |
| 346 | void idxd_wq_reset(struct idxd_wq *wq); | ||
| 344 | int idxd_wq_map_portal(struct idxd_wq *wq); | 347 | int idxd_wq_map_portal(struct idxd_wq *wq); |
| 345 | void idxd_wq_unmap_portal(struct idxd_wq *wq); | 348 | void idxd_wq_unmap_portal(struct idxd_wq *wq); |
| 346 | void idxd_wq_disable_cleanup(struct idxd_wq *wq); | 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 | struct idxd_irq_entry *irq_entry; | 65 | struct idxd_irq_entry *irq_entry; |
| 66 | int i, msixcnt; | 66 | int i, msixcnt; |
| 67 | int rc = 0; | 67 | int rc = 0; |
| 68 | union msix_perm mperm; | ||
| 69 | 68 | ||
| 70 | msixcnt = pci_msix_vec_count(pdev); | 69 | msixcnt = pci_msix_vec_count(pdev); |
| 71 | if (msixcnt < 0) { | 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 | idxd_unmask_error_interrupts(idxd); | 145 | idxd_unmask_error_interrupts(idxd); |
| 147 | 146 | idxd_msix_perm_setup(idxd); | |
| 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 | |||
| 155 | return 0; | 147 | return 0; |
| 156 | 148 | ||
| 157 | err_no_irq: | 149 | err_no_irq: |
| @@ -510,6 +502,7 @@ static void idxd_shutdown(struct pci_dev *pdev) · 352 unmodified lines | |||
| 510 | idxd_flush_work_list(irq_entry); | 502 | idxd_flush_work_list(irq_entry); |
| 511 | } | 503 | } |
| 512 | 504 | ||
| 505 | idxd_msix_perm_clear(idxd); | ||
| 513 | destroy_workqueue(idxd->wq); | 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 | for (i = 0; i < 4; i++) | 124 | for (i = 0; i < 4; i++) |
| 125 | idxd->sw_err.bits[i] = ioread64(idxd->reg_base + | 125 | idxd->sw_err.bits[i] = ioread64(idxd->reg_base + |
| 126 | IDXD_SWERR_OFFSET + i * sizeof(u64)); | 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 | if (idxd->sw_err.valid && idxd->sw_err.wq_idx_valid) { | 131 | if (idxd->sw_err.valid && idxd->sw_err.wq_idx_valid) { |
| 130 | int id = idxd->sw_err.wq_idx; | 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 | struct idxd_device *idxd = wq->idxd; | 276 | struct idxd_device *idxd = wq->idxd; |
| 277 | struct device *dev = &idxd->pdev->dev; | 277 | struct device *dev = &idxd->pdev->dev; |
| 278 | int rc; | ||
| 279 | 278 | ||
| 280 | mutex_lock(&wq->wq_lock); | 279 | mutex_lock(&wq->wq_lock); |
| 281 | dev_dbg(dev, "%s removing WQ %s\n", __func__, dev_name(&wq->conf_dev)); | 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 | idxd_wq_unmap_portal(wq); | 295 | idxd_wq_unmap_portal(wq); |
| 297 | 296 | ||
| 298 | idxd_wq_drain(wq); | 297 | idxd_wq_drain(wq); |
| 299 | rc = idxd_wq_disable(wq); | 298 | idxd_wq_reset(wq); |
| 300 | 299 | ||
| 301 | idxd_wq_free_resources(wq); | 300 | idxd_wq_free_resources(wq); |
| 302 | wq->client_count = 0; | 301 | wq->client_count = 0; |
| 303 | mutex_unlock(&wq->wq_lock); | 302 | mutex_unlock(&wq->wq_lock); |
| 304 | 303 | ||
| 305 | if (rc < 0) | 304 | dev_info(dev, "wq %s disabled\n", dev_name(&wq->conf_dev)); |
| 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)); | ||
| 310 | } | 305 | } |
| 311 | 306 | ||
| 312 | static int idxd_config_bus_remove(struct device *dev) | 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 | if (!test_bit(IDXD_FLAG_CONFIGURABLE, &idxd->flags)) | 984 | if (!test_bit(IDXD_FLAG_CONFIGURABLE, &idxd->flags)) |
| 990 | return -EPERM; | 985 | return -EPERM; |
| 991 | 986 | ||
| 992 | if (wq->state != IDXD_WQ_DISABLED) | 987 | if (idxd->state == IDXD_DEV_ENABLED) |
| 993 | return -EPERM; | 988 | return -EPERM; |
| 994 | 989 | ||
| 995 | if (size + total_claimed_wq_size(idxd) - wq->size > idxd->max_wq_size) | 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 | struct idxd_device *idxd = | 1445 | struct idxd_device *idxd = |
| 1451 | container_of(dev, struct idxd_device, conf_dev); | 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 | static DEVICE_ATTR_RO(op_cap); | 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 | rc = request_irq(pci_irq_vector(pdev, 0), plx_dma_isr, 0, | 508 | rc = request_irq(pci_irq_vector(pdev, 0), plx_dma_isr, 0, |
| 509 | KBUILD_MODNAME, plxdev); | 509 | KBUILD_MODNAME, plxdev); |
| 510 | if (rc) { | 510 | if (rc) |
| 511 | kfree(plxdev); | 511 | goto free_plx; |
| 512 | return rc; | ||
| 513 | } | ||
| 514 | 512 | ||
| 515 | spin_lock_init(&plxdev->ring_lock); | 513 | spin_lock_init(&plxdev->ring_lock); |
| 516 | tasklet_setup(&plxdev->desc_task, plx_dma_desc_task); | 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 | rc = dma_async_device_register(dma); | 538 | rc = dma_async_device_register(dma); |
| 541 | if (rc) { | 539 | if (rc) { |
| 542 | pci_err(pdev, "Failed to register dma device: %d\n", rc); | 540 | pci_err(pdev, "Failed to register dma device: %d\n", rc); |
| 543 | free_irq(pci_irq_vector(pdev, 0), plxdev); | 541 | goto put_device; |
| 544 | kfree(plxdev); | ||
| 545 | return rc; | ||
| 546 | } | 542 | } |
| 547 | 543 | ||
| 548 | pci_set_drvdata(pdev, plxdev); | 544 | pci_set_drvdata(pdev, plxdev); |
| 549 | 545 | ||
| 550 | return 0; | 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 | static int plx_dma_probe(struct pci_dev *pdev, | 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 | goto end; | 723 | goto end; |
| 724 | } | 724 | } |
| 725 | if (!tdc->busy) { | 725 | if (!tdc->busy) { |
| 726 | err = pm_runtime_get_sync(tdc->tdma->dev); | 726 | err = pm_runtime_resume_and_get(tdc->tdma->dev); |
| 727 | if (err < 0) { | 727 | if (err < 0) { |
| 728 | dev_err(tdc2dev(tdc), "Failed to enable DMA\n"); | 728 | dev_err(tdc2dev(tdc), "Failed to enable DMA\n"); |
| 729 | goto end; | 729 | goto end; |
| @@ -818,7 +818,7 @@ static void tegra_dma_synchronize(struct dma_chan *dc) · 88 unmodified lines | |||
| 818 | struct tegra_dma_channel *tdc = to_tegra_dma_chan(dc); | 818 | struct tegra_dma_channel *tdc = to_tegra_dma_chan(dc); |
| 819 | int err; | 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 | if (err < 0) { | 822 | if (err < 0) { |
| 823 | dev_err(tdc2dev(tdc), "Failed to synchronize DMA: %d\n", err); | 823 | dev_err(tdc2dev(tdc), "Failed to synchronize DMA: %d\n", err); |
| 824 | return; | 824 | return; |
| @@ -839,6 +839,7 @@ static void xilinx_dpdma_chan_queue_transfer(struct xilinx_dpdma_chan *chan) · 838 unmodified lines | |||
| 839 | struct xilinx_dpdma_tx_desc *desc; | 839 | struct xilinx_dpdma_tx_desc *desc; |
| 840 | struct virt_dma_desc *vdesc; | 840 | struct virt_dma_desc *vdesc; |
| 841 | u32 reg, channels; | 841 | u32 reg, channels; |
| 842 | bool first_frame; | ||
| 842 | 843 | ||
| 843 | lockdep_assert_held(&chan->lock); | 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 | chan->running = true; | 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 | vdesc = vchan_next_desc(&chan->vchan); | 856 | vdesc = vchan_next_desc(&chan->vchan); |
| 864 | if (!vdesc) | 857 | if (!vdesc) |
| 865 | return; | 858 | return; |
| @@ -884,13 +877,26 @@ static void xilinx_dpdma_chan_queue_transfer(struct xilinx_dpdma_chan *chan) · 18 unmodified lines | |||
| 884 | FIELD_PREP(XILINX_DPDMA_CH_DESC_START_ADDRE_MASK, | 877 | FIELD_PREP(XILINX_DPDMA_CH_DESC_START_ADDRE_MASK, |
| 885 | upper_32_bits(sw_desc->dma_addr))); | 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 | reg = XILINX_DPDMA_GBL_TRIG_MASK(channels); | 896 | reg = XILINX_DPDMA_GBL_TRIG_MASK(channels); |
| 889 | else | 897 | else |
| 890 | reg = XILINX_DPDMA_GBL_RETRIG_MASK(channels); | 898 | reg = XILINX_DPDMA_GBL_RETRIG_MASK(channels); |
| 891 | 899 | ||
| 892 | chan->first_frame = false; | ||
| 893 | |||
| 894 | dpdma_write(xdev->reg, XILINX_DPDMA_GBL, reg); | 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 | static void xilinx_dpdma_chan_done_irq(struct xilinx_dpdma_chan *chan) | 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 | unsigned long flags; | 1052 | unsigned long flags; |
| 1047 | 1053 | ||
| 1048 | spin_lock_irqsave(&chan->lock, flags); | 1054 | spin_lock_irqsave(&chan->lock, flags); |
| 1049 | 1055 | ||
| 1050 | xilinx_dpdma_debugfs_desc_done_irq(chan); | 1056 | xilinx_dpdma_debugfs_desc_done_irq(chan); |
| 1051 | 1057 | ||
| 1058 | active = chan->desc.active; | ||
| 1052 | if (active) | 1059 | if (active) |
| 1053 | vchan_cyclic_callback(&active->vdesc); | 1060 | vchan_cyclic_callback(&active->vdesc); |
| 1054 | else | 1061 | else |
| @@ -1241,6 +1241,7 @@ int extcon_dev_register(struct extcon_dev *edev) · 1240 unmodified lines | |||
| 1241 | sizeof(*edev->nh), GFP_KERNEL); | 1241 | sizeof(*edev->nh), GFP_KERNEL); |
| 1242 | if (!edev->nh) { | 1242 | if (!edev->nh) { |
| 1243 | ret = -ENOMEM; | 1243 | ret = -ENOMEM; |
| 1244 | device_unregister(&edev->dev); | ||
| 1244 | goto err_dev; | 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 | struct client *client = file->private_data; | 346 | struct client *client = file->private_data; |
| 347 | spinlock_t *client_list_lock = &client->lynx->client_list_lock; | 347 | spinlock_t *client_list_lock = &client->lynx->client_list_lock; |
| 348 | struct nosy_stats stats; | 348 | struct nosy_stats stats; |
| 349 | int ret; | ||
| 349 | 350 | ||
| 350 | switch (cmd) { | 351 | switch (cmd) { |
| 351 | case NOSY_IOC_GET_STATS: | 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 | return 0; | 361 | return 0; |
| 361 | 362 | ||
| 362 | case NOSY_IOC_START: | 363 | case NOSY_IOC_START: |
| 364 | ret = -EBUSY; | ||
| 363 | spin_lock_irq(client_list_lock); | 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 | spin_unlock_irq(client_list_lock); | 370 | spin_unlock_irq(client_list_lock); |
| 366 | 371 | ||
| 367 | return 0; | 372 | return ret; |
| 368 | 373 | ||
| 369 | case NOSY_IOC_STOP: | 374 | case NOSY_IOC_STOP: |
| 370 | spin_lock_irq(client_list_lock); | 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 | /* first try to find a slot in an existing linked list entry */ | 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 | rsv = memremap(prsv, sizeof(*rsv), MEMREMAP_WB); | 931 | rsv = memremap(prsv, sizeof(*rsv), MEMREMAP_WB); |
| 932 | index = atomic_fetch_add_unless(&rsv->count, 1, rsv->size); | 932 | index = atomic_fetch_add_unless(&rsv->count, 1, rsv->size); |
| 933 | if (index < rsv->size) { | 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 | memunmap(rsv); | 937 | memunmap(rsv); |
| 938 | return efi_mem_reserve_iomem(addr, size); | 938 | return efi_mem_reserve_iomem(addr, size); |
| 939 | } | 939 | } |
| 940 | prsv = rsv->next; | ||
| 940 | memunmap(rsv); | 941 | memunmap(rsv); |
| 941 | } | 942 | } |
| 942 | 943 | ||
| @@ -24,7 +24,7 @@ efi_status_t check_platform_features(void) · 23 unmodified lines | |||
| 24 | return EFI_SUCCESS; | 24 | return EFI_SUCCESS; |
| 25 | 25 | ||
| 26 | tg = (read_cpuid(ID_AA64MMFR0_EL1) >> ID_AA64MMFR0_TGRAN_SHIFT) & 0xf; | 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 | if (IS_ENABLED(CONFIG_ARM64_64K_PAGES)) | 28 | if (IS_ENABLED(CONFIG_ARM64_64K_PAGES)) |
| 29 | efi_err("This 64 KB granular kernel is not supported by your CPU\n"); | 29 | efi_err("This 64 KB granular kernel is not supported by your CPU\n"); |
| 30 | else | 30 | else |
| @@ -96,6 +96,18 @@ static void install_memreserve_table(void) · 95 unmodified lines | |||
| 96 | efi_err("Failed to install memreserve config table!\n"); | 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 | * EFI entry point for the arm/arm64 EFI stubs. This is the entrypoint | 112 | * EFI entry point for the arm/arm64 EFI stubs. This is the entrypoint |
| 101 | * that is described in the PE/COFF header. Most of the code is the same | 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 | (prop_tbl->memory_protection_attribute & | 262 | (prop_tbl->memory_protection_attribute & |
| 251 | EFI_PROPERTIES_RUNTIME_MEMORY_PROTECTION_NON_EXECUTABLE_PE_DATA); | 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 | /* hibernation expects the runtime regions to stay in the same place */ | 269 | /* hibernation expects the runtime regions to stay in the same place */ |
| 254 | if (!IS_ENABLED(CONFIG_HIBERNATION) && !efi_nokaslr && !flat_va_mapping) { | 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 | break; | 491 | break; |
| 488 | case EFI_NOT_FOUND: | 492 | case EFI_NOT_FOUND: |
| 489 | break; | 493 | break; |
| @@ -2,7 +2,7 @@ · 1 unmodified line | |||
| 2 | /* | 2 | /* |
| 3 | * Turris Mox rWTM firmware driver | 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 | #include <linux/armada-37xx-rwtm-mailbox.h> | 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 | MODULE_LICENSE("GPL v2"); | 548 | MODULE_LICENSE("GPL v2"); |
| 549 | MODULE_DESCRIPTION("Turris Mox rWTM firmware driver"); | 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 | * Turris Mox Moxtet GPIO expander | 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 | #include <linux/bitops.h> | 8 | #include <linux/bitops.h> |
| @@ -174,6 +174,6 @@ static struct moxtet_driver moxtet_gpio_driver = { · 165 unmodified lines | |||
| 174 | }; | 174 | }; |
| 175 | module_moxtet_driver(moxtet_gpio_driver); | 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 | MODULE_DESCRIPTION("Turris Mox Moxtet GPIO expander"); | 178 | MODULE_DESCRIPTION("Turris Mox Moxtet GPIO expander"); |
| 179 | MODULE_LICENSE("GPL v2"); | 179 | MODULE_LICENSE("GPL v2"); |
| @@ -113,8 +113,29 @@ MODULE_DEVICE_TABLE(i2c, pca953x_id); · 112 unmodified lines | |||
| 113 | #ifdef CONFIG_GPIO_PCA953X_IRQ | 113 | #ifdef CONFIG_GPIO_PCA953X_IRQ |
| 114 | 114 | ||
| 115 | #include <linux/dmi.h> | 115 | #include <linux/dmi.h> |
| 116 | #include <linux/gpio.h> | 116 | |
| 117 | #include <linux/list.h> | 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 | static const struct dmi_system_id pca953x_dmi_acpi_irq_info[] = { | 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 | #endif | 157 | #endif |
| 190 | 158 | ||
| 191 | static const struct acpi_device_id pca953x_acpi_ids[] = { | 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 | int ret, value; | 174 | int ret, value; |
| 175 | 175 | ||
| 176 | ret = request_threaded_irq(event->irq, NULL, event->handler, | 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 | if (ret) { | 178 | if (ret) { |
| 179 | dev_err(acpi_gpio->chip->parent, | 179 | dev_err(acpi_gpio->chip->parent, |
| 180 | "Failed to setup interrupt handler for %d\n", | 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 | if (!lookup->desc) { | 677 | if (!lookup->desc) { |
| 678 | const struct acpi_resource_gpio *agpio = &ares->data.gpio; | 678 | const struct acpi_resource_gpio *agpio = &ares->data.gpio; |
| 679 | bool gpioint = agpio->connection_type == ACPI_RESOURCE_GPIO_TYPE_INT; | 679 | bool gpioint = agpio->connection_type == ACPI_RESOURCE_GPIO_TYPE_INT; |
| 680 | struct gpio_desc *desc; | ||
| 680 | u16 pin_index; | 681 | u16 pin_index; |
| 681 | 682 | ||
| 682 | if (lookup->info.quirks & ACPI_GPIO_QUIRK_ONLY_GPIOIO && gpioint) | 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 | if (pin_index >= agpio->pin_table_length) | 690 | if (pin_index >= agpio->pin_table_length) |
| 690 | return 1; | 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 | agpio->pin_table[pin_index]); | 697 | agpio->pin_table[pin_index]); |
| 698 | lookup->desc = desc; | ||
| 694 | lookup->info.pin_config = agpio->pin_config; | 699 | lookup->info.pin_config = agpio->pin_config; |
| 695 | lookup->info.debounce = agpio->debounce_timeout; | 700 | lookup->info.debounce = agpio->debounce_timeout; |
| 696 | lookup->info.gpioint = gpioint; | 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 | * @adev: pointer to a ACPI device to get IRQ from | 949 | * @adev: pointer to a ACPI device to get IRQ from |
| 950 | * @name: optional name of GpioInt resource | ||
| 945 | * @index: index of GpioInt resource (starting from %0) | 951 | * @index: index of GpioInt resource (starting from %0) |
| 946 | * | 952 | * |
| 947 | * If the device has one or more GpioInt resources, this function can be | 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 | * The function is idempotent, though each time it runs it will configure GPIO | 957 | * The function is idempotent, though each time it runs it will configure GPIO |
| 952 | * pin direction according to the flags in GpioInt resource. | 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 | * Return: Linux IRQ number (> %0) on success, negative errno on failure. | 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 | int idx, i; | 967 | int idx, i; |
| 959 | unsigned int irq_flags; | 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 | struct acpi_gpio_info info; | 972 | struct acpi_gpio_info info; |
| 964 | struct gpio_desc *desc; | 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 | /* Ignore -EPROBE_DEFER, it only matters if idx matches */ | 977 | /* Ignore -EPROBE_DEFER, it only matters if idx matches */ |
| 969 | if (IS_ERR(desc) && PTR_ERR(desc) != -EPROBE_DEFER) | 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 | return -ENOENT; | 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 | static acpi_status | 1022 | static acpi_status |
| 1014 | acpi_gpio_adr_space_handler(u32 function, acpi_physical_address address, | 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 | long gpio; | 458 | long gpio; |
| 459 | struct gpio_desc *desc; | 459 | struct gpio_desc *desc; |
| 460 | int status; | 460 | int status; |
| 461 | struct gpio_chip *gc; | ||
| 462 | int offset; | ||
| 461 | 463 | ||
| 462 | status = kstrtol(buf, 0, &gpio); | 464 | status = kstrtol(buf, 0, &gpio); |
| 463 | if (status < 0) | 465 | if (status < 0) |
| @@ -469,6 +471,12 @@ static ssize_t export_store(struct class *class, · 5 unmodified lines | |||
| 469 | pr_warn("%s: invalid GPIO %ld\n", __func__, gpio); | 471 | pr_warn("%s: invalid GPIO %ld\n", __func__, gpio); |
| 470 | return -EINVAL; | 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 | /* No extra locking here; FLAG_SYSFS just signifies that the | 481 | /* No extra locking here; FLAG_SYSFS just signifies that the |
| 474 | * request and export were done by on behalf of userspace, so | 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 | * Looks for device property "gpio-line-names" and if it exists assigns | 368 | * Looks for device property "gpio-line-names" and if it exists assigns |
| 369 | * GPIO line names for the chip. The memory allocated for the assigned | 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 | * by the caller. | 371 | * by the caller. |
| 372 | */ | 372 | */ |
| 373 | static int devprop_gpiochip_set_names(struct gpio_chip *chip) | 373 | static int devprop_gpiochip_set_names(struct gpio_chip *chip) |
| 374 | { | 374 | { |
| 375 | struct gpio_device *gdev = chip->gpiodev; | 375 | struct gpio_device *gdev = chip->gpiodev; |
| 376 | struct device *dev = chip->parent; | 376 | struct fwnode_handle *fwnode = dev_fwnode(&gdev->dev); |
| 377 | const char **names; | 377 | const char **names; |
| 378 | int ret, i; | 378 | int ret, i; |
| 379 | int count; | 379 | int count; |
| 380 | 380 | ||
| 381 | /* GPIO chip may not have a parent device whose properties we inspect. */ | 381 | count = fwnode_property_string_array_count(fwnode, "gpio-line-names"); |
| 382 | if (!dev) | ||
| 383 | return 0; | ||
| 384 | |||
| 385 | count = device_property_string_array_count(dev, "gpio-line-names"); | ||
| 386 | if (count < 0) | 382 | if (count < 0) |
| 387 | return 0; | 383 | return 0; |
| 388 | 384 | ||
| @@ -396,7 +392,7 @@ static int devprop_gpiochip_set_names(struct gpio_chip *chip) · 7 unmodified lines | |||
| 396 | if (!names) | 392 | if (!names) |
| 397 | return -ENOMEM; | 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 | names, count); | 396 | names, count); |
| 401 | if (ret < 0) { | 397 | if (ret < 0) { |
| 402 | dev_warn(&gdev->dev, "failed to read GPIO line names\n"); | 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 | static void gpiodevice_release(struct device *dev) | 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 | list_del(&gdev->list); | 477 | list_del(&gdev->list); |
| 478 | spin_unlock_irqrestore(&gpio_lock, flags); | ||
| 479 | |||
| 480 | ida_free(&gpio_ida, gdev->id); | 480 | ida_free(&gpio_ida, gdev->id); |
| 481 | kfree_const(gdev->label); | 481 | kfree_const(gdev->label); |
| 482 | kfree(gdev->descs); | 482 | kfree(gdev->descs); |
| @@ -571,6 +571,7 @@ int gpiochip_add_data_with_key(struct gpio_chip *gc, void *data, · 88 unmodified lines | |||
| 571 | struct lock_class_key *lock_key, | 571 | struct lock_class_key *lock_key, |
| 572 | struct lock_class_key *request_key) | 572 | struct lock_class_key *request_key) |
| 573 | { | 573 | { |
| 574 | struct fwnode_handle *fwnode = gc->parent ? dev_fwnode(gc->parent) : NULL; | ||
| 574 | unsigned long flags; | 575 | unsigned long flags; |
| 575 | int ret = 0; | 576 | int ret = 0; |
| 576 | unsigned i; | 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 | of_gpio_dev_init(gc, gdev); | 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 | gdev->id = ida_alloc(&gpio_ida, GFP_KERNEL); | 604 | gdev->id = ida_alloc(&gpio_ida, GFP_KERNEL); |
| 598 | if (gdev->id < 0) { | 605 | if (gdev->id < 0) { |
| 599 | ret = gdev->id; | 606 | ret = gdev->id; |
| @@ -605,7 +612,6 @@ int gpiochip_add_data_with_key(struct gpio_chip *gc, void *data, · 5 unmodified lines | |||
| 605 | goto err_free_ida; | 612 | goto err_free_ida; |
| 606 | 613 | ||
| 607 | device_initialize(&gdev->dev); | 614 | device_initialize(&gdev->dev); |
| 608 | dev_set_drvdata(&gdev->dev, gdev); | ||
| 609 | if (gc->parent && gc->parent->driver) | 615 | if (gc->parent && gc->parent->driver) |
| 610 | gdev->owner = gc->parent->driver->owner; | 616 | gdev->owner = gc->parent->driver->owner; |
| 611 | else if (gc->owner) | 617 | else if (gc->owner) |
| @@ -4257,7 +4263,8 @@ static int __init gpiolib_dev_init(void) · 3645 unmodified lines | |||
| 4257 | return ret; | 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 | pr_err("gpiolib: could not register GPIO stub driver\n"); | 4268 | pr_err("gpiolib: could not register GPIO stub driver\n"); |
| 4262 | bus_unregister(&gpio_bus_type); | 4269 | bus_unregister(&gpio_bus_type); |
| 4263 | return ret; | 4270 | return ret; |
| @@ -228,6 +228,7 @@ source "drivers/gpu/drm/arm/Kconfig" · 227 unmodified lines | |||
| 228 | config DRM_RADEON | 228 | config DRM_RADEON |
| 229 | tristate "ATI Radeon" | 229 | tristate "ATI Radeon" |
| 230 | depends on DRM && PCI && MMU | 230 | depends on DRM && PCI && MMU |
| 231 | depends on AGP || !AGP | ||
| 231 | select FW_LOADER | 232 | select FW_LOADER |
| 232 | select DRM_KMS_HELPER | 233 | select DRM_KMS_HELPER |
| 233 | select DRM_TTM | 234 | select DRM_TTM |
| @@ -180,6 +180,7 @@ extern uint amdgpu_smu_memory_pool_size; · 179 unmodified lines | |||
| 180 | extern uint amdgpu_dc_feature_mask; | 180 | extern uint amdgpu_dc_feature_mask; |
| 181 | extern uint amdgpu_dc_debug_mask; | 181 | extern uint amdgpu_dc_debug_mask; |
| 182 | extern uint amdgpu_dm_abm_level; | 182 | extern uint amdgpu_dm_abm_level; |
| 183 | extern int amdgpu_backlight; | ||
| 183 | extern struct amdgpu_mgpu_info mgpu_info; | 184 | extern struct amdgpu_mgpu_info mgpu_info; |
| 184 | extern int amdgpu_ras_enable; | 185 | extern int amdgpu_ras_enable; |
| 185 | extern uint amdgpu_ras_mask; | 186 | extern uint amdgpu_ras_mask; |
| @@ -1006,13 +1007,9 @@ struct amdgpu_device { · 820 unmodified lines | |||
| 1006 | 1007 | ||
| 1007 | /* s3/s4 mask */ | 1008 | /* s3/s4 mask */ |
| 1008 | bool in_suspend; | 1009 | bool in_suspend; |
| 1009 | bool in_hibernate; | 1010 | bool in_s3; |
| 1010 | 1011 | bool in_s4; | |
| 1011 | /* | 1012 | bool in_s0ix; |
| 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; | ||
| 1016 | 1013 | ||
| 1017 | atomic_t in_gpu_reset; | 1014 | atomic_t in_gpu_reset; |
| 1018 | enum pp_mp1_state mp1_state; | 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 | bool amdgpu_acpi_is_s0ix_supported(struct amdgpu_device *adev) | 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 | if (acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0) { | 907 | if (acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0) { |
| 908 | if (adev->flags & AMD_IS_APU) | 908 | if (adev->flags & AMD_IS_APU) |
| 909 | return true; | 909 | return true; |
| @@ -2371,6 +2371,10 @@ static int amdgpu_device_set_cg_state(struct amdgpu_device *adev, · 2370 unmodified lines | |||
| 2371 | i = state == AMD_CG_STATE_GATE ? j : adev->num_ip_blocks - j - 1; | 2371 | i = state == AMD_CG_STATE_GATE ? j : adev->num_ip_blocks - j - 1; |
| 2372 | if (!adev->ip_blocks[i].status.late_initialized) | 2372 | if (!adev->ip_blocks[i].status.late_initialized) |
| 2373 | continue; | 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 | /* skip CG for VCE/UVD, it's handled specially */ | 2378 | /* skip CG for VCE/UVD, it's handled specially */ |
| 2375 | if (adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_UVD && | 2379 | if (adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_UVD && |
| 2376 | adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_VCE && | 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 | i = state == AMD_PG_STATE_GATE ? j : adev->num_ip_blocks - j - 1; | 2406 | i = state == AMD_PG_STATE_GATE ? j : adev->num_ip_blocks - j - 1; |
| 2403 | if (!adev->ip_blocks[i].status.late_initialized) | 2407 | if (!adev->ip_blocks[i].status.late_initialized) |
| 2404 | continue; | 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 | /* skip CG for VCE/UVD, it's handled specially */ | 2413 | /* skip CG for VCE/UVD, it's handled specially */ |
| 2406 | if (adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_UVD && | 2414 | if (adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_UVD && |
| 2407 | adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_VCE && | 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 | int i, r; | 2687 | int i, r; |
| 2680 | 2688 | ||
| 2681 | if (adev->in_poweroff_reboot_com || | 2689 | amdgpu_device_set_pg_state(adev, AMD_PG_STATE_UNGATE); |
| 2682 | !amdgpu_acpi_is_s0ix_supported(adev) || amdgpu_in_reset(adev)) { | 2690 | amdgpu_device_set_cg_state(adev, AMD_CG_STATE_UNGATE); |
| 2683 | amdgpu_device_set_pg_state(adev, AMD_PG_STATE_UNGATE); | ||
| 2684 | amdgpu_device_set_cg_state(adev, AMD_CG_STATE_UNGATE); | ||
| 2685 | } | ||
| 2686 | 2691 | ||
| 2687 | for (i = adev->num_ip_blocks - 1; i >= 0; i--) { | 2692 | for (i = adev->num_ip_blocks - 1; i >= 0; i--) { |
| 2688 | if (!adev->ip_blocks[i].status.valid) | 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 | int i, r; | 2728 | int i, r; |
| 2724 | 2729 | ||
| 2730 | if (adev->in_s0ix) | ||
| 2731 | amdgpu_gfx_state_change_set(adev, sGpuChangeState_D3Entry); | ||
| 2732 | |||
| 2725 | for (i = adev->num_ip_blocks - 1; i >= 0; i--) { | 2733 | for (i = adev->num_ip_blocks - 1; i >= 0; i--) { |
| 2726 | if (!adev->ip_blocks[i].status.valid) | 2734 | if (!adev->ip_blocks[i].status.valid) |
| 2727 | continue; | 2735 | continue; |
| @@ -2734,6 +2742,17 @@ static int amdgpu_device_ip_suspend_phase2(struct amdgpu_device *adev) · 6 unmodified lines | |||
| 2734 | adev->ip_blocks[i].status.hw = false; | 2742 | adev->ip_blocks[i].status.hw = false; |
| 2735 | continue; | 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 | /* XXX handle errors */ | 2756 | /* XXX handle errors */ |
| 2738 | r = adev->ip_blocks[i].version->funcs->suspend(adev); | 2757 | r = adev->ip_blocks[i].version->funcs->suspend(adev); |
| 2739 | /* XXX handle errors */ | 2758 | /* XXX handle errors */ |
| @@ -3673,14 +3692,9 @@ void amdgpu_device_fini(struct amdgpu_device *adev) · 933 unmodified lines | |||
| 3673 | */ | 3692 | */ |
| 3674 | int amdgpu_device_suspend(struct drm_device *dev, bool fbcon) | 3693 | int amdgpu_device_suspend(struct drm_device *dev, bool fbcon) |
| 3675 | { | 3694 | { |
| 3676 | struct amdgpu_device *adev; | 3695 | struct amdgpu_device *adev = drm_to_adev(dev); |
| 3677 | struct drm_crtc *crtc; | ||
| 3678 | struct drm_connector *connector; | ||
| 3679 | struct drm_connector_list_iter iter; | ||
| 3680 | int r; | 3696 | int r; |
| 3681 | 3697 | ||
| 3682 | adev = drm_to_adev(dev); | ||
| 3683 | |||
| 3684 | if (dev->switch_power_state == DRM_SWITCH_POWER_OFF) | 3698 | if (dev->switch_power_state == DRM_SWITCH_POWER_OFF) |
| 3685 | return 0; | 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 | cancel_delayed_work_sync(&adev->delayed_init_work); | 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 | amdgpu_ras_suspend(adev); | 3709 | amdgpu_ras_suspend(adev); |
| 3735 | 3710 | ||
| 3736 | r = amdgpu_device_ip_suspend_phase1(adev); | 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 | /* evict vram memory */ | 3716 | /* evict vram memory */ |
| 3741 | amdgpu_bo_evict_vram(adev); | 3717 | amdgpu_bo_evict_vram(adev); |
| 3742 | 3718 | ||
| 3743 | amdgpu_fence_driver_suspend(adev); | 3719 | amdgpu_fence_driver_suspend(adev); |
| 3744 | 3720 | ||
| 3745 | if (adev->in_poweroff_reboot_com || | 3721 | r = amdgpu_device_ip_suspend_phase2(adev); |
| 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); | ||
| 3750 | /* evict remaining vram memory | 3722 | /* evict remaining vram memory |
| 3751 | * This second call to evict vram is to evict the gart page table | 3723 | * This second call to evict vram is to evict the gart page table |
| 3752 | * using the CPU. | 3724 | * using the CPU. |
| @@ -3768,16 +3740,13 @@ int amdgpu_device_suspend(struct drm_device *dev, bool fbcon) · 15 unmodified lines | |||
| 3768 | */ | 3740 | */ |
| 3769 | int amdgpu_device_resume(struct drm_device *dev, bool fbcon) | 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 | struct amdgpu_device *adev = drm_to_adev(dev); | 3743 | struct amdgpu_device *adev = drm_to_adev(dev); |
| 3774 | struct drm_crtc *crtc; | ||
| 3775 | int r = 0; | 3744 | int r = 0; |
| 3776 | 3745 | ||
| 3777 | if (dev->switch_power_state == DRM_SWITCH_POWER_OFF) | 3746 | if (dev->switch_power_state == DRM_SWITCH_POWER_OFF) |
| 3778 | return 0; | 3747 | return 0; |
| 3779 | 3748 | ||
| 3780 | if (amdgpu_acpi_is_s0ix_supported(adev)) | 3749 | if (adev->in_s0ix) |
| 3781 | amdgpu_gfx_state_change_set(adev, sGpuChangeState_D0Entry); | 3750 | amdgpu_gfx_state_change_set(adev, sGpuChangeState_D0Entry); |
| 3782 | 3751 | ||
| 3783 | /* post card */ | 3752 | /* post card */ |
| @@ -3802,50 +3771,17 @@ int amdgpu_device_resume(struct drm_device *dev, bool fbcon) · 18 unmodified lines | |||
| 3802 | queue_delayed_work(system_wq, &adev->delayed_init_work, | 3771 | queue_delayed_work(system_wq, &adev->delayed_init_work, |
| 3803 | msecs_to_jiffies(AMDGPU_RESUME_MS)); | 3772 | msecs_to_jiffies(AMDGPU_RESUME_MS)); |
| 3804 | 3773 | ||
| 3805 | if (!amdgpu_device_has_dc_support(adev)) { | 3774 | if (!adev->in_s0ix) { |
| 3806 | /* pin cursors */ | 3775 | r = amdgpu_amdkfd_resume(adev, adev->in_runpm); |
| 3807 | list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { | 3776 | if (r) |
| 3808 | struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); | 3777 | return r; |
| 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 | } | ||
| 3822 | } | 3778 | } |
| 3823 | r = amdgpu_amdkfd_resume(adev, adev->in_runpm); | ||
| 3824 | if (r) | ||
| 3825 | return r; | ||
| 3826 | 3779 | ||
| 3827 | /* Make sure IB tests flushed */ | 3780 | /* Make sure IB tests flushed */ |
| 3828 | flush_delayed_work(&adev->delayed_init_work); | 3781 | flush_delayed_work(&adev->delayed_init_work); |
| 3829 | 3782 | ||
| 3830 | /* blat the mode back in */ | 3783 | if (fbcon) |
| 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 | } | ||
| 3847 | amdgpu_fbdev_set_suspend(adev, 0); | 3784 | amdgpu_fbdev_set_suspend(adev, 0); |
| 3848 | } | ||
| 3849 | 3785 | ||
| 3850 | drm_kms_helper_poll_enable(dev); | 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 | return amdgpu_display_get_crtc_scanoutpos(dev, pipe, 0, vpos, hpos, | 1310 | return amdgpu_display_get_crtc_scanoutpos(dev, pipe, 0, vpos, hpos, |
| 1311 | stime, etime, mode); | 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 | const struct drm_format_info * | 47 | const struct drm_format_info * |
| 48 | amdgpu_lookup_format_info(u32 format, uint64_t modifier); | 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 | #endif | 53 | #endif |
| @@ -781,6 +781,10 @@ uint amdgpu_dm_abm_level; · 780 unmodified lines | |||
| 781 | MODULE_PARM_DESC(abmlevel, "ABM level (0 = off (default), 1-4 = backlight reduction level) "); | 781 | MODULE_PARM_DESC(abmlevel, "ABM level (0 = off (default), 1-4 = backlight reduction level) "); |
| 782 | module_param_named(abmlevel, amdgpu_dm_abm_level, uint, 0444); | 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 | * DOC: tmz (int) | 789 | * DOC: tmz (int) |
| 786 | * Trusted Memory Zone (TMZ) is a method to protect data being written | 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 | {0x1002, 0x73A3, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SIENNA_CICHLID}, | 1107 | {0x1002, 0x73A3, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SIENNA_CICHLID}, |
| 1104 | {0x1002, 0x73AB, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SIENNA_CICHLID}, | 1108 | {0x1002, 0x73AB, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SIENNA_CICHLID}, |
| 1105 | {0x1002, 0x73AE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SIENNA_CICHLID}, | 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 | {0x1002, 0x73BF, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SIENNA_CICHLID}, | 1111 | {0x1002, 0x73BF, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SIENNA_CICHLID}, |
| 1107 | 1112 | ||
| 1108 | /* Van Gogh */ | 1113 | /* Van Gogh */ |
| @@ -1270,24 +1275,35 @@ amdgpu_pci_shutdown(struct pci_dev *pdev) · 161 unmodified lines | |||
| 1270 | */ | 1275 | */ |
| 1271 | if (!amdgpu_passthrough(adev)) | 1276 | if (!amdgpu_passthrough(adev)) |
| 1272 | adev->mp1_state = PP_MP1_STATE_UNLOAD; | 1277 | adev->mp1_state = PP_MP1_STATE_UNLOAD; |
| 1273 | adev->in_poweroff_reboot_com = true; | ||
| 1274 | amdgpu_device_ip_suspend(adev); | 1278 | amdgpu_device_ip_suspend(adev); |
| 1275 | adev->in_poweroff_reboot_com = false; | ||
| 1276 | adev->mp1_state = PP_MP1_STATE_NONE; | 1279 | adev->mp1_state = PP_MP1_STATE_NONE; |
| 1277 | } | 1280 | } |
| 1278 | 1281 | ||
| 1279 | static int amdgpu_pmops_suspend(struct device *dev) | 1282 | static int amdgpu_pmops_suspend(struct device *dev) |
| 1280 | { | 1283 | { |
| 1281 | struct drm_device *drm_dev = dev_get_drvdata(dev); | 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 | static int amdgpu_pmops_resume(struct device *dev) | 1297 | static int amdgpu_pmops_resume(struct device *dev) |
| 1287 | { | 1298 | { |
| 1288 | struct drm_device *drm_dev = dev_get_drvdata(dev); | 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 | static int amdgpu_pmops_freeze(struct device *dev) | 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 | struct amdgpu_device *adev = drm_to_adev(drm_dev); | 1312 | struct amdgpu_device *adev = drm_to_adev(drm_dev); |
| 1297 | int r; | 1313 | int r; |
| 1298 | 1314 | ||
| 1299 | adev->in_hibernate = true; | 1315 | adev->in_s4 = true; |
| 1300 | r = amdgpu_device_suspend(drm_dev, true); | 1316 | r = amdgpu_device_suspend(drm_dev, true); |
| 1301 | adev->in_hibernate = false; | 1317 | adev->in_s4 = false; |
| 1302 | if (r) | 1318 | if (r) |
| 1303 | return r; | 1319 | return r; |
| 1304 | return amdgpu_asic_reset(adev); | 1320 | return amdgpu_asic_reset(adev); |
| @@ -1314,13 +1330,8 @@ static int amdgpu_pmops_thaw(struct device *dev) · 9 unmodified lines | |||
| 1314 | static int amdgpu_pmops_poweroff(struct device *dev) | 1330 | static int amdgpu_pmops_poweroff(struct device *dev) |
| 1315 | { | 1331 | { |
| 1316 | struct drm_device *drm_dev = dev_get_drvdata(dev); | 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; | 1334 | return amdgpu_device_suspend(drm_dev, true); |
| 1321 | r = amdgpu_device_suspend(drm_dev, true); | ||
| 1322 | adev->in_poweroff_reboot_com = false; | ||
| 1323 | return r; | ||
| 1324 | } | 1335 | } |
| 1325 | 1336 | ||
| 1326 | static int amdgpu_pmops_restore(struct device *dev) | 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 | size = mode_cmd->pitches[0] * height; | 146 | size = mode_cmd->pitches[0] * height; |
| 147 | aligned_size = ALIGN(size, PAGE_SIZE); | 147 | aligned_size = ALIGN(size, PAGE_SIZE); |
| 148 | ret = amdgpu_gem_object_create(adev, aligned_size, 0, domain, flags, | 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 | if (ret) { | 150 | if (ret) { |
| 151 | pr_err("failed to allocate framebuffer (%d)\n", aligned_size); | 151 | pr_err("failed to allocate framebuffer (%d)\n", aligned_size); |
| 152 | return -ENOMEM; | 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 | dev_info->high_va_offset = AMDGPU_GMC_HOLE_END; | 778 | dev_info->high_va_offset = AMDGPU_GMC_HOLE_END; |
| 779 | dev_info->high_va_max = AMDGPU_GMC_HOLE_END | vm_size; | 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 | dev_info->pte_fragment_size = (1 << adev->vm_manager.fragment_size) * AMDGPU_GPU_PAGE_SIZE; | 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 | dev_info->cu_active_number = adev->gfx.cu_info.number; | 784 | dev_info->cu_active_number = adev->gfx.cu_info.number; |
| 785 | dev_info->cu_ao_mask = adev->gfx.cu_info.ao_cu_mask; | 785 | dev_info->cu_ao_mask = adev->gfx.cu_info.ao_cu_mask; |
| 786 | dev_info->ce_ram_size = adev->gfx.ce_ram_size; | 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 | struct ttm_resource_manager *man; | 1029 | struct ttm_resource_manager *man; |
| 1030 | 1030 | ||
| 1031 | /* late 2.6.33 fix IGP hibernate - we need pm ops to do this correct */ | 1031 | if (adev->in_s3 && (adev->flags & AMD_IS_APU)) { |
| 1032 | #ifndef CONFIG_HIBERNATION | 1032 | /* No need to evict vram on APUs for suspend to ram */ |
| 1033 | if (adev->flags & AMD_IS_APU) { | ||
| 1034 | /* Useless to evict on IGP chips */ | ||
| 1035 | return 0; | 1033 | return 0; |
| 1036 | } | 1034 | } |
| 1037 | #endif | ||
| 1038 | 1035 | ||
| 1039 | man = ttm_manager_type(&adev->mman.bdev, TTM_PL_VRAM); | 1036 | man = ttm_manager_type(&adev->mman.bdev, TTM_PL_VRAM); |
| 1040 | return ttm_resource_manager_evict_all(&adev->mman.bdev, man); | 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 | /* Allocate an SG array and squash pages into it */ | 907 | /* Allocate an SG array and squash pages into it */ |
| 908 | r = sg_alloc_table_from_pages(ttm->sg, ttm->pages, ttm->num_pages, 0, | 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 | GFP_KERNEL); | 910 | GFP_KERNEL); |
| 911 | if (r) | 911 | if (r) |
| 912 | goto release_sg; | 912 | goto release_sg; |
| @@ -2197,8 +2197,8 @@ int amdgpu_vm_bo_map(struct amdgpu_device *adev, · 2196 unmodified lines | |||
| 2197 | uint64_t eaddr; | 2197 | uint64_t eaddr; |
| 2198 | 2198 | ||
| 2199 | /* validate the parameters */ | 2199 | /* validate the parameters */ |
| 2200 | if (saddr & AMDGPU_GPU_PAGE_MASK || offset & AMDGPU_GPU_PAGE_MASK || | 2200 | if (saddr & ~PAGE_MASK || offset & ~PAGE_MASK || |
| 2201 | size == 0 || size & AMDGPU_GPU_PAGE_MASK) | 2201 | size == 0 || size & ~PAGE_MASK) |
| 2202 | return -EINVAL; | 2202 | return -EINVAL; |
| 2203 | 2203 | ||
| 2204 | /* make sure object fit at this offset */ | 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 | int r; | 2263 | int r; |
| 2264 | 2264 | ||
| 2265 | /* validate the parameters */ | 2265 | /* validate the parameters */ |
| 2266 | if (saddr & AMDGPU_GPU_PAGE_MASK || offset & AMDGPU_GPU_PAGE_MASK || | 2266 | if (saddr & ~PAGE_MASK || offset & ~PAGE_MASK || |
| 2267 | size == 0 || size & AMDGPU_GPU_PAGE_MASK) | 2267 | size == 0 || size & ~PAGE_MASK) |
| 2268 | return -EINVAL; | 2268 | return -EINVAL; |
| 2269 | 2269 | ||
| 2270 | /* make sure object fit at this offset */ | 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 | after->start = eaddr + 1; | 2409 | after->start = eaddr + 1; |
| 2410 | after->last = tmp->last; | 2410 | after->last = tmp->last; |
| 2411 | after->offset = tmp->offset; | 2411 | after->offset = tmp->offset; |
| 2412 | after->offset += after->start - tmp->start; | 2412 | after->offset += (after->start - tmp->start) << PAGE_SHIFT; |
| 2413 | after->flags = tmp->flags; | 2413 | after->flags = tmp->flags; |
| 2414 | after->bo_va = tmp->bo_va; | 2414 | after->bo_va = tmp->bo_va; |
| 2415 | list_add(&after->list, &tmp->bo_va->invalids); | 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 | static int dce_v10_0_suspend(void *handle) | 2897 | static int dce_v10_0_suspend(void *handle) |
| 2898 | { | 2898 | { |
| 2899 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; | 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 | adev->mode_info.bl_level = | 2906 | adev->mode_info.bl_level = |
| 2902 | amdgpu_atombios_encoder_get_backlight_level_from_reg(adev); | 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 | amdgpu_display_backlight_set_level(adev, adev->mode_info.bl_encoder, | 2926 | amdgpu_display_backlight_set_level(adev, adev->mode_info.bl_encoder, |
| 2922 | bl_level); | 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 | static bool dce_v10_0_is_idle(void *handle) | 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 | static int dce_v11_0_suspend(void *handle) | 3027 | static int dce_v11_0_suspend(void *handle) |
| 3028 | { | 3028 | { |
| 3029 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; | 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 | adev->mode_info.bl_level = | 3036 | adev->mode_info.bl_level = |
| 3032 | amdgpu_atombios_encoder_get_backlight_level_from_reg(adev); | 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 | amdgpu_display_backlight_set_level(adev, adev->mode_info.bl_encoder, | 3056 | amdgpu_display_backlight_set_level(adev, adev->mode_info.bl_encoder, |
| 3052 | bl_level); | 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 | static bool dce_v11_0_is_idle(void *handle) | 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 | static int dce_v6_0_suspend(void *handle) | 2770 | static int dce_v6_0_suspend(void *handle) |
| 2771 | { | 2771 | { |
| 2772 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; | 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 | adev->mode_info.bl_level = | 2778 | adev->mode_info.bl_level = |
| 2775 | amdgpu_atombios_encoder_get_backlight_level_from_reg(adev); | 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 | amdgpu_display_backlight_set_level(adev, adev->mode_info.bl_encoder, | 2798 | amdgpu_display_backlight_set_level(adev, adev->mode_info.bl_encoder, |
| 2795 | bl_level); | 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 | static bool dce_v6_0_is_idle(void *handle) | 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 | static int dce_v8_0_suspend(void *handle) | 2796 | static int dce_v8_0_suspend(void *handle) |
| 2797 | { | 2797 | { |
| 2798 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; | 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 | adev->mode_info.bl_level = | 2805 | adev->mode_info.bl_level = |
| 2801 | amdgpu_atombios_encoder_get_backlight_level_from_reg(adev); | 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 | amdgpu_display_backlight_set_level(adev, adev->mode_info.bl_encoder, | 2825 | amdgpu_display_backlight_set_level(adev, adev->mode_info.bl_encoder, |
| 2821 | bl_level); | 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 | static bool dce_v8_0_is_idle(void *handle) | 2834 | static bool dce_v8_0_is_idle(void *handle) |
| @@ -39,6 +39,7 @@ · 38 unmodified lines | |||
| 39 | #include "dce_v11_0.h" | 39 | #include "dce_v11_0.h" |
| 40 | #include "dce_virtual.h" | 40 | #include "dce_virtual.h" |
| 41 | #include "ivsrcid/ivsrcid_vislands30.h" | 41 | #include "ivsrcid/ivsrcid_vislands30.h" |
| 42 | #include "amdgpu_display.h" | ||
| 42 | 43 | ||
| 43 | #define DCE_VIRTUAL_VBLANK_PERIOD 16666666 | 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 | static int dce_virtual_suspend(void *handle) | 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 | return dce_virtual_hw_fini(handle); | 501 | return dce_virtual_hw_fini(handle); |
| 495 | } | 502 | } |
| 496 | 503 | ||
| 497 | static int dce_virtual_resume(void *handle) | 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 | static bool dce_virtual_is_idle(void *handle) | 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 | /* Wait till CP writes sync code: */ | 156 | /* Wait till CP writes sync code: */ |
| 157 | status = amdkfd_fence_wait_timeout( | 157 | status = amdkfd_fence_wait_timeout( |
| 158 | (unsigned int *) rm_state, | 158 | rm_state, |
| 159 | QUEUESTATE__ACTIVE, 1500); | 159 | QUEUESTATE__ACTIVE, 1500); |
| 160 | 160 | ||
| 161 | kfd_gtt_sa_free(dbgdev->dev, mem_obj); | 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 | if (retval) | 1167 | if (retval) |
| 1168 | goto fail_allocate_vidmem; | 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 | dqm->fence_gpu_addr = dqm->fence_mem->gpu_addr; | 1171 | dqm->fence_gpu_addr = dqm->fence_mem->gpu_addr; |
| 1172 | 1172 | ||
| 1173 | init_interrupts(dqm); | 1173 | init_interrupts(dqm); |
| @@ -1340,8 +1340,8 @@ out: · 166 unmodified lines | |||
| 1340 | return retval; | 1340 | return retval; |
| 1341 | } | 1341 | } |
| 1342 | 1342 | ||
| 1343 | int amdkfd_fence_wait_timeout(unsigned int *fence_addr, | 1343 | int amdkfd_fence_wait_timeout(uint64_t *fence_addr, |
| 1344 | unsigned int fence_value, | 1344 | uint64_t fence_value, |
| 1345 | unsigned int timeout_ms) | 1345 | unsigned int timeout_ms) |
| 1346 | { | 1346 | { |
| 1347 | unsigned long end_jiffies = msecs_to_jiffies(timeout_ms) + jiffies; | 1347 | unsigned long end_jiffies = msecs_to_jiffies(timeout_ms) + jiffies; |
| @@ -192,7 +192,7 @@ struct device_queue_manager { · 191 unmodified lines | |||
| 192 | uint16_t vmid_pasid[VMID_NUM]; | 192 | uint16_t vmid_pasid[VMID_NUM]; |
| 193 | uint64_t pipelines_addr; | 193 | uint64_t pipelines_addr; |
| 194 | uint64_t fence_gpu_addr; | 194 | uint64_t fence_gpu_addr; |
| 195 | unsigned int *fence_addr; | 195 | uint64_t *fence_addr; |
| 196 | struct kfd_mem_obj *fence_mem; | 196 | struct kfd_mem_obj *fence_mem; |
| 197 | bool active_runlist; | 197 | bool active_runlist; |
| 198 | int sched_policy; | 198 | int sched_policy; |
| @@ -347,7 +347,7 @@ fail_create_runlist_ib: · 346 unmodified lines | |||
| 347 | } | 347 | } |
| 348 | 348 | ||
| 349 | int pm_send_query_status(struct packet_manager *pm, uint64_t fence_address, | 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 | uint32_t *buffer, size; | 352 | uint32_t *buffer, size; |
| 353 | int retval = 0; | 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 | static int pm_query_status_v9(struct packet_manager *pm, uint32_t *buffer, | 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 | struct pm4_mes_query_status *packet; | 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 | static int pm_query_status_vi(struct packet_manager *pm, uint32_t *buffer, | 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 | struct pm4_mes_query_status *packet; | 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 | u32 *ctl_stack_used_size, | 1003 | u32 *ctl_stack_used_size, |
| 1004 | u32 *save_area_used_size); | 1004 | u32 *save_area_used_size); |
| 1005 | 1005 | ||
| 1006 | int amdkfd_fence_wait_timeout(unsigned int *fence_addr, | 1006 | int amdkfd_fence_wait_timeout(uint64_t *fence_addr, |
| 1007 | unsigned int fence_value, | 1007 | uint64_t fence_value, |
| 1008 | unsigned int timeout_ms); | 1008 | unsigned int timeout_ms); |
| 1009 | 1009 | ||
| 1010 | /* Packet Manager */ | 1010 | /* Packet Manager */ |
| @@ -1040,7 +1040,7 @@ struct packet_manager_funcs { · 29 unmodified lines | |||
| 1040 | uint32_t filter_param, bool reset, | 1040 | uint32_t filter_param, bool reset, |
| 1041 | unsigned int sdma_engine); | 1041 | unsigned int sdma_engine); |
| 1042 | int (*query_status)(struct packet_manager *pm, uint32_t *buffer, | 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 | int (*release_mem)(uint64_t gpu_addr, uint32_t *buffer); | 1044 | int (*release_mem)(uint64_t gpu_addr, uint32_t *buffer); |
| 1045 | 1045 | ||
| 1046 | /* Packet sizes */ | 1046 | /* Packet sizes */ |
| @@ -1062,7 +1062,7 @@ int pm_send_set_resources(struct packet_manager *pm, · 15 unmodified lines | |||
| 1062 | struct scheduling_resources *res); | 1062 | struct scheduling_resources *res); |
| 1063 | int pm_send_runlist(struct packet_manager *pm, struct list_head *dqm_queues); | 1063 | int pm_send_runlist(struct packet_manager *pm, struct list_head *dqm_queues); |
| 1064 | int pm_send_query_status(struct packet_manager *pm, uint64_t fence_address, | 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 | int pm_send_unmap_queue(struct packet_manager *pm, enum kfd_queue_type type, | 1067 | int pm_send_unmap_queue(struct packet_manager *pm, enum kfd_queue_type type, |
| 1068 | enum kfd_unmap_queues_filter mode, | 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 | caps->ext_caps->bits.hdr_aux_backlight_control == 1) | 2267 | caps->ext_caps->bits.hdr_aux_backlight_control == 1) |
| 2268 | caps->aux_support = true; | 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 | /* From the specification (CTA-861-G), for calculating the maximum | 2275 | /* From the specification (CTA-861-G), for calculating the maximum |
| 2271 | * luminance we need to use: | 2276 | * luminance we need to use: |
| 2272 | * Luminance = 50*2**(CV/32) | 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 | #endif | 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 | static int get_brightness_range(const struct amdgpu_dm_backlight_caps *caps, | 3193 | static int get_brightness_range(const struct amdgpu_dm_backlight_caps *caps, |
| 3202 | unsigned *min, unsigned *max) | 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 | brightness = convert_brightness_from_user(&caps, bd->props.brightness); | 3252 | brightness = convert_brightness_from_user(&caps, bd->props.brightness); |
| 3261 | // Change brightness based on AUX property | 3253 | // Change brightness based on AUX property |
| 3262 | if (caps.aux_support) | 3254 | if (caps.aux_support) |
| 3263 | return set_backlight_via_aux(link, brightness); | 3255 | rc = dc_link_set_backlight_level_nits(link, true, brightness, |
| 3264 | 3256 | AUX_BL_DEFAULT_TRANSITION_TIME_MS); | |
| 3265 | rc = dc_link_set_backlight_level(dm->backlight_link, brightness, 0); | 3257 | else |
| 3258 | rc = dc_link_set_backlight_level(dm->backlight_link, brightness, 0); | ||
| 3266 | 3259 | ||
| 3267 | return rc ? 0 : 1; | 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 | static int amdgpu_dm_backlight_get_brightness(struct backlight_device *bd) | 3263 | static int amdgpu_dm_backlight_get_brightness(struct backlight_device *bd) |
| 3271 | { | 3264 | { |
| 3272 | struct amdgpu_display_manager *dm = bl_get_data(bd); | 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 | rc = dc_link_get_backlight_level_nits(link, &avg, &peak); |
| 3276 | return bd->props.brightness; | 3277 | if (!rc) |
| 3277 | return convert_brightness_to_user(&dm->backlight_caps, ret); | 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 | static const struct backlight_ops amdgpu_dm_backlight_ops = { | 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 | dc_plane_state->global_alpha_value = plane_info.global_alpha_value; | 4725 | dc_plane_state->global_alpha_value = plane_info.global_alpha_value; |
| 4717 | dc_plane_state->dcc = plane_info.dcc; | 4726 | dc_plane_state->dcc = plane_info.dcc; |
| 4718 | dc_plane_state->layer_index = plane_info.layer_index; // Always returns 0 | 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 | * Always set input transfer function, since plane state is refreshed | 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 | if (pipe_ctx->plane_state == NULL) | 2602 | if (pipe_ctx->plane_state == NULL) |
| 2603 | frame_ramp = 0; | 2603 | frame_ramp = 0; |
| 2604 | } else { | 2604 | } else { |
| 2605 | ASSERT(false); | ||
| 2606 | return false; | 2605 | return false; |
| 2607 | } | 2606 | } |
| 2608 | 2607 | ||
| @@ -887,6 +887,7 @@ struct dc_plane_state { · 886 unmodified lines | |||
| 887 | int layer_index; | 887 | int layer_index; |
| 888 | 888 | ||
| 889 | union surface_update_flags update_flags; | 889 | union surface_update_flags update_flags; |
| 890 | bool flip_int_enabled; | ||
| 890 | /* private to DC core */ | 891 | /* private to DC core */ |
| 891 | struct dc_plane_status status; | 892 | struct dc_plane_status status; |
| 892 | struct dc_context *ctx; | 893 | struct dc_context *ctx; |
| @@ -1257,6 +1257,16 @@ void hubp1_soft_reset(struct hubp *hubp, bool reset) · 1256 unmodified lines | |||
| 1257 | REG_UPDATE(DCHUBP_CNTL, HUBP_DISABLE, reset ? 1 : 0); | 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 | void hubp1_init(struct hubp *hubp) | 1270 | void hubp1_init(struct hubp *hubp) |
| 1261 | { | 1271 | { |
| 1262 | //do nothing | 1272 | //do nothing |
| @@ -1290,6 +1300,7 @@ static const struct hubp_funcs dcn10_hubp_funcs = { · 27 unmodified lines | |||
| 1290 | .dmdata_load = NULL, | 1300 | .dmdata_load = NULL, |
| 1291 | .hubp_soft_reset = hubp1_soft_reset, | 1301 | .hubp_soft_reset = hubp1_soft_reset, |
| 1292 | .hubp_in_blank = hubp1_in_blank, | 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 | SRI(DCSURF_SURFACE_EARLIEST_INUSE_C, HUBPREQ, id),\ | 74 | SRI(DCSURF_SURFACE_EARLIEST_INUSE_C, HUBPREQ, id),\ |
| 75 | SRI(DCSURF_SURFACE_EARLIEST_INUSE_HIGH_C, HUBPREQ, id),\ | 75 | SRI(DCSURF_SURFACE_EARLIEST_INUSE_HIGH_C, HUBPREQ, id),\ |
| 76 | SRI(DCSURF_SURFACE_CONTROL, HUBPREQ, id),\ | 76 | SRI(DCSURF_SURFACE_CONTROL, HUBPREQ, id),\ |
| 77 | SRI(DCSURF_SURFACE_FLIP_INTERRUPT, HUBPREQ, id),\ | ||
| 77 | SRI(HUBPRET_CONTROL, HUBPRET, id),\ | 78 | SRI(HUBPRET_CONTROL, HUBPRET, id),\ |
| 78 | SRI(DCN_EXPANSION_MODE, HUBPREQ, id),\ | 79 | SRI(DCN_EXPANSION_MODE, HUBPREQ, id),\ |
| 79 | SRI(DCHUBP_REQ_SIZE_CONFIG, HUBP, id),\ | 80 | SRI(DCHUBP_REQ_SIZE_CONFIG, HUBP, id),\ |
| @@ -183,6 +184,7 @@ · 103 unmodified lines | |||
| 183 | uint32_t DCSURF_SURFACE_EARLIEST_INUSE_C; \ | 184 | uint32_t DCSURF_SURFACE_EARLIEST_INUSE_C; \ |
| 184 | uint32_t DCSURF_SURFACE_EARLIEST_INUSE_HIGH_C; \ | 185 | uint32_t DCSURF_SURFACE_EARLIEST_INUSE_HIGH_C; \ |
| 185 | uint32_t DCSURF_SURFACE_CONTROL; \ | 186 | uint32_t DCSURF_SURFACE_CONTROL; \ |
| 187 | uint32_t DCSURF_SURFACE_FLIP_INTERRUPT; \ | ||
| 186 | uint32_t HUBPRET_CONTROL; \ | 188 | uint32_t HUBPRET_CONTROL; \ |
| 187 | uint32_t DCN_EXPANSION_MODE; \ | 189 | uint32_t DCN_EXPANSION_MODE; \ |
| 188 | uint32_t DCHUBP_REQ_SIZE_CONFIG; \ | 190 | uint32_t DCHUBP_REQ_SIZE_CONFIG; \ |
| @@ -332,6 +334,7 @@ · 143 unmodified lines | |||
| 332 | HUBP_SF(HUBPREQ0_DCSURF_SURFACE_CONTROL, SECONDARY_META_SURFACE_TMZ_C, mask_sh),\ | 334 | HUBP_SF(HUBPREQ0_DCSURF_SURFACE_CONTROL, SECONDARY_META_SURFACE_TMZ_C, mask_sh),\ |
| 333 | HUBP_SF(HUBPREQ0_DCSURF_SURFACE_CONTROL, SECONDARY_SURFACE_DCC_EN, mask_sh),\ | 335 | HUBP_SF(HUBPREQ0_DCSURF_SURFACE_CONTROL, SECONDARY_SURFACE_DCC_EN, mask_sh),\ |
| 334 | HUBP_SF(HUBPREQ0_DCSURF_SURFACE_CONTROL, SECONDARY_SURFACE_DCC_IND_64B_BLK, mask_sh),\ | 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 | HUBP_SF(HUBPRET0_HUBPRET_CONTROL, DET_BUF_PLANE1_BASE_ADDRESS, mask_sh),\ | 338 | HUBP_SF(HUBPRET0_HUBPRET_CONTROL, DET_BUF_PLANE1_BASE_ADDRESS, mask_sh),\ |
| 336 | HUBP_SF(HUBPRET0_HUBPRET_CONTROL, CROSSBAR_SRC_CB_B, mask_sh),\ | 339 | HUBP_SF(HUBPRET0_HUBPRET_CONTROL, CROSSBAR_SRC_CB_B, mask_sh),\ |
| 337 | HUBP_SF(HUBPRET0_HUBPRET_CONTROL, CROSSBAR_SRC_CR_R, mask_sh),\ | 340 | HUBP_SF(HUBPRET0_HUBPRET_CONTROL, CROSSBAR_SRC_CR_R, mask_sh),\ |
| @@ -531,6 +534,7 @@ · 193 unmodified lines | |||
| 531 | type PRIMARY_SURFACE_DCC_IND_64B_BLK;\ | 534 | type PRIMARY_SURFACE_DCC_IND_64B_BLK;\ |
| 532 | type SECONDARY_SURFACE_DCC_EN;\ | 535 | type SECONDARY_SURFACE_DCC_EN;\ |
| 533 | type SECONDARY_SURFACE_DCC_IND_64B_BLK;\ | 536 | type SECONDARY_SURFACE_DCC_IND_64B_BLK;\ |
| 537 | type SURFACE_FLIP_INT_MASK;\ | ||
| 534 | type DET_BUF_PLANE1_BASE_ADDRESS;\ | 538 | type DET_BUF_PLANE1_BASE_ADDRESS;\ |
| 535 | type CROSSBAR_SRC_CB_B;\ | 539 | type CROSSBAR_SRC_CB_B;\ |
| 536 | type CROSSBAR_SRC_CR_R;\ | 540 | type CROSSBAR_SRC_CR_R;\ |
| @@ -777,4 +781,6 @@ void hubp1_read_state_common(struct hubp *hubp); · 240 unmodified lines | |||
| 777 | bool hubp1_in_blank(struct hubp *hubp); | 781 | bool hubp1_in_blank(struct hubp *hubp); |
| 778 | void hubp1_soft_reset(struct hubp *hubp, bool reset); | 782 | void hubp1_soft_reset(struct hubp *hubp, bool reset); |
| 779 | 783 | ||
| 784 | void hubp1_set_flip_int(struct hubp *hubp); | ||
| 785 | |||
| 780 | #endif | 786 | #endif |
| @@ -2196,6 +2196,13 @@ static void dcn10_enable_plane( · 2195 unmodified lines | |||
| 2196 | if (dc->debug.sanity_checks) { | 2196 | if (dc->debug.sanity_checks) { |
| 2197 | hws->funcs.verify_allow_pstate_change_high(dc); | 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 | void dcn10_program_gamut_remap(struct pipe_ctx *pipe_ctx) | 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 | .validate_dml_output = hubp2_validate_dml_output, | 1597 | .validate_dml_output = hubp2_validate_dml_output, |
| 1598 | .hubp_in_blank = hubp1_in_blank, | 1598 | .hubp_in_blank = hubp1_in_blank, |
| 1599 | .hubp_soft_reset = hubp1_soft_reset, | 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 | pipe_ctx->plane_res.hubp->funcs->hubp_set_vm_system_aperture_settings(pipe_ctx->plane_res.hubp, &apt); | 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 | // if (dc->debug.sanity_checks) { | 1155 | // if (dc->debug.sanity_checks) { |
| 1150 | // dcn10_verify_allow_pstate_change_high(dc); | 1156 | // dcn10_verify_allow_pstate_change_high(dc); |
| 1151 | // } | 1157 | // } |
| @@ -1501,38 +1507,8 @@ static void dcn20_update_dchubp_dpp( · 349 unmodified lines | |||
| 1501 | if (pipe_ctx->update_flags.bits.enable || pipe_ctx->update_flags.bits.opp_changed | 1507 | if (pipe_ctx->update_flags.bits.enable || pipe_ctx->update_flags.bits.opp_changed |
| 1502 | || pipe_ctx->stream->update_flags.bits.gamut_remap | 1508 | || pipe_ctx->stream->update_flags.bits.gamut_remap |
| 1503 | || pipe_ctx->stream->update_flags.bits.out_csc) { | 1509 | || pipe_ctx->stream->update_flags.bits.out_csc) { |
| 1504 | struct mpc *mpc = pipe_ctx->stream_res.opp->ctx->dc->res_pool->mpc; | 1510 | /* dpp/cm gamut remap*/ |
| 1505 | 1511 | dc->hwss.program_gamut_remap(pipe_ctx); | |
| 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); | ||
| 1536 | 1512 | ||
| 1537 | /*call the dcn2 method which uses mpc csc*/ | 1513 | /*call the dcn2 method which uses mpc csc*/ |
| 1538 | dc->hwss.program_output_csc(dc, | 1514 | dc->hwss.program_output_csc(dc, |
| @@ -341,8 +341,7 @@ void enc2_hw_init(struct link_encoder *enc) · 340 unmodified lines | |||
| 341 | } else { | 341 | } else { |
| 342 | AUX_REG_WRITE(AUX_DPHY_RX_CONTROL0, 0x103d1110); | 342 | AUX_REG_WRITE(AUX_DPHY_RX_CONTROL0, 0x103d1110); |
| 343 | 343 | ||
| 344 | AUX_REG_WRITE(AUX_DPHY_TX_CONTROL, 0x21c4d); | 344 | AUX_REG_WRITE(AUX_DPHY_TX_CONTROL, 0x21c7a); |
| 345 | |||
| 346 | } | 345 | } |
| 347 | 346 | ||
| 348 | //AUX_DPHY_TX_REF_CONTROL'AUX_TX_REF_DIV HW default is 0x32; | 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 | .hubp_set_flip_control_surface_gsl = hubp2_set_flip_control_surface_gsl, | 838 | .hubp_set_flip_control_surface_gsl = hubp2_set_flip_control_surface_gsl, |
| 839 | .hubp_init = hubp21_init, | 839 | .hubp_init = hubp21_init, |
| 840 | .validate_dml_output = hubp21_validate_dml_output, | 840 | .validate_dml_output = hubp21_validate_dml_output, |
| 841 | .hubp_set_flip_int = hubp1_set_flip_int, | ||
| 841 | }; | 842 | }; |
| 842 | 843 | ||
| 843 | bool hubp21_construct( | 844 | bool hubp21_construct( |
| @@ -296,7 +296,7 @@ struct _vcs_dpi_soc_bounding_box_st dcn2_1_soc = { · 295 unmodified lines | |||
| 296 | .num_banks = 8, | 296 | .num_banks = 8, |
| 297 | .num_chans = 4, | 297 | .num_chans = 4, |
| 298 | .vmm_page_size_bytes = 4096, | 298 | .vmm_page_size_bytes = 4096, |
| 299 | .dram_clock_change_latency_us = 11.72, | 299 | .dram_clock_change_latency_us = 23.84, |
| 300 | .return_bus_width_bytes = 64, | 300 | .return_bus_width_bytes = 64, |
| 301 | .dispclk_dppclk_vco_speed_mhz = 3600, | 301 | .dispclk_dppclk_vco_speed_mhz = 3600, |
| 302 | .xfc_bus_transport_time_us = 4, | 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 | int i; | 1063 | int i; |
| 1064 | 1064 | ||
| 1065 | DC_FP_START(); | ||
| 1066 | |||
| 1067 | if (dc->bb_overrides.sr_exit_time_ns) { | 1065 | if (dc->bb_overrides.sr_exit_time_ns) { |
| 1068 | for (i = 0; i < WM_SET_COUNT; i++) { | 1066 | for (i = 0; i < WM_SET_COUNT; i++) { |
| 1069 | dc->clk_mgr->bw_params->wm_table.entries[i].sr_exit_time_us = | 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 | dc->bb_overrides.dram_clock_change_latency_ns / 1000.0; | 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 | void dcn21_calculate_wm( | 1091 | void dcn21_calculate_wm( |
| @@ -1339,7 +1335,7 @@ static noinline bool dcn21_validate_bandwidth_fp(struct dc *dc, · 243 unmodified lines | |||
| 1339 | int vlevel = 0; | 1335 | int vlevel = 0; |
| 1340 | int pipe_split_from[MAX_PIPES]; | 1336 | int pipe_split_from[MAX_PIPES]; |
| 1341 | int pipe_cnt = 0; | 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 | DC_LOGGER_INIT(dc->ctx->logger); | 1339 | DC_LOGGER_INIT(dc->ctx->logger); |
| 1344 | 1340 | ||
| 1345 | BW_VAL_TRACE_COUNT(); | 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 | dcn2_1_soc.num_chans = bw_params->num_channels; | 1595 | dcn2_1_soc.num_chans = bw_params->num_channels; |
| 1600 | 1596 | ||
| 1601 | ASSERT(clk_table->num_entries); | 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 | for (i = 0; i < clk_table->num_entries; i++) { | 1603 | for (i = 0; i < clk_table->num_entries; i++) { |
| 1603 | /* loop backwards*/ | 1604 | /* loop backwards*/ |
| 1604 | for (closest_clk_lvl = 0, j = dcn2_1_soc.num_states - 1; j >= 0; j--) { | 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 | struct pwl_result_data *rgb_resulted; | 113 | struct pwl_result_data *rgb_resulted; |
| 114 | struct pwl_result_data *rgb; | 114 | struct pwl_result_data *rgb; |
| 115 | struct pwl_result_data *rgb_plus_1; | 115 | struct pwl_result_data *rgb_plus_1; |
| 116 | struct pwl_result_data *rgb_minus_1; | ||
| 116 | struct fixed31_32 end_value; | 117 | struct fixed31_32 end_value; |
| 117 | 118 | ||
| 118 | int32_t region_start, region_end; | 119 | int32_t region_start, region_end; |
| @@ -140,7 +141,7 @@ bool cm3_helper_translate_curve_to_hw_format( · 21 unmodified lines | |||
| 140 | region_start = -MAX_LOW_POINT; | 141 | region_start = -MAX_LOW_POINT; |
| 141 | region_end = NUMBER_REGIONS - MAX_LOW_POINT; | 142 | region_end = NUMBER_REGIONS - MAX_LOW_POINT; |
| 142 | } else { | 143 | } else { |
| 143 | /* 10 segments | 144 | /* 11 segments |
| 144 | * segment is from 2^-10 to 2^0 | 145 | * segment is from 2^-10 to 2^0 |
| 145 | * There are less than 256 points, for optimization | 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 | seg_distr[7] = 4; | 155 | seg_distr[7] = 4; |
| 155 | seg_distr[8] = 4; | 156 | seg_distr[8] = 4; |
| 156 | seg_distr[9] = 4; | 157 | seg_distr[9] = 4; |
| 158 | seg_distr[10] = 1; | ||
| 157 | 159 | ||
| 158 | region_start = -10; | 160 | region_start = -10; |
| 159 | region_end = 0; | 161 | region_end = 1; |
| 160 | } | 162 | } |
| 161 | 163 | ||
| 162 | for (i = region_end - region_start; i < MAX_REGIONS_NUMBER ; i++) | 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 | rgb_resulted[hw_points - 1].green = output_tf->tf_pts.green[start_index]; | 191 | rgb_resulted[hw_points - 1].green = output_tf->tf_pts.green[start_index]; |
| 190 | rgb_resulted[hw_points - 1].blue = output_tf->tf_pts.blue[start_index]; | 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 | // All 3 color channels have same x | 198 | // All 3 color channels have same x |
| 193 | corner_points[0].red.x = dc_fixpt_pow(dc_fixpt_from_int(2), | 199 | corner_points[0].red.x = dc_fixpt_pow(dc_fixpt_from_int(2), |
| 194 | dc_fixpt_from_int(region_start)); | 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 | rgb = rgb_resulted; | 266 | rgb = rgb_resulted; |
| 261 | rgb_plus_1 = rgb_resulted + 1; | 267 | rgb_plus_1 = rgb_resulted + 1; |
| 268 | rgb_minus_1 = rgb; | ||
| 262 | 269 | ||
| 263 | i = 1; | 270 | i = 1; |
| 264 | while (i != hw_points + 1) { | 271 | while (i != hw_points + 1) { |
| 265 | if (dc_fixpt_lt(rgb_plus_1->red, rgb->red)) | 272 | if (i >= hw_points - 1) { |
| 266 | rgb_plus_1->red = rgb->red; | 273 | if (dc_fixpt_lt(rgb_plus_1->red, rgb->red)) |
| 267 | if (dc_fixpt_lt(rgb_plus_1->green, rgb->green)) | 274 | rgb_plus_1->red = dc_fixpt_add(rgb->red, rgb_minus_1->delta_red); |
| 268 | rgb_plus_1->green = rgb->green; | 275 | if (dc_fixpt_lt(rgb_plus_1->green, rgb->green)) |
| 269 | if (dc_fixpt_lt(rgb_plus_1->blue, rgb->blue)) | 276 | rgb_plus_1->green = dc_fixpt_add(rgb->green, rgb_minus_1->delta_green); |
| 270 | rgb_plus_1->blue = rgb->blue; | 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 | rgb->delta_red = dc_fixpt_sub(rgb_plus_1->red, rgb->red); | 281 | rgb->delta_red = dc_fixpt_sub(rgb_plus_1->red, rgb->red); |
| 273 | rgb->delta_green = dc_fixpt_sub(rgb_plus_1->green, rgb->green); | 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 | ++rgb_plus_1; | 294 | ++rgb_plus_1; |
| 295 | rgb_minus_1 = rgb; | ||
| 286 | ++rgb; | 296 | ++rgb; |
| 287 | ++i; | 297 | ++i; |
| 288 | } | 298 | } |
| @@ -511,6 +511,7 @@ static struct hubp_funcs dcn30_hubp_funcs = { · 510 unmodified lines | |||
| 511 | .hubp_init = hubp3_init, | 511 | .hubp_init = hubp3_init, |
| 512 | .hubp_in_blank = hubp1_in_blank, | 512 | .hubp_in_blank = hubp1_in_blank, |
| 513 | .hubp_soft_reset = hubp1_soft_reset, | 513 | .hubp_soft_reset = hubp1_soft_reset, |
| 514 | .hubp_set_flip_int = hubp1_set_flip_int, | ||
| 514 | }; | 515 | }; |
| 515 | 516 | ||
| 516 | bool hubp3_construct( | 517 | bool hubp3_construct( |
| @@ -134,6 +134,7 @@ · 133 unmodified lines | |||
| 134 | HUBP_SF(HUBPREQ0_DCSURF_SURFACE_CONTROL, SECONDARY_SURFACE_DCC_EN, mask_sh),\ | 134 | HUBP_SF(HUBPREQ0_DCSURF_SURFACE_CONTROL, SECONDARY_SURFACE_DCC_EN, mask_sh),\ |
| 135 | HUBP_SF(HUBPREQ0_DCSURF_SURFACE_CONTROL, SECONDARY_SURFACE_DCC_IND_BLK, mask_sh),\ | 135 | HUBP_SF(HUBPREQ0_DCSURF_SURFACE_CONTROL, SECONDARY_SURFACE_DCC_IND_BLK, mask_sh),\ |
| 136 | HUBP_SF(HUBPREQ0_DCSURF_SURFACE_CONTROL, SECONDARY_SURFACE_DCC_IND_BLK_C, mask_sh),\ | 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 | HUBP_SF(HUBPRET0_HUBPRET_CONTROL, DET_BUF_PLANE1_BASE_ADDRESS, mask_sh),\ | 138 | HUBP_SF(HUBPRET0_HUBPRET_CONTROL, DET_BUF_PLANE1_BASE_ADDRESS, mask_sh),\ |
| 138 | HUBP_SF(HUBPRET0_HUBPRET_CONTROL, CROSSBAR_SRC_CB_B, mask_sh),\ | 139 | HUBP_SF(HUBPRET0_HUBPRET_CONTROL, CROSSBAR_SRC_CB_B, mask_sh),\ |
| 139 | HUBP_SF(HUBPRET0_HUBPRET_CONTROL, CROSSBAR_SRC_CR_R, mask_sh),\ | 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 | .patch_unknown_plane_state = dcn20_patch_unknown_plane_state, | 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 | static bool dcn30_resource_construct( | 2524 | static bool dcn30_resource_construct( |
| 2512 | uint8_t num_virtual_links, | 2525 | uint8_t num_virtual_links, |
| 2513 | struct dc *dc, | 2526 | struct dc *dc, |
| @@ -2517,6 +2530,15 @@ static bool dcn30_resource_construct( · 3 unmodified lines | |||
| 2517 | struct dc_context *ctx = dc->ctx; | 2530 | struct dc_context *ctx = dc->ctx; |
| 2518 | struct irq_service_init_data init_data; | 2531 | struct irq_service_init_data init_data; |
| 2519 | struct ddc_service_init_data ddc_init_data; | 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 | DC_FP_START(); | 2543 | DC_FP_START(); |
| 2522 | 2544 | ||
| @@ -2650,6 +2672,15 @@ static bool dcn30_resource_construct( · 127 unmodified lines | |||
| 2650 | /* PP Lib and SMU interfaces */ | 2672 | /* PP Lib and SMU interfaces */ |
| 2651 | init_soc_bounding_box(dc, pool); | 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 | dml_init_instance(&dc->dml, &dcn3_0_soc, &dcn3_0_ip, DML_PROJECT_DCN30); | 2684 | dml_init_instance(&dc->dml, &dcn3_0_soc, &dcn3_0_ip, DML_PROJECT_DCN30); |
| 2654 | 2685 | ||
| 2655 | /* IRQ */ | 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 | dml_init_instance(&dc->dml, &dcn3_01_soc, &dcn3_01_ip, DML_PROJECT_DCN30); | 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 | static struct resource_funcs dcn301_res_pool_funcs = { | 1716 | static struct resource_funcs dcn301_res_pool_funcs = { |
| 1623 | .destroy = dcn301_destroy_resource_pool, | 1717 | .destroy = dcn301_destroy_resource_pool, |
| 1624 | .link_enc_create = dcn301_link_encoder_create, | 1718 | .link_enc_create = dcn301_link_encoder_create, |
| 1625 | .panel_cntl_create = dcn301_panel_cntl_create, | 1719 | .panel_cntl_create = dcn301_panel_cntl_create, |
| 1626 | .validate_bandwidth = dcn30_validate_bandwidth, | 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 | .populate_dml_pipes = dcn30_populate_dml_pipes_from_context, | 1722 | .populate_dml_pipes = dcn30_populate_dml_pipes_from_context, |
| 1629 | .acquire_idle_pipe_for_layer = dcn20_acquire_idle_pipe_for_layer, | 1723 | .acquire_idle_pipe_for_layer = dcn20_acquire_idle_pipe_for_layer, |
| 1630 | .add_stream_to_ctx = dcn30_add_stream_to_ctx, | 1724 | .add_stream_to_ctx = dcn30_add_stream_to_ctx, |
| @@ -191,6 +191,8 @@ struct hubp_funcs { · 190 unmodified lines | |||
| 191 | bool (*hubp_in_blank)(struct hubp *hubp); | 191 | bool (*hubp_in_blank)(struct hubp *hubp); |
| 192 | void (*hubp_soft_reset)(struct hubp *hubp, bool reset); | 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 | #endif | 198 | #endif |
| @@ -587,6 +587,48 @@ static int smu7_force_switch_to_arbf0(struct pp_hwmgr *hwmgr) · 586 unmodified lines | |||
| 587 | tmp, MC_CG_ARB_FREQ_F0); | 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 | static int smu7_setup_default_pcie_table(struct pp_hwmgr *hwmgr) | 632 | static int smu7_setup_default_pcie_table(struct pp_hwmgr *hwmgr) |
| 591 | { | 633 | { |
| 592 | struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); | 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 | PP_Min_PCIEGen), | 725 | PP_Min_PCIEGen), |
| 684 | get_pcie_lane_support(data->pcie_lane_cap, | 726 | get_pcie_lane_support(data->pcie_lane_cap, |
| 685 | PP_Max_PCIELane)); | 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 | return 0; | 734 | return 0; |
| 688 | } | 735 | } |
| @@ -1177,7 +1224,8 @@ static int smu7_enable_sclk_mclk_dpm(struct pp_hwmgr *hwmgr) · 488 unmodified lines | |||
| 1177 | (hwmgr->chip_id == CHIP_POLARIS10) || | 1224 | (hwmgr->chip_id == CHIP_POLARIS10) || |
| 1178 | (hwmgr->chip_id == CHIP_POLARIS11) || | 1225 | (hwmgr->chip_id == CHIP_POLARIS11) || |
| 1179 | (hwmgr->chip_id == CHIP_POLARIS12) || | 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 | PHM_WRITE_FIELD(hwmgr->device, MC_SEQ_CNTL_3, CAC_EN, 0x1); | 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 | NULL)), | 1296 | NULL)), |
| 1249 | "Failed to enable pcie DPM during DPM Start Function!", | 1297 | "Failed to enable pcie DPM during DPM Start Function!", |
| 1250 | return -EINVAL); | 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 | if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, | 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 | disable_mclk_switching_for_display = ((1 < hwmgr->display_config->num_display) && | 3332 | disable_mclk_switching_for_display = ((1 < hwmgr->display_config->num_display) && |
| 3278 | !hwmgr->display_config->multi_monitor_in_sync) || | 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 | disable_mclk_switching = disable_mclk_switching_for_frame_lock || | 3337 | disable_mclk_switching = disable_mclk_switching_for_frame_lock || |
| 3282 | disable_mclk_switching_for_display; | 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 | for (j = 0; j < dep_sclk_table->count; j++) { | 5272 | for (j = 0; j < dep_sclk_table->count; j++) { |
| 5217 | valid_entry = false; | 5273 | valid_entry = false; |
| 5218 | for (k = 0; k < watermarks->num_wm_sets; k++) { | 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 && | 5275 | if (dep_sclk_table->entries[i].clk >= watermarks->wm_clk_ranges[k].wm_min_eng_clk_in_khz / 10 && |
| 5220 | dep_sclk_table->entries[i].clk / 10 < watermarks->wm_clk_ranges[k].wm_max_eng_clk_in_khz && | 5276 | dep_sclk_table->entries[i].clk < watermarks->wm_clk_ranges[k].wm_max_eng_clk_in_khz / 10 && |
| 5221 | dep_mclk_table->entries[i].clk / 10 >= watermarks->wm_clk_ranges[k].wm_min_mem_clk_in_khz && | 5277 | dep_mclk_table->entries[i].clk >= watermarks->wm_clk_ranges[k].wm_min_mem_clk_in_khz / 10 && |
| 5222 | dep_mclk_table->entries[i].clk / 10 < watermarks->wm_clk_ranges[k].wm_max_mem_clk_in_khz) { | 5278 | dep_mclk_table->entries[i].clk < watermarks->wm_clk_ranges[k].wm_max_mem_clk_in_khz / 10) { |
| 5223 | valid_entry = true; | 5279 | valid_entry = true; |
| 5224 | table->DisplayWatermark[i][j] = watermarks->wm_clk_ranges[k].wm_set_id; | 5280 | table->DisplayWatermark[i][j] = watermarks->wm_clk_ranges[k].wm_set_id; |
| 5225 | break; | 5281 | break; |
| @@ -54,6 +54,9 @@ · 53 unmodified lines | |||
| 54 | #include "smuio/smuio_9_0_offset.h" | 54 | #include "smuio/smuio_9_0_offset.h" |
| 55 | #include "smuio/smuio_9_0_sh_mask.h" | 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 | #define HBM_MEMORY_CHANNEL_WIDTH 128 | 60 | #define HBM_MEMORY_CHANNEL_WIDTH 128 |
| 58 | 61 | ||
| 59 | static const uint32_t channel_number[] = {1, 2, 0, 4, 0, 8, 0, 16, 2}; | 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 | if (PP_CAP(PHM_PlatformCaps_VCEDPM)) | 446 | if (PP_CAP(PHM_PlatformCaps_VCEDPM)) |
| 444 | data->smu_features[GNLD_DPM_VCE].supported = true; | 447 | data->smu_features[GNLD_DPM_VCE].supported = true; |
| 445 | 448 | ||
| 446 | if (!data->registry_data.pcie_dpm_key_disabled) | 449 | data->smu_features[GNLD_DPM_LINK].supported = true; |
| 447 | data->smu_features[GNLD_DPM_LINK].supported = true; | ||
| 448 | 450 | ||
| 449 | if (!data->registry_data.dcefclk_dpm_key_disabled) | 451 | if (!data->registry_data.dcefclk_dpm_key_disabled) |
| 450 | data->smu_features[GNLD_DPM_DCEFCLK].supported = true; | 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 | return 0; | 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 | static int vega10_populate_smc_link_levels(struct pp_hwmgr *hwmgr) | 1559 | static int vega10_populate_smc_link_levels(struct pp_hwmgr *hwmgr) |
| 1509 | { | 1560 | { |
| 1510 | int result = -1; | 1561 | int result = -1; |
| @@ -2556,6 +2607,11 @@ static int vega10_init_smc_table(struct pp_hwmgr *hwmgr) · 1045 unmodified lines | |||
| 2556 | "Failed to initialize Link Level!", | 2607 | "Failed to initialize Link Level!", |
| 2557 | return result); | 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 | result = vega10_populate_all_graphic_levels(hwmgr); | 2615 | result = vega10_populate_all_graphic_levels(hwmgr); |
| 2560 | PP_ASSERT_WITH_CODE(!result, | 2616 | PP_ASSERT_WITH_CODE(!result, |
| 2561 | "Failed to initialize Graphics Level!", | 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 | return 0; | 2986 | return 0; |
| 2923 | } | 2987 | } |
| 2924 | 2988 | ||
| 2989 | |||
| 2925 | static int vega10_enable_disable_PCC_limit_feature(struct pp_hwmgr *hwmgr, bool enable) | 2990 | static int vega10_enable_disable_PCC_limit_feature(struct pp_hwmgr *hwmgr, bool enable) |
| 2926 | { | 2991 | { |
| 2927 | struct vega10_hwmgr *data = hwmgr->backend; | 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 | return 0; | 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 | static int vega10_print_clock_levels(struct pp_hwmgr *hwmgr, | 4622 | static int vega10_print_clock_levels(struct pp_hwmgr *hwmgr, |
| 4540 | enum pp_clock_type type, char *buf) | 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 | struct vega10_single_dpm_table *mclk_table = &(data->dpm_table.mem_table); | 4627 | struct vega10_single_dpm_table *mclk_table = &(data->dpm_table.mem_table); |
| 4545 | struct vega10_single_dpm_table *soc_table = &(data->dpm_table.soc_table); | 4628 | struct vega10_single_dpm_table *soc_table = &(data->dpm_table.soc_table); |
| 4546 | struct vega10_single_dpm_table *dcef_table = &(data->dpm_table.dcef_table); | 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 | struct vega10_odn_clock_voltage_dependency_table *podn_vdd_dep = NULL; | 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 | int i, now, size = 0, count = 0; | 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 | break; | 4687 | break; |
| 4604 | case PP_PCIE: | 4688 | case PP_PCIE: |
| 4605 | smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetCurrentLinkIndex, &now); | 4689 | current_gen_speed = |
| 4606 | 4690 | vega10_get_current_pcie_link_speed_level(hwmgr); | |
| 4607 | for (i = 0; i < pcie_table->count; i++) | 4691 | current_lane_width = |
| 4608 | size += sprintf(buf + size, "%d: %s %s\n", i, | 4692 | vega10_get_current_pcie_link_width_level(hwmgr); |
| 4609 | (pcie_table->pcie_gen[i] == 0) ? "2.5GT/s, x1" : | 4693 | for (i = 0; i < NUM_LINK_LEVELS; i++) { |
| 4610 | (pcie_table->pcie_gen[i] == 1) ? "5.0GT/s, x16" : | 4694 | gen_speed = pptable->PcieGenSpeed[i]; |
| 4611 | (pcie_table->pcie_gen[i] == 2) ? "8.0GT/s, x16" : "", | 4695 | lane_width = pptable->PcieLaneCount[i]; |
| 4612 | (i == now) ? "*" : ""); | 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 | break; | 4712 | break; |
| 4713 | |||
| 4614 | case OD_SCLK: | 4714 | case OD_SCLK: |
| 4615 | if (hwmgr->od_enabled) { | 4715 | if (hwmgr->od_enabled) { |
| 4616 | size = sprintf(buf, "%s:\n", "OD_SCLK"); | 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 | data->registry_data.auto_wattman_debug = 0; | 133 | data->registry_data.auto_wattman_debug = 0; |
| 134 | data->registry_data.auto_wattman_sample_period = 100; | 134 | data->registry_data.auto_wattman_sample_period = 100; |
| 135 | data->registry_data.auto_wattman_threshold = 50; | 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 | static int vega12_set_features_platform_caps(struct pp_hwmgr *hwmgr) | 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 | dpm_state->hard_max_level = 0xffff; | 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 | static int vega12_get_number_of_dpm_level(struct pp_hwmgr *hwmgr, | 569 | static int vega12_get_number_of_dpm_level(struct pp_hwmgr *hwmgr, |
| 485 | PPCLK_e clk_id, uint32_t *num_of_levels) | 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 | "Failed to enable all smu features!", | 1053 | "Failed to enable all smu features!", |
| 969 | return result); | 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 | tmp_result = vega12_power_control_set_level(hwmgr); | 1061 | tmp_result = vega12_power_control_set_level(hwmgr); |
| 972 | PP_ASSERT_WITH_CODE(!tmp_result, | 1062 | PP_ASSERT_WITH_CODE(!tmp_result, |
| 973 | "Failed to power control set level!", | 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 | data->registry_data.gfxoff_controlled_by_driver = 1; | 171 | data->registry_data.gfxoff_controlled_by_driver = 1; |
| 172 | data->gfxoff_allowed = false; | 172 | data->gfxoff_allowed = false; |
| 173 | data->counter_gfxoff = 0; | 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 | static int vega20_set_features_platform_caps(struct pp_hwmgr *hwmgr) | 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 | struct amdgpu_device *adev = (struct amdgpu_device *)(hwmgr->adev); | 832 | struct amdgpu_device *adev = (struct amdgpu_device *)(hwmgr->adev); |
| 832 | struct vega20_hwmgr *data = | 833 | struct vega20_hwmgr *data = |
| 833 | (struct vega20_hwmgr *)(hwmgr->backend); | 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 | int ret; | 838 | int ret; |
| 836 | 839 | ||
| 837 | if (adev->pm.pcie_gen_mask & CAIL_PCIE_LINK_SPEED_SUPPORT_GEN4) | 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 | * Bit 15:8: PCIE GEN, 0 to 3 corresponds to GEN1 to GEN4 | 863 | * Bit 15:8: PCIE GEN, 0 to 3 corresponds to GEN1 to GEN4 |
| 861 | * Bit 7:0: PCIE lane width, 1 to 7 corresponds is x1 to x32 | 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; | 866 | for (i = 0; i < NUM_LINK_LEVELS; i++) { |
| 864 | ret = smum_send_msg_to_smc_with_parameter(hwmgr, | 867 | pcie_gen_arg = (pp_table->PcieGenSpeed[i] > pcie_gen) ? pcie_gen : |
| 865 | PPSMC_MSG_OverridePcieParameters, smu_pcie_arg, | 868 | pp_table->PcieGenSpeed[i]; |
| 866 | NULL); | 869 | pcie_width_arg = (pp_table->PcieLaneCount[i] > pcie_width) ? pcie_width : |
| 867 | PP_ASSERT_WITH_CODE(!ret, | 870 | pp_table->PcieLaneCount[i]; |
| 868 | "[OverridePcieParameters] Attempt to override pcie params failed!", | 871 | |
| 869 | return ret); | 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; | 899 | pp_table->PcieGenSpeed[i] = pcie_gen; |
| 872 | data->pcie_gen_level1 = pcie_gen; | 900 | pp_table->PcieLaneCount[i] = pcie_width; |
| 873 | data->pcie_width_level1 = 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 | return 0; | 912 | return 0; |
| 876 | } | 913 | } |
| @@ -3319,9 +3356,7 @@ static int vega20_print_clock_levels(struct pp_hwmgr *hwmgr, · 2442 unmodified lines | |||
| 3319 | data->od8_settings.od8_settings_array; | 3356 | data->od8_settings.od8_settings_array; |
| 3320 | OverDriveTable_t *od_table = | 3357 | OverDriveTable_t *od_table = |
| 3321 | &(data->smc_state_table.overdrive_table); | 3358 | &(data->smc_state_table.overdrive_table); |
| 3322 | struct phm_ppt_v3_information *pptable_information = | 3359 | PPTable_t *pptable = &(data->smc_state_table.pp_table); |
| 3323 | (struct phm_ppt_v3_information *)hwmgr->pptable; | ||
| 3324 | PPTable_t *pptable = (PPTable_t *)pptable_information->smc_pptable; | ||
| 3325 | struct pp_clock_levels_with_latency clocks; | 3360 | struct pp_clock_levels_with_latency clocks; |
| 3326 | struct vega20_single_dpm_table *fclk_dpm_table = | 3361 | struct vega20_single_dpm_table *fclk_dpm_table = |
| 3327 | &(data->dpm_table.fclk_table); | 3362 | &(data->dpm_table.fclk_table); |
| @@ -3420,13 +3455,9 @@ static int vega20_print_clock_levels(struct pp_hwmgr *hwmgr, · 92 unmodified lines | |||
| 3420 | current_lane_width = | 3455 | current_lane_width = |
| 3421 | vega20_get_current_pcie_link_width_level(hwmgr); | 3456 | vega20_get_current_pcie_link_width_level(hwmgr); |
| 3422 | for (i = 0; i < NUM_LINK_LEVELS; i++) { | 3457 | for (i = 0; i < NUM_LINK_LEVELS; i++) { |
| 3423 | if (i == 1 && data->pcie_parameters_override) { | 3458 | gen_speed = pptable->PcieGenSpeed[i]; |
| 3424 | gen_speed = data->pcie_gen_level1; | 3459 | lane_width = pptable->PcieLaneCount[i]; |
| 3425 | lane_width = data->pcie_width_level1; | 3460 | |
| 3426 | } else { | ||
| 3427 | gen_speed = pptable->PcieGenSpeed[i]; | ||
| 3428 | lane_width = pptable->PcieLaneCount[i]; | ||
| 3429 | } | ||
| 3430 | size += sprintf(buf + size, "%d: %s %s %dMhz %s\n", i, | 3461 | size += sprintf(buf + size, "%d: %s %s %dMhz %s\n", i, |
| 3431 | (gen_speed == 0) ? "2.5GT/s," : | 3462 | (gen_speed == 0) ? "2.5GT/s," : |
| 3432 | (gen_speed == 1) ? "5.0GT/s," : | 3463 | (gen_speed == 1) ? "5.0GT/s," : |
| @@ -1294,7 +1294,7 @@ static int smu_disable_dpms(struct smu_context *smu) · 1293 unmodified lines | |||
| 1294 | bool use_baco = !smu->is_apu && | 1294 | bool use_baco = !smu->is_apu && |
| 1295 | ((amdgpu_in_reset(adev) && | 1295 | ((amdgpu_in_reset(adev) && |
| 1296 | (amdgpu_asic_reset_method(adev) == AMD_RESET_METHOD_BACO)) || | 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 | * For custom pptable uploading, skip the DPM features | 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 | smu->watermarks_bitmap &= ~(WATERMARKS_LOADED); | 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 | smu_set_gfx_cgpg(&adev->smu, false); | 1436 | smu_set_gfx_cgpg(&adev->smu, false); |
| 1436 | 1437 | ||
| 1437 | return 0; | 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 | static bool vangogh_is_dpm_running(struct smu_context *smu) | 385 | static bool vangogh_is_dpm_running(struct smu_context *smu) |
| 386 | { | 386 | { |
| 387 | struct amdgpu_device *adev = smu->adev; | ||
| 387 | int ret = 0; | 388 | int ret = 0; |
| 388 | uint32_t feature_mask[2]; | 389 | uint32_t feature_mask[2]; |
| 389 | uint64_t feature_enabled; | 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 | ret = smu_cmn_get_enabled_32_bits_mask(smu, feature_mask, 2); | 396 | ret = smu_cmn_get_enabled_32_bits_mask(smu, feature_mask, 2); |
| 392 | 397 | ||
| 393 | if (ret) | 398 | if (ret) |
| @@ -2048,7 +2048,7 @@ static void drm_fbdev_cleanup(struct drm_fb_helper *fb_helper) · 2047 unmodified lines | |||
| 2048 | 2048 | ||
| 2049 | if (shadow) | 2049 | if (shadow) |
| 2050 | vfree(shadow); | 2050 | vfree(shadow); |
| 2051 | else | 2051 | else if (fb_helper->buffer) |
| 2052 | drm_client_buffer_vunmap(fb_helper->buffer); | 2052 | drm_client_buffer_vunmap(fb_helper->buffer); |
| 2053 | 2053 | ||
| 2054 | drm_client_framebuffer_delete(fb_helper->buffer); | 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 | if (--shmem->vmap_use_count > 0) | 357 | if (--shmem->vmap_use_count > 0) |
| 358 | return; | 358 | return; |
| 359 | 359 | ||
| 360 | if (obj->import_attach) | 360 | if (obj->import_attach) { |
| 361 | dma_buf_vunmap(obj->import_attach->dmabuf, map); | 361 | dma_buf_vunmap(obj->import_attach->dmabuf, map); |
| 362 | else | 362 | } else { |
| 363 | vunmap(shmem->vaddr); | 363 | vunmap(shmem->vaddr); |
| 364 | drm_gem_shmem_put_pages(shmem); | ||
| 365 | } | ||
| 364 | 366 | ||
| 365 | shmem->vaddr = NULL; | 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 | struct drm_gem_object *obj = vma->vm_private_data; | 526 | struct drm_gem_object *obj = vma->vm_private_data; |
| 526 | struct drm_gem_shmem_object *shmem = to_drm_gem_shmem_obj(obj); | 527 | struct drm_gem_shmem_object *shmem = to_drm_gem_shmem_obj(obj); |
| 527 | loff_t num_pages = obj->size >> PAGE_SHIFT; | 528 | loff_t num_pages = obj->size >> PAGE_SHIFT; |
| 529 | vm_fault_t ret; | ||
| 528 | struct page *page; | 530 | struct page *page; |
| 531 | pgoff_t page_offset; | ||
| 529 | 532 | ||
| 530 | if (vmf->pgoff >= num_pages || WARN_ON_ONCE(!shmem->pages)) | 533 | /* We don't use vmf->pgoff since that has the fake offset */ |
| 531 | return VM_FAULT_SIGBUS; | 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 | static void drm_gem_shmem_vm_open(struct vm_area_struct *vma) | 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 | struct drm_gem_shmem_object *shmem; | 596 | struct drm_gem_shmem_object *shmem; |
| 582 | int ret; | 597 | int ret; |
| 583 | 598 | ||
| 584 | /* Remove the fake offset */ | ||
| 585 | vma->vm_pgoff -= drm_vma_node_start(&obj->vma_node); | ||
| 586 | |||
| 587 | if (obj->import_attach) { | 599 | if (obj->import_attach) { |
| 588 | /* Drop the reference drm_gem_mmap_obj() acquired.*/ | 600 | /* Drop the reference drm_gem_mmap_obj() acquired.*/ |
| 589 | drm_gem_object_put(obj); | 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 | if (copy_from_user(&v32, (void __user *)arg, sizeof(v32))) | 99 | if (copy_from_user(&v32, (void __user *)arg, sizeof(v32))) |
| 100 | return -EFAULT; | 100 | return -EFAULT; |
| 101 | 101 | ||
| 102 | memset(&v, 0, sizeof(v)); | ||
| 103 | |||
| 102 | v = (struct drm_version) { | 104 | v = (struct drm_version) { |
| 103 | .name_len = v32.name_len, | 105 | .name_len = v32.name_len, |
| 104 | .name = compat_ptr(v32.name), | 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 | if (copy_from_user(&uq32, (void __user *)arg, sizeof(uq32))) | 140 | if (copy_from_user(&uq32, (void __user *)arg, sizeof(uq32))) |
| 139 | return -EFAULT; | 141 | return -EFAULT; |
| 142 | |||
| 143 | memset(&uq, 0, sizeof(uq)); | ||
| 144 | |||
| 140 | uq = (struct drm_unique){ | 145 | uq = (struct drm_unique){ |
| 141 | .unique_len = uq32.unique_len, | 146 | .unique_len = uq32.unique_len, |
| 142 | .unique = compat_ptr(uq32.unique), | 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 | if (copy_from_user(&c32, argp, sizeof(c32))) | 270 | if (copy_from_user(&c32, argp, sizeof(c32))) |
| 266 | return -EFAULT; | 271 | return -EFAULT; |
| 267 | 272 | ||
| 273 | memset(&client, 0, sizeof(client)); | ||
| 274 | |||
| 268 | client.idx = c32.idx; | 275 | client.idx = c32.idx; |
| 269 | 276 | ||
| 270 | err = drm_ioctl_kernel(file, drm_getclient, &client, 0); | 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 | if (copy_from_user(&req32, argp, sizeof(req32))) | 859 | if (copy_from_user(&req32, argp, sizeof(req32))) |
| 853 | return -EFAULT; | 860 | return -EFAULT; |
| 854 | 861 | ||
| 862 | memset(&req, 0, sizeof(req)); | ||
| 863 | |||
| 855 | req.request.type = req32.request.type; | 864 | req.request.type = req32.request.type; |
| 856 | req.request.sequence = req32.request.sequence; | 865 | req.request.sequence = req32.request.sequence; |
| 857 | req.request.signal = req32.request.signal; | 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 | struct drm_mode_fb_cmd2 req64; | 898 | struct drm_mode_fb_cmd2 req64; |
| 890 | int err; | 899 | int err; |
| 891 | 900 | ||
| 901 | memset(&req64, 0, sizeof(req64)); | ||
| 902 | |||
| 892 | if (copy_from_user(&req64, argp, | 903 | if (copy_from_user(&req64, argp, |
| 893 | offsetof(drm_mode_fb_cmd232_t, modifier))) | 904 | offsetof(drm_mode_fb_cmd232_t, modifier))) |
| 894 | return -EFAULT; | 905 | return -EFAULT; |
| @@ -689,7 +689,8 @@ static int etnaviv_gem_userptr_get_pages(struct etnaviv_gem_object *etnaviv_obj) · 688 unmodified lines | |||
| 689 | struct page **pages = pvec + pinned; | 689 | struct page **pages = pvec + pinned; |
| 690 | 690 | ||
| 691 | ret = pin_user_pages_fast(ptr, num_pages, | 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 | if (ret < 0) { | 694 | if (ret < 0) { |
| 694 | unpin_user_pages(pvec, pinned); | 695 | unpin_user_pages(pvec, pinned); |
| 695 | kvfree(pvec); | 696 | kvfree(pvec); |
| @@ -13,7 +13,6 @@ · 12 unmodified lines | |||
| 13 | #include <linux/irq.h> | 13 | #include <linux/irq.h> |
| 14 | #include <linux/mfd/syscon.h> | 14 | #include <linux/mfd/syscon.h> |
| 15 | #include <linux/of_device.h> | 15 | #include <linux/of_device.h> |
| 16 | #include <linux/of_gpio.h> | ||
| 17 | #include <linux/platform_device.h> | 16 | #include <linux/platform_device.h> |
| 18 | #include <linux/pm_runtime.h> | 17 | #include <linux/pm_runtime.h> |
| 19 | #include <linux/regmap.h> | 18 | #include <linux/regmap.h> |
| @@ -84,13 +84,31 @@ static void intel_dsm_platform_mux_info(acpi_handle dhandle) · 83 unmodified lines | |||
| 84 | return; | 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 | connector_count = &pkg->package.elements[0]; | 92 | connector_count = &pkg->package.elements[0]; |
| 88 | DRM_DEBUG_DRIVER("MUX info connectors: %lld\n", | 93 | DRM_DEBUG_DRIVER("MUX info connectors: %lld\n", |
| 89 | (unsigned long long)connector_count->integer.value); | 94 | (unsigned long long)connector_count->integer.value); |
| 90 | for (i = 1; i < pkg->package.count; i++) { | 95 | for (i = 1; i < pkg->package.count; i++) { |
| 91 | union acpi_object *obj = &pkg->package.elements[i]; | 96 | union acpi_object *obj = &pkg->package.elements[i]; |
| 92 | union acpi_object *connector_id = &obj->package.elements[0]; | 97 | union acpi_object *connector_id; |
| 93 | union acpi_object *info = &obj->package.elements[1]; | 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 | DRM_DEBUG_DRIVER("Connector id: 0x%016llx\n", | 112 | DRM_DEBUG_DRIVER("Connector id: 0x%016llx\n", |
| 95 | (unsigned long long)connector_id->integer.value); | 113 | (unsigned long long)connector_id->integer.value); |
| 96 | DRM_DEBUG_DRIVER(" port id: %s\n", | 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 | if (!new_plane_state->hw.crtc && !old_plane_state->hw.crtc) | 317 | if (!new_plane_state->hw.crtc && !old_plane_state->hw.crtc) |
| 318 | return 0; | 318 | return 0; |
| 319 | 319 | ||
| 320 | new_crtc_state->enabled_planes |= BIT(plane->id); | ||
| 321 | |||
| 322 | ret = plane->check_plane(new_crtc_state, new_plane_state); | 320 | ret = plane->check_plane(new_crtc_state, new_plane_state); |
| 323 | if (ret) | 321 | if (ret) |
| 324 | return ret; | 322 | return ret; |
| 325 | 323 | ||
| 324 | if (fb) | ||
| 325 | new_crtc_state->enabled_planes |= BIT(plane->id); | ||
| 326 | |||
| 326 | /* FIXME pre-g4x don't work like this */ | 327 | /* FIXME pre-g4x don't work like this */ |
| 327 | if (new_plane_state->uapi.visible) | 328 | if (new_plane_state->uapi.visible) |
| 328 | new_crtc_state->active_planes |= BIT(plane->id); | 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 | int ret; | 3620 | int ret; |
| 3621 | 3621 | ||
| 3622 | intel_dp_lttpr_init(intel_dp); | 3622 | if (intel_dp_init_lttpr_and_dprx_caps(intel_dp) < 0) |
| 3623 | |||
| 3624 | if (drm_dp_read_dpcd_caps(&intel_dp->aux, intel_dp->dpcd)) | ||
| 3625 | return false; | 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 | else | 133 | else |
| 134 | precharge = 5; | 134 | precharge = 5; |
| 135 | 135 | ||
| 136 | /* Max timeout value on G4x-BDW: 1.6ms */ | ||
| 136 | if (IS_BROADWELL(dev_priv)) | 137 | if (IS_BROADWELL(dev_priv)) |
| 137 | timeout = DP_AUX_CH_CTL_TIME_OUT_600us; | 138 | timeout = DP_AUX_CH_CTL_TIME_OUT_600us; |
| 138 | else | 139 | else |
| @@ -159,6 +160,12 @@ static u32 skl_get_aux_send_ctl(struct intel_dp *intel_dp, · 20 unmodified lines | |||
| 159 | enum phy phy = intel_port_to_phy(i915, dig_port->base.port); | 160 | enum phy phy = intel_port_to_phy(i915, dig_port->base.port); |
| 160 | u32 ret; | 161 | u32 ret; |
| 161 | 162 | ||
| 163 | /* | ||
| 164 | * Max timeout values: | ||
| 165 | * SKL-GLK: 1.6ms | ||
| 166 | * CNL: 3.2ms | ||
| 167 | * ICL+: 4ms | ||
| 168 | */ | ||
| 162 | ret = DP_AUX_CH_CTL_SEND_BUSY | | 169 | ret = DP_AUX_CH_CTL_SEND_BUSY | |
| 163 | DP_AUX_CH_CTL_DONE | | 170 | DP_AUX_CH_CTL_DONE | |
| 164 | DP_AUX_CH_CTL_INTERRUPT | | 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 | break; | 646 | break; |
| 647 | case INTEL_BACKLIGHT_DISPLAY_DDI: | 647 | case INTEL_BACKLIGHT_DISPLAY_DDI: |
| 648 | try_intel_interface = true; | 648 | try_intel_interface = true; |
| 649 | try_vesa_interface = true; | ||
| 650 | break; | 649 | break; |
| 651 | default: | 650 | default: |
| 652 | return -ENODEV; | 651 | return -ENODEV; |
| @@ -34,6 +34,11 @@ intel_dp_dump_link_status(const u8 link_status[DP_LINK_STATUS_SIZE]) · 33 unmodified lines | |||
| 34 | link_status[3], link_status[4], link_status[5]); | 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 | static void intel_dp_reset_lttpr_count(struct intel_dp *intel_dp) | 42 | static void intel_dp_reset_lttpr_count(struct intel_dp *intel_dp) |
| 38 | { | 43 | { |
| 39 | intel_dp->lttpr_common_caps[DP_PHY_REPEATER_CNT - | 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 | static bool intel_dp_read_lttpr_common_caps(struct intel_dp *intel_dp) | 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, | 89 | struct drm_i915_private *i915 = dp_to_i915(intel_dp); |
| 85 | intel_dp->lttpr_common_caps) < 0) { | 90 | |
| 86 | memset(intel_dp->lttpr_common_caps, 0, | 91 | if (intel_dp_is_edp(intel_dp)) |
| 87 | sizeof(intel_dp->lttpr_common_caps)); | ||
| 88 | return false; | 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 | drm_dbg_kms(&dp_to_i915(intel_dp)->drm, | 105 | drm_dbg_kms(&dp_to_i915(intel_dp)->drm, |
| 92 | "LTTPR common capabilities: %*ph\n", | 106 | "LTTPR common capabilities: %*ph\n", |
| 93 | (int)sizeof(intel_dp->lttpr_common_caps), | 107 | (int)sizeof(intel_dp->lttpr_common_caps), |
| 94 | intel_dp->lttpr_common_caps); | 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 | return true; | 114 | return true; |
| 115 | |||
| 116 | reset_caps: | ||
| 117 | intel_dp_reset_lttpr_common_caps(intel_dp); | ||
| 118 | return false; | ||
| 97 | } | 119 | } |
| 98 | 120 | ||
| 99 | static bool | 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 | * @intel_dp: Intel DP struct | 132 | * @intel_dp: Intel DP struct |
| 111 | * | 133 | * |
| 112 | * Read the LTTPR common capabilities, switch to non-transparent link training | 134 | * Read the LTTPR common and DPRX capabilities and switch to non-transparent |
| 113 | * mode if any is detected and read the PHY capabilities for all detected | 135 | * link training mode if any is detected and read the PHY capabilities for all |
| 114 | * LTTPRs. In case of an LTTPR detection error or if the number of | 136 | * detected LTTPRs. In case of an LTTPR detection error or if the number of |
| 115 | * LTTPRs is more than is supported (8), fall back to the no-LTTPR, | 137 | * LTTPRs is more than is supported (8), fall back to the no-LTTPR, |
| 116 | * transparent mode link training mode. | 138 | * transparent mode link training mode. |
| 117 | * | 139 | * |
| 118 | * Returns: | 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 | * 0 if no LTTPRs or more than 8 LTTPRs were detected or in case of a | 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 | int lttpr_count; | 150 | int lttpr_count; |
| 126 | bool ret; | 151 | bool ret; |
| 127 | int i; | 152 | int i; |
| 128 | 153 | ||
| 129 | if (intel_dp_is_edp(intel_dp)) | ||
| 130 | return 0; | ||
| 131 | |||
| 132 | ret = intel_dp_read_lttpr_common_caps(intel_dp); | 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 | if (!ret) | 162 | if (!ret) |
| 134 | return 0; | 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 | lttpr_count = drm_dp_lttpr_count(intel_dp->lttpr_common_caps); | 174 | lttpr_count = drm_dp_lttpr_count(intel_dp->lttpr_common_caps); |
| 137 | /* | 175 | /* |
| 138 | * Prevent setting LTTPR transparent mode explicitly if no LTTPRs are | 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 | return lttpr_count; | 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 | static u8 dp_voltage_max(u8 preemph) | 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 | * TODO: Reiniting LTTPRs here won't be needed once proper connector | 845 | * TODO: Reiniting LTTPRs here won't be needed once proper connector |
| 808 | * HW state readout is added. | 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 | if (!intel_dp_link_train_all_phys(intel_dp, crtc_state, lttpr_count)) | 853 | if (!intel_dp_link_train_all_phys(intel_dp, crtc_state, lttpr_count)) |
| 813 | intel_dp_schedule_fallback_link_training(intel_dp, crtc_state); | 854 | intel_dp_schedule_fallback_link_training(intel_dp, crtc_state); |
| @@ -11,7 +11,7 @@ · 10 unmodified lines | |||
| 11 | struct intel_crtc_state; | 11 | struct intel_crtc_state; |
| 12 | struct intel_dp; | 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 | void intel_dp_get_adjust_train(struct intel_dp *intel_dp, | 16 | void intel_dp_get_adjust_train(struct intel_dp *intel_dp, |
| 17 | const struct intel_crtc_state *crtc_state, | 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 | enum pipe pipe = to_intel_crtc(crtc_state->uapi.crtc)->pipe; | 1015 | enum pipe pipe = to_intel_crtc(crtc_state->uapi.crtc)->pipe; |
| 1016 | 1016 | ||
| 1017 | if (crtc_state->cpu_transcoder == TRANSCODER_EDP) | 1017 | return is_pipe_dsc(crtc_state) ? ICL_PIPE_DSS_CTL1(pipe) : DSS_CTL1; |
| 1018 | return DSS_CTL1; | ||
| 1019 | |||
| 1020 | return ICL_PIPE_DSS_CTL1(pipe); | ||
| 1021 | } | 1018 | } |
| 1022 | 1019 | ||
| 1023 | static i915_reg_t dss_ctl2_reg(const struct intel_crtc_state *crtc_state) | 1020 | static i915_reg_t dss_ctl2_reg(const struct intel_crtc_state *crtc_state) |
| 1024 | { | 1021 | { |
| 1025 | enum pipe pipe = to_intel_crtc(crtc_state->uapi.crtc)->pipe; | 1022 | enum pipe pipe = to_intel_crtc(crtc_state->uapi.crtc)->pipe; |
| 1026 | 1023 | ||
| 1027 | if (crtc_state->cpu_transcoder == TRANSCODER_EDP) | 1024 | return is_pipe_dsc(crtc_state) ? ICL_PIPE_DSS_CTL2(pipe) : DSS_CTL2; |
| 1028 | return DSS_CTL2; | ||
| 1029 | |||
| 1030 | return ICL_PIPE_DSS_CTL2(pipe); | ||
| 1031 | } | 1025 | } |
| 1032 | 1026 | ||
| 1033 | void intel_dsc_enable(struct intel_encoder *encoder, | 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 | * FIXME As we do with eDP, just make a note of the time here | 992 | * FIXME As we do with eDP, just make a note of the time here |
| 993 | * and perform the wait before the next panel power on. | 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 | static void intel_dsi_shutdown(struct intel_encoder *encoder) | 998 | static void intel_dsi_shutdown(struct intel_encoder *encoder) |
| 999 | { | 999 | { |
| 1000 | struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); | 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 | static bool intel_dsi_get_hw_state(struct intel_encoder *encoder, | 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 | goto err_status; | 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 | intel_engine_init_active(engine, ENGINE_PHYSICAL); | 720 | intel_engine_init_active(engine, ENGINE_PHYSICAL); |
| 717 | intel_engine_init_execlists(engine); | 721 | intel_engine_init_execlists(engine); |
| 718 | intel_engine_init_cmd_parser(engine); | ||
| 719 | intel_engine_init__pm(engine); | 722 | intel_engine_init__pm(engine); |
| 720 | intel_engine_init_retire(engine); | 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 | return 0; | 736 | return 0; |
| 734 | 737 | ||
| 738 | err_cmd_parser: | ||
| 739 | intel_breadcrumbs_free(engine->breadcrumbs); | ||
| 735 | err_status: | 740 | err_status: |
| 736 | cleanup_status_page(engine); | 741 | cleanup_status_page(engine); |
| 737 | return err; | 742 | return err; |
| @@ -316,7 +316,18 @@ void i915_vma_revoke_fence(struct i915_vma *vma) · 315 unmodified lines | |||
| 316 | WRITE_ONCE(fence->vma, NULL); | 316 | WRITE_ONCE(fence->vma, NULL); |
| 317 | vma->fence = NULL; | 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 | fence_write(fence); | 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 | * struct intel_engine_cs based on whether the platform requires software | 940 | * struct intel_engine_cs based on whether the platform requires software |
| 941 | * command parsing. | 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 | const struct drm_i915_cmd_table *cmd_tables; | 945 | const struct drm_i915_cmd_table *cmd_tables; |
| 946 | int cmd_table_count; | 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 | if (!IS_GEN(engine->i915, 7) && !(IS_GEN(engine->i915, 9) && | 949 | if (!IS_GEN(engine->i915, 7) && !(IS_GEN(engine->i915, 9) && |
| 950 | engine->class == COPY_ENGINE_CLASS)) | 950 | engine->class == COPY_ENGINE_CLASS)) |
| 951 | return; | 951 | return 0; |
| 952 | 952 | ||
| 953 | switch (engine->class) { | 953 | switch (engine->class) { |
| 954 | case RENDER_CLASS: | 954 | case RENDER_CLASS: |
| @@ -1013,19 +1013,19 @@ void intel_engine_init_cmd_parser(struct intel_engine_cs *engine) · 58 unmodified lines | |||
| 1013 | break; | 1013 | break; |
| 1014 | default: | 1014 | default: |
| 1015 | MISSING_CASE(engine->class); | 1015 | MISSING_CASE(engine->class); |
| 1016 | return; | 1016 | goto out; |
| 1017 | } | 1017 | } |
| 1018 | 1018 | ||
| 1019 | if (!validate_cmds_sorted(engine, cmd_tables, cmd_table_count)) { | 1019 | if (!validate_cmds_sorted(engine, cmd_tables, cmd_table_count)) { |
| 1020 | drm_err(&engine->i915->drm, | 1020 | drm_err(&engine->i915->drm, |
| 1021 | "%s: command descriptions are not sorted\n", | 1021 | "%s: command descriptions are not sorted\n", |
| 1022 | engine->name); | 1022 | engine->name); |
| 1023 | return; | 1023 | goto out; |
| 1024 | } | 1024 | } |
| 1025 | if (!validate_regs_sorted(engine)) { | 1025 | if (!validate_regs_sorted(engine)) { |
| 1026 | drm_err(&engine->i915->drm, | 1026 | drm_err(&engine->i915->drm, |
| 1027 | "%s: registers are not sorted\n", engine->name); | 1027 | "%s: registers are not sorted\n", engine->name); |
| 1028 | return; | 1028 | goto out; |
| 1029 | } | 1029 | } |
| 1030 | 1030 | ||
| 1031 | ret = init_hash_table(engine, cmd_tables, cmd_table_count); | 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 | drm_err(&engine->i915->drm, | 1033 | drm_err(&engine->i915->drm, |
| 1034 | "%s: initialised failed!\n", engine->name); | 1034 | "%s: initialised failed!\n", engine->name); |
| 1035 | fini_hash_table(engine); | 1035 | fini_hash_table(engine); |
| 1036 | return; | 1036 | goto out; |
| 1037 | } | 1037 | } |
| 1038 | 1038 | ||
| 1039 | engine->flags |= I915_ENGINE_USING_CMD_PARSER; | 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 | /* i915_cmd_parser.c */ | 1953 | /* i915_cmd_parser.c */ |
| 1954 | int i915_cmd_parser_get_version(struct drm_i915_private *dev_priv); | 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 | void intel_engine_cleanup_cmd_parser(struct intel_engine_cs *engine); | 1956 | void intel_engine_cleanup_cmd_parser(struct intel_engine_cs *engine); |
| 1957 | int intel_engine_cmd_parser(struct intel_engine_cs *engine, | 1957 | int intel_engine_cmd_parser(struct intel_engine_cs *engine, |
| 1958 | struct i915_vma *batch, | 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 | int report_size = stream->oa_buffer.format_size; | 604 | int report_size = stream->oa_buffer.format_size; |
| 605 | struct drm_i915_perf_record_header header; | 605 | struct drm_i915_perf_record_header header; |
| 606 | u32 sample_flags = stream->sample_flags; | ||
| 607 | 606 | ||
| 608 | header.type = DRM_I915_PERF_RECORD_SAMPLE; | 607 | header.type = DRM_I915_PERF_RECORD_SAMPLE; |
| 609 | header.pad = 0; | 608 | header.pad = 0; |
| @@ -617,10 +616,8 @@ static int append_oa_sample(struct i915_perf_stream *stream, · 7 unmodified lines | |||
| 617 | return -EFAULT; | 616 | return -EFAULT; |
| 618 | buf += sizeof(header); | 617 | buf += sizeof(header); |
| 619 | 618 | ||
| 620 | if (sample_flags & SAMPLE_OA_REPORT) { | 619 | if (copy_to_user(buf, report, report_size)) |
| 621 | if (copy_to_user(buf, report, report_size)) | 620 | return -EFAULT; |
| 622 | return -EFAULT; | ||
| 623 | } | ||
| 624 | 621 | ||
| 625 | (*offset) += header.size; | 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 | stream->perf->ops.oa_enable(stream); | 2680 | stream->perf->ops.oa_enable(stream); |
| 2684 | 2681 | ||
| 2685 | if (stream->periodic) | 2682 | if (stream->sample_flags & SAMPLE_OA_REPORT) |
| 2686 | hrtimer_start(&stream->poll_check_timer, | 2683 | hrtimer_start(&stream->poll_check_timer, |
| 2687 | ns_to_ktime(stream->poll_oa_period), | 2684 | ns_to_ktime(stream->poll_oa_period), |
| 2688 | HRTIMER_MODE_REL_PINNED); | 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 | stream->perf->ops.oa_disable(stream); | 2743 | stream->perf->ops.oa_disable(stream); |
| 2747 | 2744 | ||
| 2748 | if (stream->periodic) | 2745 | if (stream->sample_flags & SAMPLE_OA_REPORT) |
| 2749 | hrtimer_cancel(&stream->poll_check_timer); | 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 | * disabled stream as an error. In particular it might otherwise lead | 3025 | * disabled stream as an error. In particular it might otherwise lead |
| 3029 | * to a deadlock for blocking file descriptors... | 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 | return -EIO; | 3029 | return -EIO; |
| 3033 | 3030 | ||
| 3034 | if (!(file->f_flags & O_NONBLOCK)) { | 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 | #define ILK_DISPLAY_CHICKEN1 _MMIO(0x42000) | 3317 | #define ILK_DISPLAY_CHICKEN1 _MMIO(0x42000) |
| 3318 | #define ILK_FBCQ_DIS (1 << 22) | 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 | #define _CHICKEN_PIPESL_1_A 0x420b0 | 8051 | #define _CHICKEN_PIPESL_1_A 0x420b0 |
| 8041 | #define _CHICKEN_PIPESL_1_B 0x420b4 | 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 | #define HSW_FBCQ_DIS (1 << 22) | 8063 | #define HSW_FBCQ_DIS (1 << 22) |
| 8043 | #define BDW_DPRS_MASK_VBLANK_SRD (1 << 0) | 8064 | #define BDW_DPRS_MASK_VBLANK_SRD (1 << 0) |
| 8044 | #define CHICKEN_PIPESL_1(pipe) _MMIO_PIPE(pipe, _CHICKEN_PIPESL_1_A, _CHICKEN_PIPESL_1_B) | 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 | struct skl_plane_wm *wm = &crtc_state->wm.skl.raw.planes[plane_id]; | 5471 | struct skl_plane_wm *wm = &crtc_state->wm.skl.raw.planes[plane_id]; |
| 5472 | int ret; | 5472 | int ret; |
| 5473 | 5473 | ||
| 5474 | memset(wm, 0, sizeof(*wm)); | ||
| 5475 | |||
| 5476 | /* Watermarks calculated in master */ | 5474 | /* Watermarks calculated in master */ |
| 5477 | if (plane_state->planar_slave) | 5475 | if (plane_state->planar_slave) |
| 5478 | return 0; | 5476 | return 0; |
| 5479 | 5477 | ||
| 5478 | memset(wm, 0, sizeof(*wm)); | ||
| 5479 | |||
| 5480 | if (plane_state->planar_linked_plane) { | 5480 | if (plane_state->planar_linked_plane) { |
| 5481 | const struct drm_framebuffer *fb = plane_state->hw.fb; | 5481 | const struct drm_framebuffer *fb = plane_state->hw.fb; |
| 5482 | enum plane_id y_plane_id = plane_state->planar_linked_plane->id; | 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 | intel_uncore_write(&dev_priv->uncore, CHICKEN_PAR1_1, | 7245 | intel_uncore_write(&dev_priv->uncore, CHICKEN_PAR1_1, |
| 7246 | intel_uncore_read(&dev_priv->uncore, CHICKEN_PAR1_1) | DPA_MASK_VBLANK_SRD); | 7246 | intel_uncore_read(&dev_priv->uncore, CHICKEN_PAR1_1) | DPA_MASK_VBLANK_SRD); |
| 7247 | 7247 | ||
| 7248 | /* WaPsrDPRSUnmaskVBlankInSRD:bdw */ | ||
| 7249 | for_each_pipe(dev_priv, pipe) { | 7248 | for_each_pipe(dev_priv, pipe) { |
| 7249 | /* WaPsrDPRSUnmaskVBlankInSRD:bdw */ | ||
| 7250 | intel_uncore_write(&dev_priv->uncore, CHICKEN_PIPESL_1(pipe), | 7250 | intel_uncore_write(&dev_priv->uncore, CHICKEN_PIPESL_1(pipe), |
| 7251 | intel_uncore_read(&dev_priv->uncore, CHICKEN_PIPESL_1(pipe)) | | 7251 | intel_uncore_read(&dev_priv->uncore, CHICKEN_PIPESL_1(pipe)) | |
| 7252 | BDW_DPRS_MASK_VBLANK_SRD); | 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 | /* WaVSRefCountFullforceMissDisable:bdw */ | 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 | static void hsw_init_clock_gating(struct drm_i915_private *dev_priv) | 7291 | static void hsw_init_clock_gating(struct drm_i915_private *dev_priv) |
| 7287 | { | 7292 | { |
| 7293 | enum pipe pipe; | ||
| 7294 | |||
| 7288 | /* WaFbcAsynchFlipDisableFbcQueue:hsw,bdw */ | 7295 | /* WaFbcAsynchFlipDisableFbcQueue:hsw,bdw */ |
| 7289 | intel_uncore_write(&dev_priv->uncore, CHICKEN_PIPESL_1(PIPE_A), | 7296 | intel_uncore_write(&dev_priv->uncore, CHICKEN_PIPESL_1(PIPE_A), |
| 7290 | intel_uncore_read(&dev_priv->uncore, CHICKEN_PIPESL_1(PIPE_A)) | | 7297 | intel_uncore_read(&dev_priv->uncore, CHICKEN_PIPESL_1(PIPE_A)) | |
| 7291 | HSW_FBCQ_DIS); | 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 | /* This is required by WaCatErrorRejectionIssue:hsw */ | 7307 | /* This is required by WaCatErrorRejectionIssue:hsw */ |
| 7294 | intel_uncore_write(&dev_priv->uncore, GEN7_SQ_CHICKEN_MBCUNIT_CONFIG, | 7308 | intel_uncore_write(&dev_priv->uncore, GEN7_SQ_CHICKEN_MBCUNIT_CONFIG, |
| 7295 | intel_uncore_read(&dev_priv->uncore, GEN7_SQ_CHICKEN_MBCUNIT_CONFIG) | | 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 | * @rpm: the intel_runtime_pm structure | 416 | * @rpm: the intel_runtime_pm structure |
| 417 | * @ignore_usecount: get a ref even if dev->power.usage_count is 0 | ||
| 417 | * | 418 | * |
| 418 | * This function grabs a device-level runtime pm reference if the device is | 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 | * already active 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. | 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 | * Any runtime pm reference obtained by this function must have a symmetric | 430 | * Any runtime pm reference obtained by this function must have a symmetric |
| 423 | * call to intel_runtime_pm_put() to release the reference again. | 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 | * Returns: the wakeref cookie to pass to intel_runtime_pm_put(), evaluates | 433 | * Returns: the wakeref cookie to pass to intel_runtime_pm_put(), evaluates |
| 426 | * as True if the wakeref was acquired, or False otherwise. | 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 | if (IS_ENABLED(CONFIG_PM)) { | 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 | * function, since the power state is undefined. This applies | 443 | * function, since the power state is undefined. This applies |
| 435 | * atm to the late/early system suspend/resume handlers. | 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 | return 0; | 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 | return track_intel_runtime_pm_wakeref(rpm); | 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 | * intel_runtime_pm_get_noresume - grab a runtime pm reference | 466 | * intel_runtime_pm_get_noresume - grab a runtime pm reference |
| 448 | * @rpm: the intel_runtime_pm structure | 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 | intel_wakeref_t intel_runtime_pm_get(struct intel_runtime_pm *rpm); | 178 | intel_wakeref_t intel_runtime_pm_get(struct intel_runtime_pm *rpm); |
| 179 | intel_wakeref_t intel_runtime_pm_get_if_in_use(struct intel_runtime_pm *rpm); | 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 | intel_wakeref_t intel_runtime_pm_get_noresume(struct intel_runtime_pm *rpm); | 181 | intel_wakeref_t intel_runtime_pm_get_noresume(struct intel_runtime_pm *rpm); |
| 181 | intel_wakeref_t intel_runtime_pm_get_raw(struct intel_runtime_pm *rpm); | 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 | for ((wf) = intel_runtime_pm_get_if_in_use(rpm); (wf); \ | 189 | for ((wf) = intel_runtime_pm_get_if_in_use(rpm); (wf); \ |
| 189 | intel_runtime_pm_put((rpm), (wf)), (wf) = 0) | 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 | void intel_runtime_pm_put_unchecked(struct intel_runtime_pm *rpm); | 196 | void intel_runtime_pm_put_unchecked(struct intel_runtime_pm *rpm); |
| 192 | #if IS_ENABLED(CONFIG_DRM_I915_DEBUG_RUNTIME_PM) | 197 | #if IS_ENABLED(CONFIG_DRM_I915_DEBUG_RUNTIME_PM) |
| 193 | void intel_runtime_pm_put(struct intel_runtime_pm *rpm, intel_wakeref_t wref); | 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 | ret = drmm_mode_config_init(drm); | 216 | ret = drmm_mode_config_init(drm); |
| 217 | if (ret) | 217 | if (ret) |
| 218 | return ret; | 218 | goto err_kms; |
| 219 | 219 | ||
| 220 | ret = drm_vblank_init(drm, MAX_CRTC); | 220 | ret = drm_vblank_init(drm, MAX_CRTC); |
| 221 | if (ret) | 221 | if (ret) |
| @@ -197,6 +197,11 @@ static void imx_ldb_encoder_enable(struct drm_encoder *encoder) · 196 unmodified lines | |||
| 197 | int dual = ldb->ldb_ctrl & LDB_SPLIT_MODE_EN; | 197 | int dual = ldb->ldb_ctrl & LDB_SPLIT_MODE_EN; |
| 198 | int mux = drm_of_encoder_active_port_id(imx_ldb_ch->child, encoder); | 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 | drm_panel_prepare(imx_ldb_ch->panel); | 205 | drm_panel_prepare(imx_ldb_ch->panel); |
| 201 | 206 | ||
| 202 | if (dual) { | 207 | if (dual) { |
| @@ -255,6 +260,11 @@ imx_ldb_encoder_atomic_mode_set(struct drm_encoder *encoder, · 52 unmodified lines | |||
| 255 | int mux = drm_of_encoder_active_port_id(imx_ldb_ch->child, encoder); | 260 | int mux = drm_of_encoder_active_port_id(imx_ldb_ch->child, encoder); |
| 256 | u32 bus_format = imx_ldb_ch->bus_format; | 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 | if (mode->clock > 170000) { | 268 | if (mode->clock > 170000) { |
| 259 | dev_warn(ldb->dev, | 269 | dev_warn(ldb->dev, |
| 260 | "%s: mode exceeds 170 MHz pixel clock\n", __func__); | 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 | struct imx_ldb_channel *channel = &imx_ldb->channel[i]; | 593 | struct imx_ldb_channel *channel = &imx_ldb->channel[i]; |
| 584 | 594 | ||
| 585 | if (!channel->ldb) | 595 | if (!channel->ldb) |
| 586 | break; | 596 | continue; |
| 587 | 597 | ||
| 588 | ret = imx_ldb_register(drm, channel); | 598 | ret = imx_ldb_register(drm, channel); |
| 589 | if (ret) | 599 | if (ret) |
| @@ -482,6 +482,16 @@ static int meson_probe_remote(struct platform_device *pdev, · 481 unmodified lines | |||
| 482 | return count; | 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 | static int meson_drv_probe(struct platform_device *pdev) | 495 | static int meson_drv_probe(struct platform_device *pdev) |
| 486 | { | 496 | { |
| 487 | struct component_match *match = NULL; | 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 | static struct platform_driver meson_drm_platform_driver = { | 564 | static struct platform_driver meson_drm_platform_driver = { |
| 555 | .probe = meson_drv_probe, | 565 | .probe = meson_drv_probe, |
| 566 | .shutdown = meson_drv_shutdown, | ||
| 556 | .driver = { | 567 | .driver = { |
| 557 | .name = "meson-drm", | 568 | .name = "meson-drm", |
| 558 | .of_match_table = dt_match, | 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 | static int a5xx_get_timestamp(struct msm_gpu *gpu, uint64_t *value) | 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, | 1389 | *value = gpu_read64(gpu, REG_A5XX_RBBM_ALWAYSON_COUNTER_LO, |
| 1390 | REG_A5XX_RBBM_PERFCTR_CP_0_HI); | 1390 | REG_A5XX_RBBM_ALWAYSON_COUNTER_HI); |
| 1391 | 1391 | ||
| 1392 | return 0; | 1392 | return 0; |
| 1393 | } | 1393 | } |
| @@ -304,7 +304,7 @@ int a5xx_power_init(struct msm_gpu *gpu) · 303 unmodified lines | |||
| 304 | /* Set up the limits management */ | 304 | /* Set up the limits management */ |
| 305 | if (adreno_is_a530(adreno_gpu)) | 305 | if (adreno_is_a530(adreno_gpu)) |
| 306 | a530_lm_setup(gpu); | 306 | a530_lm_setup(gpu); |
| 307 | else | 307 | else if (adreno_is_a540(adreno_gpu)) |
| 308 | a540_lm_setup(gpu); | 308 | a540_lm_setup(gpu); |
| 309 | 309 | ||
| 310 | /* Set up SP/TP power collpase */ | 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 | else | 339 | else |
| 340 | bit = a6xx_gmu_oob_bits[state].ack_new; | 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 | /* Enable CPU control of SPTP power power collapse */ | 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 | return a6xx_idle(gpu, ring) ? 0 : -EINVAL; | 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 | struct drm_gem_object *obj) | 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 | u32 *buf = msm_gem_get_vaddr(obj); | 534 | u32 *buf = msm_gem_get_vaddr(obj); |
| 535 | bool ret = false; | ||
| 529 | 536 | ||
| 530 | if (IS_ERR(buf)) | 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 | 541 | * Targets up to a640 (a618, a630 and a640) need to check for a |
| 535 | * has been patched. The actual version is in dword [3] but we only care | 542 | * microcode version that is patched to support the whereami opcode or |
| 536 | * about the patchlevel which is the lowest nibble of dword [3] | 543 | * one that is new enough to include it by default. |
| 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 | ||
| 540 | */ | 544 | */ |
| 541 | if (((buf[0] & 0xf) == 0xa) && (buf[2] & 0xf) >= 1) | 545 | if (adreno_is_a618(adreno_gpu) || adreno_is_a630(adreno_gpu) || |
| 542 | a6xx_gpu->has_whereami = true; | 546 | adreno_is_a640(adreno_gpu)) { |
| 543 | else if ((buf[0] & 0xfff) > 0x190) | 547 | /* |
| 544 | a6xx_gpu->has_whereami = true; | 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 | msm_gem_put_vaddr(obj); | 590 | msm_gem_put_vaddr(obj); |
| 591 | return ret; | ||
| 547 | } | 592 | } |
| 548 | 593 | ||
| 549 | static int a6xx_ucode_init(struct msm_gpu *gpu) | 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 | msm_gem_object_set_name(a6xx_gpu->sqe_bo, "sqefw"); | 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 | gpu_write64(gpu, REG_A6XX_CP_SQE_INSTR_BASE_LO, | 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 | /* Force the GPU power on so we can read this register */ | 1228 | /* Force the GPU power on so we can read this register */ |
| 1178 | a6xx_gmu_set_oob(&a6xx_gpu->gmu, GMU_OOB_PERFCOUNTER_SET); | 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, | 1231 | *value = gpu_read64(gpu, REG_A6XX_CP_ALWAYS_ON_COUNTER_LO, |
| 1181 | REG_A6XX_RBBM_PERFCTR_CP_0_HI); | 1232 | REG_A6XX_CP_ALWAYS_ON_COUNTER_HI); |
| 1182 | 1233 | ||
| 1183 | a6xx_gmu_clear_oob(&a6xx_gpu->gmu, GMU_OOB_PERFCOUNTER_SET); | 1234 | a6xx_gmu_clear_oob(&a6xx_gpu->gmu, GMU_OOB_PERFCOUNTER_SET); |
| 1184 | mutex_unlock(&perfcounter_oob); | 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 | u32 revn) | 1401 | u32 revn) |
| 1351 | { | 1402 | { |
| 1352 | struct opp_table *opp_table; | 1403 | struct opp_table *opp_table; |
| 1353 | struct nvmem_cell *cell; | ||
| 1354 | u32 supp_hw = UINT_MAX; | 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 | * -ENOENT means that the platform doesn't support speedbin which is | 1410 | * -ENOENT means that the platform doesn't support speedbin which is |
| 1360 | * fine | 1411 | * fine |
| 1361 | */ | 1412 | */ |
| 1362 | if (PTR_ERR(cell) == -ENOENT) | 1413 | if (ret == -ENOENT) { |
| 1363 | return 0; | 1414 | return 0; |
| 1364 | else if (IS_ERR(cell)) { | 1415 | } else if (ret) { |
| 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); | ||
| 1373 | DRM_DEV_ERROR(dev, | 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 | goto done; | 1419 | goto done; |
| 1376 | } | 1420 | } |
| 1421 | speedbin = le16_to_cpu(speedbin); | ||
| 1377 | 1422 | ||
| 1378 | supp_hw = fuse_to_supp_hw(dev, revn, *((u32 *) buf)); | 1423 | supp_hw = fuse_to_supp_hw(dev, revn, speedbin); |
| 1379 | |||
| 1380 | kfree(buf); | ||
| 1381 | nvmem_cell_put(cell); | ||
| 1382 | 1424 | ||
| 1383 | done: | 1425 | done: |
| 1384 | opp_table = dev_pm_opp_set_supported_hw(dev, &supp_hw, 1); | 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 | DPU_REG_WRITE(c, CTL_TOP, mode_sel); | 497 | DPU_REG_WRITE(c, CTL_TOP, mode_sel); |
| 498 | DPU_REG_WRITE(c, CTL_INTF_ACTIVE, intf_active); | 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 | static void dpu_hw_ctl_intf_cfg(struct dpu_hw_ctl *ctx, | 504 | static void dpu_hw_ctl_intf_cfg(struct dpu_hw_ctl *ctx, |
| @@ -43,6 +43,8 @@ · 42 unmodified lines | |||
| 43 | #define DPU_DEBUGFS_DIR "msm_dpu" | 43 | #define DPU_DEBUGFS_DIR "msm_dpu" |
| 44 | #define DPU_DEBUGFS_HWMASKNAME "hw_log_mask" | 44 | #define DPU_DEBUGFS_HWMASKNAME "hw_log_mask" |
| 45 | 45 | ||
| 46 | #define MIN_IB_BW 400000000ULL /* Min ib vote 400MB */ | ||
| 47 | |||
| 46 | static int dpu_kms_hw_init(struct msm_kms *kms); | 48 | static int dpu_kms_hw_init(struct msm_kms *kms); |
| 47 | static void _dpu_kms_mmu_destroy(struct dpu_kms *dpu_kms); | 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 | DPU_DEBUG("REG_DMA is not defined"); | 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 | pm_runtime_get_sync(&dpu_kms->pdev->dev); | 939 | pm_runtime_get_sync(&dpu_kms->pdev->dev); |
| 935 | 940 | ||
| 936 | dpu_kms->core_rev = readl_relaxed(dpu_kms->mmio + 0x0); | 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 | dpu_vbif_init_memtypes(dpu_kms); | 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 | pm_runtime_put_sync(&dpu_kms->pdev->dev); | 1040 | pm_runtime_put_sync(&dpu_kms->pdev->dev); |
| 1039 | 1041 | ||
| 1040 | return 0; | 1042 | return 0; |
| @@ -1191,10 +1193,10 @@ static int __maybe_unused dpu_runtime_resume(struct device *dev) · 150 unmodified lines | |||
| 1191 | 1193 | ||
| 1192 | ddev = dpu_kms->dev; | 1194 | ddev = dpu_kms->dev; |
| 1193 | 1195 | ||
| 1196 | WARN_ON(!(dpu_kms->num_paths)); | ||
| 1194 | /* Min vote of BW is required before turning on AXI clk */ | 1197 | /* Min vote of BW is required before turning on AXI clk */ |
| 1195 | for (i = 0; i < dpu_kms->num_paths; i++) | 1198 | for (i = 0; i < dpu_kms->num_paths; i++) |
| 1196 | icc_set_bw(dpu_kms->path[i], 0, | 1199 | icc_set_bw(dpu_kms->path[i], 0, Bps_to_icc(MIN_IB_BW)); |
| 1197 | dpu_kms->catalog->perf.min_dram_ib); | ||
| 1198 | 1200 | ||
| 1199 | rc = msm_dss_enable_clk(mp->clk_config, mp->num_clk, true); | 1201 | rc = msm_dss_enable_clk(mp->clk_config, mp->num_clk, true); |
| 1200 | if (rc) { | 1202 | if (rc) { |
| @@ -32,6 +32,8 @@ struct dp_aux_private { · 31 unmodified lines | |||
| 32 | struct drm_dp_aux dp_aux; | 32 | struct drm_dp_aux dp_aux; |
| 33 | }; | 33 | }; |
| 34 | 34 | ||
| 35 | #define MAX_AUX_RETRIES 5 | ||
| 36 | |||
| 35 | static const char *dp_aux_get_error(u32 aux_error) | 37 | static const char *dp_aux_get_error(u32 aux_error) |
| 36 | { | 38 | { |
| 37 | switch (aux_error) { | 39 | switch (aux_error) { |
| @@ -377,6 +379,11 @@ static ssize_t dp_aux_transfer(struct drm_dp_aux *dp_aux, · 339 unmodified lines | |||
| 377 | ret = dp_aux_cmd_fifo_tx(aux, msg); | 379 | ret = dp_aux_cmd_fifo_tx(aux, msg); |
| 378 | 380 | ||
| 379 | if (ret < 0) { | 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 | usleep_range(400, 500); /* at least 400us to next try */ | 387 | usleep_range(400, 500); /* at least 400us to next try */ |
| 381 | goto unlock_exit; | 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 | break; | 163 | break; |
| 164 | case MSM_DSI_PHY_7NM: | 164 | case MSM_DSI_PHY_7NM: |
| 165 | case MSM_DSI_PHY_7NM_V4_1: | 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 | break; | 167 | break; |
| 168 | default: | 168 | default: |
| 169 | pll = ERR_PTR(-ENXIO); | 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 | #endif | 118 | #endif |
| 119 | #ifdef CONFIG_DRM_MSM_DSI_7NM_PHY | 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 | #else | 122 | #else |
| 122 | static inline struct msm_dsi_pll * | 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 | return ERR_PTR(-ENODEV); | 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 | pll_write(base + REG_DSI_7nm_PHY_PLL_FRAC_DIV_START_LOW_1, reg->frac_div_start_low); | 325 | pll_write(base + REG_DSI_7nm_PHY_PLL_FRAC_DIV_START_LOW_1, reg->frac_div_start_low); |
| 326 | pll_write(base + REG_DSI_7nm_PHY_PLL_FRAC_DIV_START_MID_1, reg->frac_div_start_mid); | 326 | pll_write(base + REG_DSI_7nm_PHY_PLL_FRAC_DIV_START_MID_1, reg->frac_div_start_mid); |
| 327 | pll_write(base + REG_DSI_7nm_PHY_PLL_FRAC_DIV_START_HIGH_1, reg->frac_div_start_high); | 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 | pll_write(base + REG_DSI_7nm_PHY_PLL_PLL_LOCK_DELAY, 0x06); | 329 | pll_write(base + REG_DSI_7nm_PHY_PLL_PLL_LOCK_DELAY, 0x06); |
| 330 | pll_write(base + REG_DSI_7nm_PHY_PLL_CMODE_1, 0x10); /* TODO: 0x00 for CPHY */ | 330 | pll_write(base + REG_DSI_7nm_PHY_PLL_CMODE_1, 0x10); /* TODO: 0x00 for CPHY */ |
| 331 | pll_write(base + REG_DSI_7nm_PHY_PLL_CLOCK_INVERTERS, reg->pll_clock_inverters); | 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 | struct msm_dsi_pll *pll = hw_clk_to_pll(hw); | 510 | struct msm_dsi_pll *pll = hw_clk_to_pll(hw); |
| 511 | struct dsi_pll_7nm *pll_7nm = to_pll_7nm(pll); | 511 | struct dsi_pll_7nm *pll_7nm = to_pll_7nm(pll); |
| 512 | struct dsi_pll_config *config = &pll_7nm->pll_configuration; | ||
| 512 | void __iomem *base = pll_7nm->mmio; | 513 | void __iomem *base = pll_7nm->mmio; |
| 513 | u64 ref_clk = pll_7nm->vco_ref_clk_rate; | 514 | u64 ref_clk = pll_7nm->vco_ref_clk_rate; |
| 514 | u64 vco_rate = 0x0; | 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 | * TODO: | 531 | * TODO: |
| 531 | * 1. Assumes prescaler is disabled | 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 | pll_freq = dec * (ref_clk * 2); | 535 | pll_freq = dec * (ref_clk * 2); |
| 536 | tmp64 = (ref_clk * 2 * frac); | 536 | tmp64 = (ref_clk * 2 * frac); |
| 537 | pll_freq += div_u64(tmp64, multiplier); | 537 | pll_freq += div_u64(tmp64, multiplier); |
| @@ -852,7 +852,8 @@ err_base_clk_hw: · 314 unmodified lines | |||
| 852 | return ret; | 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 | struct dsi_pll_7nm *pll_7nm; | 858 | struct dsi_pll_7nm *pll_7nm; |
| 858 | struct msm_dsi_pll *pll; | 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 | pll = &pll_7nm->base; | 886 | pll = &pll_7nm->base; |
| 886 | pll->min_rate = 1000000000UL; | 887 | pll->min_rate = 1000000000UL; |
| 887 | pll->max_rate = 3500000000UL; | 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 | pll->min_rate = 600000000UL; | 890 | pll->min_rate = 600000000UL; |
| 890 | pll->max_rate = (unsigned long)5000000000ULL; | 891 | pll->max_rate = (unsigned long)5000000000ULL; |
| 891 | /* workaround for max rate overflowing on 32-bit builds: */ | 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 | static void lock_crtcs(struct msm_kms *kms, unsigned int crtc_mask) | 58 | static void lock_crtcs(struct msm_kms *kms, unsigned int crtc_mask) |
| 59 | { | 59 | { |
| 60 | int crtc_index; | ||
| 60 | struct drm_crtc *crtc; | 61 | struct drm_crtc *crtc; |
| 61 | 62 | ||
| 62 | for_each_crtc_mask(kms->dev, crtc, crtc_mask) | 63 | for_each_crtc_mask(kms->dev, crtc, crtc_mask) { |
| 63 | mutex_lock(&kms->commit_lock[drm_crtc_index(crtc)]); | 64 | crtc_index = drm_crtc_index(crtc); |
| 65 | mutex_lock_nested(&kms->commit_lock[crtc_index], crtc_index); | ||
| 66 | } | ||
| 64 | } | 67 | } |
| 65 | 68 | ||
| 66 | static void unlock_crtcs(struct msm_kms *kms, unsigned int crtc_mask) | 69 | static void unlock_crtcs(struct msm_kms *kms, unsigned int crtc_mask) |
| @@ -570,6 +570,7 @@ err_free_priv: · 569 unmodified lines | |||
| 570 | kfree(priv); | 570 | kfree(priv); |
| 571 | err_put_drm_dev: | 571 | err_put_drm_dev: |
| 572 | drm_dev_put(ddev); | 572 | drm_dev_put(ddev); |
| 573 | platform_set_drvdata(pdev, NULL); | ||
| 573 | return ret; | 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 | static int __maybe_unused msm_pm_prepare(struct device *dev) | 1073 | static int __maybe_unused msm_pm_prepare(struct device *dev) |
| 1073 | { | 1074 | { |
| 1074 | struct drm_device *ddev = dev_get_drvdata(dev); | 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 | return drm_mode_config_helper_suspend(ddev); | 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 | static void __maybe_unused msm_pm_complete(struct device *dev) | 1084 | static void __maybe_unused msm_pm_complete(struct device *dev) |
| 1080 | { | 1085 | { |
| 1081 | struct drm_device *ddev = dev_get_drvdata(dev); | 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 | drm_mode_config_helper_resume(ddev); | 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 | static void msm_pdev_shutdown(struct platform_device *pdev) | 1320 | static void msm_pdev_shutdown(struct platform_device *pdev) |
| 1312 | { | 1321 | { |
| 1313 | struct drm_device *drm = platform_get_drvdata(pdev); | 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 | drm_atomic_helper_shutdown(drm); | 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 | int ret; | 45 | int ret; |
| 46 | 46 | ||
| 47 | if (fence > fctx->last_fence) { | 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 | fctx->name, fence, fctx->last_fence); | 49 | fctx->name, fence, fctx->last_fence); |
| 50 | return -EINVAL; | 50 | return -EINVAL; |
| 51 | } | 51 | } |
| @@ -157,7 +157,6 @@ struct msm_kms { · 156 unmodified lines | |||
| 157 | * from the crtc's pending_timer close to end of the frame: | 157 | * from the crtc's pending_timer close to end of the frame: |
| 158 | */ | 158 | */ |
| 159 | struct mutex commit_lock[MAX_CRTCS]; | 159 | struct mutex commit_lock[MAX_CRTCS]; |
| 160 | struct lock_class_key commit_lock_keys[MAX_CRTCS]; | ||
| 161 | unsigned pending_crtc_mask; | 160 | unsigned pending_crtc_mask; |
| 162 | struct msm_pending_timer pending_timers[MAX_CRTCS]; | 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 | unsigned i, ret; | 167 | unsigned i, ret; |
| 169 | 168 | ||
| 170 | for (i = 0; i < ARRAY_SIZE(kms->commit_lock); i++) { | 169 | for (i = 0; i < ARRAY_SIZE(kms->commit_lock); i++) |
| 171 | lockdep_register_key(&kms->commit_lock_keys[i]); | 170 | mutex_init(&kms->commit_lock[i]); |
| 172 | __mutex_init(&kms->commit_lock[i], "&kms->commit_lock[i]", | ||
| 173 | &kms->commit_lock_keys[i]); | ||
| 174 | } | ||
| 175 | 171 | ||
| 176 | kms->funcs = funcs; | 172 | kms->funcs = funcs; |
| 177 | 173 | ||
| @@ -2693,9 +2693,20 @@ nv50_display_create(struct drm_device *dev) · 2692 unmodified lines | |||
| 2693 | else | 2693 | else |
| 2694 | nouveau_display(dev)->format_modifiers = disp50xx_modifiers; | 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 | dev->mode_config.cursor_width = 256; | 2705 | dev->mode_config.cursor_width = 256; |
| 2698 | dev->mode_config.cursor_height = 256; | 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 | } else { | 2710 | } else { |
| 2700 | dev->mode_config.cursor_width = 64; | 2711 | dev->mode_config.cursor_width = 64; |
| 2701 | dev->mode_config.cursor_height = 64; | 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 | if (!ttm_dma) | 552 | if (!ttm_dma) |
| 553 | return; | 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 | /* Don't waste time looping if the object is coherent */ | 559 | /* Don't waste time looping if the object is coherent */ |
| 556 | if (nvbo->force_coherent) | 560 | if (nvbo->force_coherent) |
| 557 | return; | 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 | struct page *p = ttm_dma->pages[i]; | 565 | struct page *p = ttm_dma->pages[i]; |
| 561 | size_t num_pages = 1; | 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 | if (!ttm_dma) | 588 | if (!ttm_dma) |
| 584 | return; | 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 | /* Don't waste time looping if the object is coherent */ | 595 | /* Don't waste time looping if the object is coherent */ |
| 587 | if (nvbo->force_coherent) | 596 | if (nvbo->force_coherent) |
| 588 | return; | 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 | struct page *p = ttm_dma->pages[i]; | 601 | struct page *p = ttm_dma->pages[i]; |
| 592 | size_t num_pages = 1; | 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 | const struct mipi_dsi_msg *msg) | 2149 | const struct mipi_dsi_msg *msg) |
| 2150 | { | 2150 | { |
| 2151 | struct mipi_dsi_packet pkt; | 2151 | struct mipi_dsi_packet pkt; |
| 2152 | int ret; | ||
| 2152 | u32 r; | 2153 | u32 r; |
| 2153 | 2154 | ||
| 2154 | r = mipi_dsi_create_packet(&pkt, msg); | 2155 | ret = mipi_dsi_create_packet(&pkt, msg); |
| 2155 | if (r < 0) | 2156 | if (ret < 0) |
| 2156 | return r; | 2157 | return ret; |
| 2157 | 2158 | ||
| 2158 | WARN_ON(!dsi_bus_is_locked(dsi)); | 2159 | WARN_ON(!dsi_bus_is_locked(dsi)); |
| 2159 | 2160 | ||
| @@ -37,6 +37,7 @@ struct dsic_panel_data { · 36 unmodified lines | |||
| 37 | u32 height_mm; | 37 | u32 height_mm; |
| 38 | u32 max_hs_rate; | 38 | u32 max_hs_rate; |
| 39 | u32 max_lp_rate; | 39 | u32 max_lp_rate; |
| 40 | bool te_support; | ||
| 40 | }; | 41 | }; |
| 41 | 42 | ||
| 42 | struct panel_drv_data { | 43 | struct panel_drv_data { |
| @@ -334,9 +335,11 @@ static int dsicm_power_on(struct panel_drv_data *ddata) · 291 unmodified lines | |||
| 334 | if (r) | 335 | if (r) |
| 335 | goto err; | 336 | goto err; |
| 336 | 337 | ||
| 337 | r = mipi_dsi_dcs_set_tear_on(ddata->dsi, MIPI_DSI_DCS_TEAR_MODE_VBLANK); | 338 | if (ddata->panel_data->te_support) { |
| 338 | if (r) | 339 | r = mipi_dsi_dcs_set_tear_on(ddata->dsi, MIPI_DSI_DCS_TEAR_MODE_VBLANK); |
| 339 | goto err; | 340 | if (r) |
| 341 | goto err; | ||
| 342 | } | ||
| 340 | 343 | ||
| 341 | /* possible panel bug */ | 344 | /* possible panel bug */ |
| 342 | msleep(100); | 345 | msleep(100); |
| @@ -619,6 +622,7 @@ static const struct dsic_panel_data taal_data = { · 276 unmodified lines | |||
| 619 | .height_mm = 0, | 622 | .height_mm = 0, |
| 620 | .max_hs_rate = 300000000, | 623 | .max_hs_rate = 300000000, |
| 621 | .max_lp_rate = 10000000, | 624 | .max_lp_rate = 10000000, |
| 625 | .te_support = true, | ||
| 622 | }; | 626 | }; |
| 623 | 627 | ||
| 624 | static const struct dsic_panel_data himalaya_data = { | 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 | .height_mm = 88, | 633 | .height_mm = 88, |
| 630 | .max_hs_rate = 300000000, | 634 | .max_hs_rate = 300000000, |
| 631 | .max_lp_rate = 10000000, | 635 | .max_lp_rate = 10000000, |
| 636 | .te_support = false, | ||
| 632 | }; | 637 | }; |
| 633 | 638 | ||
| 634 | static const struct dsic_panel_data droid4_data = { | 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 | .height_mm = 89, | 644 | .height_mm = 89, |
| 640 | .max_hs_rate = 300000000, | 645 | .max_hs_rate = 300000000, |
| 641 | .max_lp_rate = 10000000, | 646 | .max_lp_rate = 10000000, |
| 647 | .te_support = false, | ||
| 642 | }; | 648 | }; |
| 643 | 649 | ||
| 644 | static const struct of_device_id dsicm_of_match[] = { | 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 | head.id = i; | 329 | head.id = i; |
| 330 | head.flags = 0; | 330 | head.flags = 0; |
| 331 | head.surface_id = 0; | ||
| 331 | oldcount = qdev->monitors_config->count; | 332 | oldcount = qdev->monitors_config->count; |
| 332 | if (crtc->state->active) { | 333 | if (crtc->state->active) { |
| 333 | struct drm_display_mode *mode = &crtc->mode; | 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 | int type, struct qxl_release **release, | 321 | int type, struct qxl_release **release, |
| 322 | struct qxl_bo **rbo) | 322 | struct qxl_bo **rbo) |
| 323 | { | 323 | { |
| 324 | struct qxl_bo *bo; | 324 | struct qxl_bo *bo, *free_bo = NULL; |
| 325 | int idr_ret; | 325 | int idr_ret; |
| 326 | int ret = 0; | 326 | int ret = 0; |
| 327 | union qxl_release_info *info; | 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 | mutex_lock(&qdev->release_mutex); | 348 | mutex_lock(&qdev->release_mutex); |
| 349 | if (qdev->current_release_bo_offset[cur_idx] + 1 >= releases_per_bo[cur_idx]) { | 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 | qdev->current_release_bo_offset[cur_idx] = 0; | 351 | qdev->current_release_bo_offset[cur_idx] = 0; |
| 352 | qdev->current_release_bo[cur_idx] = NULL; | 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 | ret = qxl_release_bo_alloc(qdev, &qdev->current_release_bo[cur_idx]); | 355 | ret = qxl_release_bo_alloc(qdev, &qdev->current_release_bo[cur_idx]); |
| 356 | if (ret) { | 356 | if (ret) { |
| 357 | mutex_unlock(&qdev->release_mutex); | 357 | mutex_unlock(&qdev->release_mutex); |
| 358 | if (free_bo) { | ||
| 359 | qxl_bo_unpin(free_bo); | ||
| 360 | qxl_bo_unref(&free_bo); | ||
| 361 | } | ||
| 358 | qxl_release_free(qdev, *release); | 362 | qxl_release_free(qdev, *release); |
| 359 | return ret; | 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 | *rbo = bo; | 374 | *rbo = bo; |
| 371 | 375 | ||
| 372 | mutex_unlock(&qdev->release_mutex); | 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 | ret = qxl_release_list_add(*release, bo); | 382 | ret = qxl_release_list_add(*release, bo); |
| 375 | qxl_bo_unref(&bo); | 383 | qxl_bo_unref(&bo); |
| @@ -574,6 +574,8 @@ struct radeon_gem { · 573 unmodified lines | |||
| 574 | struct list_head objects; | 574 | struct list_head objects; |
| 575 | }; | 575 | }; |
| 576 | 576 | ||
| 577 | extern const struct drm_gem_object_funcs radeon_gem_object_funcs; | ||
| 578 | |||
| 577 | int radeon_gem_init(struct radeon_device *rdev); | 579 | int radeon_gem_init(struct radeon_device *rdev); |
| 578 | void radeon_gem_fini(struct radeon_device *rdev); | 580 | void radeon_gem_fini(struct radeon_device *rdev); |
| 579 | int radeon_gem_object_create(struct radeon_device *rdev, unsigned long size, | 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 | int radeon_gem_prime_pin(struct drm_gem_object *obj); | 43 | int radeon_gem_prime_pin(struct drm_gem_object *obj); |
| 44 | void radeon_gem_prime_unpin(struct drm_gem_object *obj); | 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 | static void radeon_gem_object_free(struct drm_gem_object *gobj) | 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 | return r; | 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 | .free = radeon_gem_object_free, | 231 | .free = radeon_gem_object_free, |
| 232 | .open = radeon_gem_object_open, | 232 | .open = radeon_gem_object_open, |
| 233 | .close = radeon_gem_object_close, | 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 | if (ret) | 56 | if (ret) |
| 57 | return ERR_PTR(ret); | 57 | return ERR_PTR(ret); |
| 58 | 58 | ||
| 59 | bo->tbo.base.funcs = &radeon_gem_object_funcs; | ||
| 60 | |||
| 59 | mutex_lock(&rdev->gem.mutex); | 61 | mutex_lock(&rdev->gem.mutex); |
| 60 | list_add_tail(&bo->list, &rdev->gem.objects); | 62 | list_add_tail(&bo->list, &rdev->gem.objects); |
| 61 | mutex_unlock(&rdev->gem.mutex); | 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 | if (gtt->userflags & RADEON_GEM_USERPTR_ANONONLY) { | 364 | if (gtt->userflags & RADEON_GEM_USERPTR_ANONONLY) { |
| 365 | /* check that we only pin down anonymous memory | 365 | /* check that we only pin down anonymous memory |
| 366 | to prevent problems with writeback */ | 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 | struct vm_area_struct *vma; | 368 | struct vm_area_struct *vma; |
| 369 | vma = find_vma(gtt->usermm, gtt->userptr); | 369 | vma = find_vma(gtt->usermm, gtt->userptr); |
| 370 | if (!vma || vma->vm_file || vma->vm_end < end) | 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 | } while (pinned < ttm->num_pages); | 386 | } while (pinned < ttm->num_pages); |
| 387 | 387 | ||
| 388 | r = sg_alloc_table_from_pages(ttm->sg, ttm->pages, ttm->num_pages, 0, | 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 | GFP_KERNEL); | 390 | GFP_KERNEL); |
| 391 | if (r) | 391 | if (r) |
| 392 | goto release_sg; | 392 | goto release_sg; |
| @@ -48,21 +48,12 @@ static unsigned int rcar_du_encoder_count_ports(struct device_node *node) · 47 unmodified lines | |||
| 48 | static const struct drm_encoder_funcs rcar_du_encoder_funcs = { | 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 | int rcar_du_encoder_init(struct rcar_du_device *rcdu, | 51 | int rcar_du_encoder_init(struct rcar_du_device *rcdu, |
| 60 | enum rcar_du_output output, | 52 | enum rcar_du_output output, |
| 61 | struct device_node *enc_node) | 53 | struct device_node *enc_node) |
| 62 | { | 54 | { |
| 63 | struct rcar_du_encoder *renc; | 55 | struct rcar_du_encoder *renc; |
| 64 | struct drm_bridge *bridge; | 56 | struct drm_bridge *bridge; |
| 65 | int ret; | ||
| 66 | 57 | ||
| 67 | /* | 58 | /* |
| 68 | * Locate the DRM bridge from the DT node. For the DPAD outputs, if the | 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 | return -ENOLINK; | 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 | dev_dbg(rcdu->dev, "initializing encoder %pOF for output %u\n", | 95 | dev_dbg(rcdu->dev, "initializing encoder %pOF for output %u\n", |
| 111 | enc_node, output); | 96 | enc_node, output); |
| 112 | 97 | ||
| 113 | ret = drm_encoder_init(&rcdu->ddev, &renc->base, &rcar_du_encoder_funcs, | 98 | renc = drmm_encoder_alloc(&rcdu->ddev, struct rcar_du_encoder, base, |
| 114 | DRM_MODE_ENCODER_NONE, NULL); | 99 | &rcar_du_encoder_funcs, DRM_MODE_ENCODER_NONE, |
| 115 | if (ret < 0) { | 100 | NULL); |
| 116 | kfree(renc); | 101 | if (!renc) |
| 117 | return ret; | 102 | return -ENOMEM; |
| 118 | } | ||
| 119 | 103 | ||
| 120 | ret = drmm_add_action_or_reset(&rcdu->ddev, rcar_du_encoder_release, | 104 | renc->output = output; |
| 121 | renc); | ||
| 122 | if (ret) | ||
| 123 | return ret; | ||
| 124 | 105 | ||
| 125 | /* | 106 | /* |
| 126 | * Attach the bridge to the encoder. The bridge will create the | 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 | dev_err(dc->dev, | 1688 | dev_err(dc->dev, |
| 1689 | "failed to set clock rate to %lu Hz\n", | 1689 | "failed to set clock rate to %lu Hz\n", |
| 1690 | state->pclk); | 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 | DRM_DEBUG_KMS("rate: %lu, div: %u\n", clk_get_rate(dc->clk), | 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 | value = SHIFT_CLK_DIVIDER(state->div) | PIXEL_CLK_DIVIDER_PCD1; | 1703 | value = SHIFT_CLK_DIVIDER(state->div) | PIXEL_CLK_DIVIDER_PCD1; |
| 1699 | tegra_dc_writel(dc, value, DC_DISP_DISP_CLOCK_CONTROL); | 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 | static void tegra_dc_stop(struct tegra_dc *dc) | 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 | * POWER_CONTROL registers during CRTC enabling. | 2501 | * POWER_CONTROL registers during CRTC enabling. |
| 2502 | */ | 2502 | */ |
| 2503 | if (dc->soc->coupled_pm && dc->pipe == 1) { | 2503 | if (dc->soc->coupled_pm && dc->pipe == 1) { |
| 2504 | u32 flags = DL_FLAG_PM_RUNTIME | DL_FLAG_AUTOREMOVE_CONSUMER; | 2504 | struct device *companion; |
| 2505 | struct device_link *link; | 2505 | struct tegra_dc *parent; |
| 2506 | struct device *partner; | ||
| 2507 | 2506 | ||
| 2508 | partner = driver_find_device(dc->dev->driver, NULL, NULL, | 2507 | companion = driver_find_device(dc->dev->driver, NULL, (const void *)0, |
| 2509 | tegra_dc_match_by_pipe); | 2508 | tegra_dc_match_by_pipe); |
| 2510 | if (!partner) | 2509 | if (!companion) |
| 2511 | return -EPROBE_DEFER; | 2510 | return -EPROBE_DEFER; |
| 2512 | 2511 | ||
| 2513 | link = device_link_add(dc->dev, partner, flags); | 2512 | parent = dev_get_drvdata(companion); |
| 2514 | if (!link) { | 2513 | dc->client.parent = &parent->client; |
| 2515 | dev_err(dc->dev, "failed to link controllers\n"); | ||
| 2516 | return -EINVAL; | ||
| 2517 | } | ||
| 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 | return 0; | 2518 | return 0; |
| @@ -3115,6 +3115,12 @@ static int tegra_sor_init(struct host1x_client *client) · 3114 unmodified lines | |||
| 3115 | * kernel is possible. | 3115 | * kernel is possible. |
| 3116 | */ | 3116 | */ |
| 3117 | if (sor->rst) { | 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 | err = reset_control_acquire(sor->rst); | 3124 | err = reset_control_acquire(sor->rst); |
| 3119 | if (err < 0) { | 3125 | if (err < 0) { |
| 3120 | dev_err(sor->dev, "failed to acquire SOR reset: %d\n", | 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 | reset_control_release(sor->rst); | 3156 | reset_control_release(sor->rst); |
| 3157 | pm_runtime_put(sor->dev); | ||
| 3151 | } | 3158 | } |
| 3152 | 3159 | ||
| 3153 | err = clk_prepare_enable(sor->clk_safe); | 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 | struct gm12u320_device { | 84 | struct gm12u320_device { |
| 85 | struct drm_device dev; | 85 | struct drm_device dev; |
| 86 | struct device *dmadev; | ||
| 86 | struct drm_simple_display_pipe pipe; | 87 | struct drm_simple_display_pipe pipe; |
| 87 | struct drm_connector conn; | 88 | struct drm_connector conn; |
| 88 | unsigned char *cmd_buf; | 89 | unsigned char *cmd_buf; |
| @@ -601,6 +602,22 @@ static const uint64_t gm12u320_pipe_modifiers[] = { · 512 unmodified lines | |||
| 601 | DRM_FORMAT_MOD_INVALID | 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 | DEFINE_DRM_GEM_FOPS(gm12u320_fops); | 621 | DEFINE_DRM_GEM_FOPS(gm12u320_fops); |
| 605 | 622 | ||
| 606 | static const struct drm_driver gm12u320_drm_driver = { | 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 | .fops = &gm12u320_fops, | 632 | .fops = &gm12u320_fops, |
| 616 | DRM_GEM_SHMEM_DRIVER_OPS, | 633 | DRM_GEM_SHMEM_DRIVER_OPS, |
| 634 | .gem_prime_import = gm12u320_gem_prime_import, | ||
| 617 | }; | 635 | }; |
| 618 | 636 | ||
| 619 | static const struct drm_mode_config_funcs gm12u320_mode_config_funcs = { | 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 | struct gm12u320_device, dev); | 658 | struct gm12u320_device, dev); |
| 641 | if (IS_ERR(gm12u320)) | 659 | if (IS_ERR(gm12u320)) |
| 642 | return PTR_ERR(gm12u320); | 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 | INIT_DELAYED_WORK(&gm12u320->fb_update.work, gm12u320_fb_update_work); | 667 | INIT_DELAYED_WORK(&gm12u320->fb_update.work, gm12u320_fb_update_work); |
| 645 | mutex_init(&gm12u320->fb_update.lock); | 668 | mutex_init(&gm12u320->fb_update.lock); |
| 646 | 669 | ||
| 647 | dev = &gm12u320->dev; | ||
| 648 | |||
| 649 | ret = drmm_mode_config_init(dev); | 670 | ret = drmm_mode_config_init(dev); |
| 650 | if (ret) | 671 | if (ret) |
| 651 | return ret; | 672 | goto err_put_device; |
| 652 | 673 | ||
| 653 | dev->mode_config.min_width = GM12U320_USER_WIDTH; | 674 | dev->mode_config.min_width = GM12U320_USER_WIDTH; |
| 654 | dev->mode_config.max_width = GM12U320_USER_WIDTH; | 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 | ret = gm12u320_usb_alloc(gm12u320); | 680 | ret = gm12u320_usb_alloc(gm12u320); |
| 660 | if (ret) | 681 | if (ret) |
| 661 | return ret; | 682 | goto err_put_device; |
| 662 | 683 | ||
| 663 | ret = gm12u320_set_ecomode(gm12u320); | 684 | ret = gm12u320_set_ecomode(gm12u320); |
| 664 | if (ret) | 685 | if (ret) |
| 665 | return ret; | 686 | goto err_put_device; |
| 666 | 687 | ||
| 667 | ret = gm12u320_conn_init(gm12u320); | 688 | ret = gm12u320_conn_init(gm12u320); |
| 668 | if (ret) | 689 | if (ret) |
| 669 | return ret; | 690 | goto err_put_device; |
| 670 | 691 | ||
| 671 | ret = drm_simple_display_pipe_init(&gm12u320->dev, | 692 | ret = drm_simple_display_pipe_init(&gm12u320->dev, |
| 672 | &gm12u320->pipe, | 693 | &gm12u320->pipe, |
| @@ -676,24 +697,31 @@ static int gm12u320_usb_probe(struct usb_interface *interface, · 3 unmodified lines | |||
| 676 | gm12u320_pipe_modifiers, | 697 | gm12u320_pipe_modifiers, |
| 677 | &gm12u320->conn); | 698 | &gm12u320->conn); |
| 678 | if (ret) | 699 | if (ret) |
| 679 | return ret; | 700 | goto err_put_device; |
| 680 | 701 | ||
| 681 | drm_mode_config_reset(dev); | 702 | drm_mode_config_reset(dev); |
| 682 | 703 | ||
| 683 | usb_set_intfdata(interface, dev); | 704 | usb_set_intfdata(interface, dev); |
| 684 | ret = drm_dev_register(dev, 0); | 705 | ret = drm_dev_register(dev, 0); |
| 685 | if (ret) | 706 | if (ret) |
| 686 | return ret; | 707 | goto err_put_device; |
| 687 | 708 | ||
| 688 | drm_fbdev_generic_setup(dev, 0); | 709 | drm_fbdev_generic_setup(dev, 0); |
| 689 | 710 | ||
| 690 | return 0; | 711 | return 0; |
| 712 | |||
| 713 | err_put_device: | ||
| 714 | put_device(gm12u320->dmadev); | ||
| 715 | return ret; | ||
| 691 | } | 716 | } |
| 692 | 717 | ||
| 693 | static void gm12u320_usb_disconnect(struct usb_interface *interface) | 718 | static void gm12u320_usb_disconnect(struct usb_interface *interface) |
| 694 | { | 719 | { |
| 695 | struct drm_device *dev = usb_get_intfdata(interface); | 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 | drm_dev_unplug(dev); | 725 | drm_dev_unplug(dev); |
| 698 | drm_atomic_helper_shutdown(dev); | 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 | struct ttm_bo_device *bdev = bo->bdev; | 136 | struct ttm_bo_device *bdev = bo->bdev; |
| 137 | struct ttm_resource_manager *man; | 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 | if (bo->pin_count) { | 142 | if (bo->pin_count) { |
| 142 | ttm_bo_del_from_lru(bo); | 143 | ttm_bo_del_from_lru(bo); |
| @@ -508,8 +509,11 @@ static void ttm_bo_release(struct kref *kref) · 365 unmodified lines | |||
| 508 | * Make pinned bos immediately available to | 509 | * Make pinned bos immediately available to |
| 509 | * shrinkers, now that they are queued for | 510 | * shrinkers, now that they are queued for |
| 510 | * destruction. | 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 | bo->pin_count = 0; | 517 | bo->pin_count = 0; |
| 514 | ttm_bo_move_to_lru_tail(bo, &bo->mem, NULL); | 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 | /* Remove a pool_type from the global shrinker list and free all pages */ | 268 | /* Remove a pool_type from the global shrinker list and free all pages */ |
| 269 | static void ttm_pool_type_fini(struct ttm_pool_type *pt) | 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 | mutex_lock(&shrinker_lock); | 273 | mutex_lock(&shrinker_lock); |
| 274 | list_del(&pt->shrinker_list); | 274 | list_del(&pt->shrinker_list); |
| 275 | mutex_unlock(&shrinker_lock); | 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 | ttm_pool_free_page(pt->pool, pt->caching, pt->order, p); | 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 | return drm_mode_config_helper_resume(dev); | 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 | DEFINE_DRM_GEM_FOPS(udl_driver_fops); | 51 | DEFINE_DRM_GEM_FOPS(udl_driver_fops); |
| 36 | 52 | ||
| 37 | static const struct drm_driver driver = { | 53 | static const struct drm_driver driver = { |
| @@ -40,6 +56,7 @@ static const struct drm_driver driver = { · 2 unmodified lines | |||
| 40 | /* GEM hooks */ | 56 | /* GEM hooks */ |
| 41 | .fops = &udl_driver_fops, | 57 | .fops = &udl_driver_fops, |
| 42 | DRM_GEM_SHMEM_DRIVER_OPS, | 58 | DRM_GEM_SHMEM_DRIVER_OPS, |
| 59 | .gem_prime_import = udl_driver_gem_prime_import, | ||
| 43 | 60 | ||
| 44 | .name = DRIVER_NAME, | 61 | .name = DRIVER_NAME, |
| 45 | .desc = DRIVER_DESC, | 62 | .desc = DRIVER_DESC, |
| @@ -50,6 +50,7 @@ struct urb_list { · 49 unmodified lines | |||
| 50 | struct udl_device { | 50 | struct udl_device { |
| 51 | struct drm_device drm; | 51 | struct drm_device drm; |
| 52 | struct device *dev; | 52 | struct device *dev; |
| 53 | struct device *dmadev; | ||
| 53 | 54 | ||
| 54 | struct drm_simple_display_pipe display_pipe; | 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 | DRM_DEBUG("\n"); | 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 | mutex_init(&udl->gem_lock); | 322 | mutex_init(&udl->gem_lock); |
| 319 | 323 | ||
| 320 | if (!udl_parse_vendor_descriptor(udl)) { | 324 | if (!udl_parse_vendor_descriptor(udl)) { |
| @@ -343,12 +347,18 @@ int udl_init(struct udl_device *udl) · 22 unmodified lines | |||
| 343 | err: | 347 | err: |
| 344 | if (udl->urbs.count) | 348 | if (udl->urbs.count) |
| 345 | udl_free_urb_list(dev); | 349 | udl_free_urb_list(dev); |
| 350 | put_device(udl->dmadev); | ||
| 346 | DRM_ERROR("%d\n", ret); | 351 | DRM_ERROR("%d\n", ret); |
| 347 | return ret; | 352 | return ret; |
| 348 | } | 353 | } |
| 349 | 354 | ||
| 350 | int udl_drop_usb(struct drm_device *dev) | 355 | int udl_drop_usb(struct drm_device *dev) |
| 351 | { | 356 | { |
| 357 | struct udl_device *udl = to_udl(dev); | ||
| 358 | |||
| 352 | udl_free_urb_list(dev); | 359 | udl_free_urb_list(dev); |
| 360 | put_device(udl->dmadev); | ||
| 361 | udl->dmadev = NULL; | ||
| 362 | |||
| 353 | return 0; | 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 | const struct vc4_crtc_data *crtc_data = vc4_crtc_to_vc4_crtc_data(vc4_crtc); | 211 | const struct vc4_crtc_data *crtc_data = vc4_crtc_to_vc4_crtc_data(vc4_crtc); |
| 212 | const struct vc4_pv_data *pv_data = vc4_crtc_to_vc4_pv_data(vc4_crtc); | 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 | u32 fifo_len_bytes = pv_data->fifo_depth; | 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 | if (crtc_data->hvs_output == 5) | 239 | if (crtc_data->hvs_output == 5) |
| 239 | return 32; | 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 | return fifo_len_bytes - 3 * HVS_FIFO_LATENCY_PIX; | 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 | plane->state->src_y = state->src_y; | 1146 | plane->state->src_y = state->src_y; |
| 1147 | plane->state->src_w = state->src_w; | 1147 | plane->state->src_w = state->src_w; |
| 1148 | plane->state->src_h = state->src_h; | 1148 | plane->state->src_h = state->src_h; |
| 1149 | plane->state->src_h = state->src_h; | ||
| 1150 | plane->state->alpha = state->alpha; | 1149 | plane->state->alpha = state->alpha; |
| 1151 | plane->state->pixel_blend_mode = state->pixel_blend_mode; | 1150 | plane->state->pixel_blend_mode = state->pixel_blend_mode; |
| 1152 | plane->state->rotation = state->rotation; | 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 | vmw_bo_unreference(&old_buf); | 481 | vmw_bo_unreference(&old_buf); |
| 482 | res->id = vcotbl->type; | 482 | res->id = vcotbl->type; |
| 483 | 483 | ||
| 484 | /* Release the pin acquired in vmw_bo_init */ | ||
| 485 | ttm_bo_unpin(bo); | ||
| 486 | |||
| 484 | return 0; | 487 | return 0; |
| 485 | 488 | ||
| 486 | out_map_new: | 489 | out_map_new: |
| 487 | ttm_bo_kunmap(&old_map); | 490 | ttm_bo_kunmap(&old_map); |
| 488 | out_wait: | 491 | out_wait: |
| 492 | ttm_bo_unpin(bo); | ||
| 489 | ttm_bo_unreserve(bo); | 493 | ttm_bo_unreserve(bo); |
| 490 | vmw_bo_unreference(&buf); | 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 | dev_priv->last_read_seqno = (uint32_t) -100; | 712 | dev_priv->last_read_seqno = (uint32_t) -100; |
| 713 | dev_priv->drm.dev_private = dev_priv; | 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 | mutex_init(&dev_priv->cmdbuf_mutex); | 715 | mutex_init(&dev_priv->cmdbuf_mutex); |
| 723 | mutex_init(&dev_priv->release_mutex); | ||
| 724 | mutex_init(&dev_priv->binding_mutex); | 716 | mutex_init(&dev_priv->binding_mutex); |
| 725 | mutex_init(&dev_priv->global_kms_state_mutex); | ||
| 726 | ttm_lock_init(&dev_priv->reservation_sem); | 717 | ttm_lock_init(&dev_priv->reservation_sem); |
| 727 | spin_lock_init(&dev_priv->resource_lock); | 718 | spin_lock_init(&dev_priv->resource_lock); |
| 728 | spin_lock_init(&dev_priv->hw_lock); | 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 | spin_lock_init(&dev_priv->cap_lock); | 721 | spin_lock_init(&dev_priv->cap_lock); |
| 731 | spin_lock_init(&dev_priv->cursor_lock); | 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 | for (i = vmw_res_context; i < vmw_res_max; ++i) { | 732 | for (i = vmw_res_context; i < vmw_res_max; ++i) { |
| 734 | idr_init(&dev_priv->res_idr[i]); | 733 | idr_init(&dev_priv->res_idr[i]); |
| 735 | INIT_LIST_HEAD(&dev_priv->res_lru[i]); | 734 | INIT_LIST_HEAD(&dev_priv->res_lru[i]); |
| @@ -529,7 +529,6 @@ struct vmw_private { · 528 unmodified lines | |||
| 529 | struct vmw_overlay *overlay_priv; | 529 | struct vmw_overlay *overlay_priv; |
| 530 | struct drm_property *hotplug_mode_update_property; | 530 | struct drm_property *hotplug_mode_update_property; |
| 531 | struct drm_property *implicit_placement_property; | 531 | struct drm_property *implicit_placement_property; |
| 532 | struct mutex global_kms_state_mutex; | ||
| 533 | spinlock_t cursor_lock; | 532 | spinlock_t cursor_lock; |
| 534 | struct drm_atomic_state *suspend_state; | 533 | struct drm_atomic_state *suspend_state; |
| 535 | 534 | ||
| @@ -592,7 +591,6 @@ struct vmw_private { · 56 unmodified lines | |||
| 592 | bool refuse_hibernation; | 591 | bool refuse_hibernation; |
| 593 | bool suspend_locked; | 592 | bool suspend_locked; |
| 594 | 593 | ||
| 595 | struct mutex release_mutex; | ||
| 596 | atomic_t num_fifo_resources; | 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 | struct vmw_buffer_object *tmp_buf = *buf; | 1522 | struct vmw_buffer_object *tmp_buf = *buf; |
| 1525 | 1523 | ||
| 1526 | *buf = NULL; | 1524 | *buf = NULL; |
| 1527 | if (tmp_buf != NULL) { | 1525 | if (tmp_buf != NULL) |
| 1528 | ttm_bo_put(&tmp_buf->base); | 1526 | ttm_bo_put(&tmp_buf->base); |
| 1529 | } | ||
| 1530 | } | 1527 | } |
| 1531 | 1528 | ||
| 1532 | static inline struct vmw_buffer_object * | 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 | struct vmw_piter data_iter, | 94 | struct vmw_piter data_iter, |
| 95 | unsigned long num_data_pages); | 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 | * vmw_setup_otable_base - Issue an object table base setup command to | 108 | * vmw_setup_otable_base - Issue an object table base setup command to |
| 99 | * the device | 109 | * the device |
| @@ -277,6 +287,7 @@ out_no_setup: · 177 unmodified lines | |||
| 277 | &batch->otables[i]); | 287 | &batch->otables[i]); |
| 278 | } | 288 | } |
| 279 | 289 | ||
| 290 | vmw_bo_unpin_unlocked(batch->otable_bo); | ||
| 280 | ttm_bo_put(batch->otable_bo); | 291 | ttm_bo_put(batch->otable_bo); |
| 281 | batch->otable_bo = NULL; | 292 | batch->otable_bo = NULL; |
| 282 | return ret; | 293 | return ret; |
| @@ -340,6 +351,7 @@ static void vmw_otable_batch_takedown(struct vmw_private *dev_priv, · 57 unmodified lines | |||
| 340 | BUG_ON(ret != 0); | 351 | BUG_ON(ret != 0); |
| 341 | 352 | ||
| 342 | vmw_bo_fence_single(bo, NULL); | 353 | vmw_bo_fence_single(bo, NULL); |
| 354 | ttm_bo_unpin(bo); | ||
| 343 | ttm_bo_unreserve(bo); | 355 | ttm_bo_unreserve(bo); |
| 344 | 356 | ||
| 345 | ttm_bo_put(batch->otable_bo); | 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 | void vmw_mob_destroy(struct vmw_mob *mob) | 540 | void vmw_mob_destroy(struct vmw_mob *mob) |
| 529 | { | 541 | { |
| 530 | if (mob->pt_bo) { | 542 | if (mob->pt_bo) { |
| 543 | vmw_bo_unpin_unlocked(mob->pt_bo); | ||
| 531 | ttm_bo_put(mob->pt_bo); | 544 | ttm_bo_put(mob->pt_bo); |
| 532 | mob->pt_bo = NULL; | 545 | mob->pt_bo = NULL; |
| 533 | } | 546 | } |
| @@ -643,6 +656,7 @@ int vmw_mob_bind(struct vmw_private *dev_priv, · 109 unmodified lines | |||
| 643 | out_no_cmd_space: | 656 | out_no_cmd_space: |
| 644 | vmw_fifo_resource_dec(dev_priv); | 657 | vmw_fifo_resource_dec(dev_priv); |
| 645 | if (pt_set_up) { | 658 | if (pt_set_up) { |
| 659 | vmw_bo_unpin_unlocked(mob->pt_bo); | ||
| 646 | ttm_bo_put(mob->pt_bo); | 660 | ttm_bo_put(mob->pt_bo); |
| 647 | mob->pt_bo = NULL; | 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 | vm_fault_t ret; | 500 | vm_fault_t ret; |
| 501 | pgoff_t fault_page_size; | 501 | pgoff_t fault_page_size; |
| 502 | bool write = vmf->flags & FAULT_FLAG_WRITE; | 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 | switch (pe_size) { | 504 | switch (pe_size) { |
| 507 | case PE_SIZE_PMD: | 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 | /* Always do write dirty-tracking and COW on PTE level. */ | 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 | return VM_FAULT_FALLBACK; | 520 | return VM_FAULT_FALLBACK; |
| 523 | 521 | ||
| 524 | ret = ttm_bo_vm_reserve(bo, vmf); | 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 | vma->vm_ops = &vmw_vm_ops; | 49 | vma->vm_ops = &vmw_vm_ops; |
| 50 | 50 | ||
| 51 | /* Use VM_PFNMAP rather than VM_MIXEDMAP if not a COW mapping */ | 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 | vma->vm_flags = (vma->vm_flags & ~VM_MIXEDMAP) | VM_PFNMAP; | 53 | vma->vm_flags = (vma->vm_flags & ~VM_MIXEDMAP) | VM_PFNMAP; |
| 54 | 54 | ||
| 55 | return 0; | 55 | return 0; |
| @@ -521,7 +521,7 @@ static int xen_drm_drv_init(struct xen_drm_front_info *front_info) · 520 unmodified lines | |||
| 521 | drm_dev = drm_dev_alloc(&xen_drm_driver, dev); | 521 | drm_dev = drm_dev_alloc(&xen_drm_driver, dev); |
| 522 | if (IS_ERR(drm_dev)) { | 522 | if (IS_ERR(drm_dev)) { |
| 523 | ret = PTR_ERR(drm_dev); | 523 | ret = PTR_ERR(drm_dev); |
| 524 | goto fail; | 524 | goto fail_dev; |
| 525 | } | 525 | } |
| 526 | 526 | ||
| 527 | drm_info->drm_dev = drm_dev; | 527 | drm_info->drm_dev = drm_dev; |
| @@ -551,8 +551,10 @@ fail_modeset: · 23 unmodified lines | |||
| 551 | drm_kms_helper_poll_fini(drm_dev); | 551 | drm_kms_helper_poll_fini(drm_dev); |
| 552 | drm_mode_config_cleanup(drm_dev); | 552 | drm_mode_config_cleanup(drm_dev); |
| 553 | drm_dev_put(drm_dev); | 553 | drm_dev_put(drm_dev); |
| 554 | fail: | 554 | fail_dev: |
| 555 | kfree(drm_info); | 555 | kfree(drm_info); |
| 556 | front_info->drm_info = NULL; | ||
| 557 | fail: | ||
| 556 | return ret; | 558 | return ret; |
| 557 | } | 559 | } |
| 558 | 560 | ||
| @@ -16,7 +16,6 @@ · 15 unmodified lines | |||
| 16 | struct drm_connector; | 16 | struct drm_connector; |
| 17 | struct xen_drm_front_drm_info; | 17 | struct xen_drm_front_drm_info; |
| 18 | 18 | ||
| 19 | struct xen_drm_front_drm_info; | ||
| 20 | 19 | ||
| 21 | int xen_drm_front_conn_init(struct xen_drm_front_drm_info *drm_info, | 20 | int xen_drm_front_conn_init(struct xen_drm_front_drm_info *drm_info, |
| 22 | struct drm_connector *connector); | 21 | struct drm_connector *connector); |
| @@ -705,8 +705,9 @@ void host1x_driver_unregister(struct host1x_driver *driver) · 704 unmodified lines | |||
| 705 | EXPORT_SYMBOL(host1x_driver_unregister); | 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 | * @client: host1x client | 709 | * @client: host1x client |
| 710 | * @key: lock class key for the client-specific mutex | ||
| 710 | * | 711 | * |
| 711 | * Registers a host1x client with each host1x controller instance. Note that | 712 | * Registers a host1x client with each host1x controller instance. Note that |
| 712 | * each client will only match their parent host1x controller and will only be | 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 | * device and call host1x_device_init(), which will in turn call each client's | 716 | * device and call host1x_device_init(), which will in turn call each client's |
| 716 | * &host1x_client_ops.init implementation. | 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 | struct host1x *host1x; | 722 | struct host1x *host1x; |
| 721 | int err; | 723 | int err; |
| 722 | 724 | ||
| 723 | INIT_LIST_HEAD(&client->list); | 725 | INIT_LIST_HEAD(&client->list); |
| 724 | mutex_init(&client->lock); | 726 | __mutex_init(&client->lock, "host1x client lock", key); |
| 725 | client->usecount = 0; | 727 | client->usecount = 0; |
| 726 | 728 | ||
| 727 | mutex_lock(&devices_lock); | 729 | mutex_lock(&devices_lock); |
| @@ -742,7 +744,7 @@ int host1x_client_register(struct host1x_client *client) · 14 unmodified lines | |||
| 742 | 744 | ||
| 743 | return 0; | 745 | return 0; |
| 744 | } | 746 | } |
| 745 | EXPORT_SYMBOL(host1x_client_register); | 747 | EXPORT_SYMBOL(__host1x_client_register); |
| 746 | 748 | ||
| 747 | /** | 749 | /** |
| 748 | * host1x_client_unregister() - unregister a host1x client | 750 | * host1x_client_unregister() - unregister a host1x client |
| @@ -10,6 +10,7 @@ · 9 unmodified lines | |||
| 10 | #include <linux/bitops.h> | 10 | #include <linux/bitops.h> |
| 11 | #include <linux/delay.h> | 11 | #include <linux/delay.h> |
| 12 | #include <linux/dma-mapping.h> | 12 | #include <linux/dma-mapping.h> |
| 13 | #include <linux/dmi.h> | ||
| 13 | #include <linux/interrupt.h> | 14 | #include <linux/interrupt.h> |
| 14 | #include <linux/io-64-nonatomic-lo-hi.h> | 15 | #include <linux/io-64-nonatomic-lo-hi.h> |
| 15 | #include <linux/module.h> | 16 | #include <linux/module.h> |
| @@ -22,9 +23,13 @@ · 6 unmodified lines | |||
| 22 | 23 | ||
| 23 | #define ACEL_EN BIT(0) | 24 | #define ACEL_EN BIT(0) |
| 24 | #define GYRO_EN BIT(1) | 25 | #define GYRO_EN BIT(1) |
| 25 | #define MAGNO_EN BIT(2) | 26 | #define MAGNO_EN BIT(2) |
| 26 | #define ALS_EN BIT(19) | 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 | void amd_start_sensor(struct amd_mp2_dev *privdata, struct amd_mp2_sensor_info info) | 33 | void amd_start_sensor(struct amd_mp2_dev *privdata, struct amd_mp2_sensor_info info) |
| 29 | { | 34 | { |
| 30 | union sfh_cmd_param cmd_param; | 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 | writel(cmd_base.ul, privdata->mmio + AMD_C2P_MSG0); | 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 | int amd_mp2_get_sensor_num(struct amd_mp2_dev *privdata, u8 *sensor_id) | 97 | int amd_mp2_get_sensor_num(struct amd_mp2_dev *privdata, u8 *sensor_id) |
| 77 | { | 98 | { |
| 78 | int activestatus, num_of_sensors = 0; | 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 | if (ACEL_EN & activestatus) | 116 | if (ACEL_EN & activestatus) |
| 83 | sensor_id[num_of_sensors++] = accel_idx; | 117 | sensor_id[num_of_sensors++] = accel_idx; |
| 84 | 118 | ||
| @@ -61,7 +61,6 @@ struct amd_mp2_dev { · 60 unmodified lines | |||
| 61 | struct pci_dev *pdev; | 61 | struct pci_dev *pdev; |
| 62 | struct amdtp_cl_data *cl_data; | 62 | struct amdtp_cl_data *cl_data; |
| 63 | void __iomem *mmio; | 63 | void __iomem *mmio; |
| 64 | u32 activecontrolstatus; | ||
| 65 | }; | 64 | }; |
| 66 | 65 | ||
| 67 | struct amd_mp2_sensor_info { | 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 | if (input_register_device(data->input2)) { | 762 | if (input_register_device(data->input2)) { |
| 763 | input_free_device(input2); | 763 | input_free_device(input2); |
| 764 | ret = -ENOENT; | ||
| 764 | goto exit; | 765 | goto exit; |
| 765 | } | 766 | } |
| 766 | } | 767 | } |
| @@ -1221,6 +1221,9 @@ static const struct hid_device_id asus_devices[] = { · 1220 unmodified lines | |||
| 1221 | { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK, | 1221 | { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK, |
| 1222 | USB_DEVICE_ID_ASUSTEK_ROG_NKEY_KEYBOARD), | 1222 | USB_DEVICE_ID_ASUSTEK_ROG_NKEY_KEYBOARD), |
| 1223 | QUIRK_USE_KBD_BACKLIGHT | QUIRK_ROG_NKEY_KEYBOARD }, | 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 | { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK, | 1227 | { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK, |
| 1225 | USB_DEVICE_ID_ASUSTEK_T100TA_KEYBOARD), | 1228 | USB_DEVICE_ID_ASUSTEK_T100TA_KEYBOARD), |
| 1226 | QUIRK_T100_KEYBOARD | QUIRK_NO_CONSUMER_USAGES }, | 1229 | QUIRK_T100_KEYBOARD | QUIRK_NO_CONSUMER_USAGES }, |
| @@ -161,6 +161,7 @@ struct cp2112_device { · 160 unmodified lines | |||
| 161 | atomic_t read_avail; | 161 | atomic_t read_avail; |
| 162 | atomic_t xfer_avail; | 162 | atomic_t xfer_avail; |
| 163 | struct gpio_chip gc; | 163 | struct gpio_chip gc; |
| 164 | struct irq_chip irq; | ||
| 164 | u8 *in_out_buffer; | 165 | u8 *in_out_buffer; |
| 165 | struct mutex lock; | 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 | return 0; | 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 | static int __maybe_unused cp2112_allocate_irq(struct cp2112_device *dev, | 1179 | static int __maybe_unused cp2112_allocate_irq(struct cp2112_device *dev, |
| 1189 | int pin) | 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 | dev->gc.can_sleep = 1; | 1330 | dev->gc.can_sleep = 1; |
| 1340 | dev->gc.parent = &hdev->dev; | 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 | girq = &dev->gc.irq; | 1342 | girq = &dev->gc.irq; |
| 1343 | girq->chip = &cp2112_gpio_irqchip; | 1343 | girq->chip = &dev->irq; |
| 1344 | /* The event comes from the outside so no parent handler */ | 1344 | /* The event comes from the outside so no parent handler */ |
| 1345 | girq->parent_handler = NULL; | 1345 | girq->parent_handler = NULL; |
| 1346 | girq->num_parents = 0; | 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 | static const struct hid_device_id hammer_devices[] = { | 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 | { HID_DEVICE(BUS_USB, HID_GROUP_GENERIC, | 578 | { HID_DEVICE(BUS_USB, HID_GROUP_GENERIC, |
| 577 | USB_VENDOR_ID_GOOGLE, USB_DEVICE_ID_GOOGLE_HAMMER) }, | 579 | USB_VENDOR_ID_GOOGLE, USB_DEVICE_ID_GOOGLE_HAMMER) }, |
| 578 | { HID_DEVICE(BUS_USB, HID_GROUP_GENERIC, | 580 | { HID_DEVICE(BUS_USB, HID_GROUP_GENERIC, |
| @@ -194,6 +194,7 @@ · 193 unmodified lines | |||
| 194 | #define USB_DEVICE_ID_ASUSTEK_ROG_KEYBOARD2 0x1837 | 194 | #define USB_DEVICE_ID_ASUSTEK_ROG_KEYBOARD2 0x1837 |
| 195 | #define USB_DEVICE_ID_ASUSTEK_ROG_KEYBOARD3 0x1822 | 195 | #define USB_DEVICE_ID_ASUSTEK_ROG_KEYBOARD3 0x1822 |
| 196 | #define USB_DEVICE_ID_ASUSTEK_ROG_NKEY_KEYBOARD 0x1866 | 196 | #define USB_DEVICE_ID_ASUSTEK_ROG_NKEY_KEYBOARD 0x1866 |
| 197 | #define USB_DEVICE_ID_ASUSTEK_ROG_NKEY_KEYBOARD2 0x19b6 | ||
| 197 | #define USB_DEVICE_ID_ASUSTEK_FX503VD_KEYBOARD 0x1869 | 198 | #define USB_DEVICE_ID_ASUSTEK_FX503VD_KEYBOARD 0x1869 |
| 198 | 199 | ||
| 199 | #define USB_VENDOR_ID_ATEN 0x0557 | 200 | #define USB_VENDOR_ID_ATEN 0x0557 |
| @@ -493,6 +494,7 @@ · 293 unmodified lines | |||
| 493 | #define USB_DEVICE_ID_GOOGLE_MASTERBALL 0x503c | 494 | #define USB_DEVICE_ID_GOOGLE_MASTERBALL 0x503c |
| 494 | #define USB_DEVICE_ID_GOOGLE_MAGNEMITE 0x503d | 495 | #define USB_DEVICE_ID_GOOGLE_MAGNEMITE 0x503d |
| 495 | #define USB_DEVICE_ID_GOOGLE_MOONBALL 0x5044 | 496 | #define USB_DEVICE_ID_GOOGLE_MOONBALL 0x5044 |
| 497 | #define USB_DEVICE_ID_GOOGLE_DON 0x5050 | ||
| 496 | 498 | ||
| 497 | #define USB_VENDOR_ID_GOTOP 0x08f2 | 499 | #define USB_VENDOR_ID_GOTOP 0x08f2 |
| 498 | #define USB_DEVICE_ID_SUPER_Q2 0x007f | 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 | !wacom_wac->shared->is_touch_on) { | 2533 | !wacom_wac->shared->is_touch_on) { |
| 2534 | if (!wacom_wac->shared->touch_down) | 2534 | if (!wacom_wac->shared->touch_down) |
| 2535 | return; | 2535 | return; |
| 2536 | prox = 0; | 2536 | prox = false; |
| 2537 | } | 2537 | } |
| 2538 | 2538 | ||
| 2539 | wacom_wac->hid_data.num_received++; | 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 | struct wacom_features *features = &wacom_wac->features; | 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 | if (!(features->device_type & WACOM_DEVICETYPE_PEN)) | 3577 | if (!(features->device_type & WACOM_DEVICETYPE_PEN)) |
| 3580 | return -ENODEV; | 3578 | return -ENODEV; |
| 3581 | 3579 | ||
| @@ -3590,6 +3588,7 @@ int wacom_setup_pen_input_capabilities(struct input_dev *input_dev, · 8 unmodified lines | |||
| 3590 | return 0; | 3588 | return 0; |
| 3591 | } | 3589 | } |
| 3592 | 3590 | ||
| 3591 | input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); | ||
| 3593 | __set_bit(BTN_TOUCH, input_dev->keybit); | 3592 | __set_bit(BTN_TOUCH, input_dev->keybit); |
| 3594 | __set_bit(ABS_MISC, input_dev->absbit); | 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 | struct wacom_features *features = &wacom_wac->features; | 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 | if (!(features->device_type & WACOM_DEVICETYPE_TOUCH)) | 3744 | if (!(features->device_type & WACOM_DEVICETYPE_TOUCH)) |
| 3748 | return -ENODEV; | 3745 | return -ENODEV; |
| 3749 | 3746 | ||
| @@ -3756,6 +3753,7 @@ int wacom_setup_touch_input_capabilities(struct input_dev *input_dev, · 6 unmodified lines | |||
| 3756 | /* setup has already been done */ | 3753 | /* setup has already been done */ |
| 3757 | return 0; | 3754 | return 0; |
| 3758 | 3755 | ||
| 3756 | input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); | ||
| 3759 | __set_bit(BTN_TOUCH, input_dev->keybit); | 3757 | __set_bit(BTN_TOUCH, input_dev->keybit); |
| 3760 | 3758 | ||
| 3761 | if (features->touch_max == 1) { | 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 | if ((comp_param1 & DW_IC_COMP_PARAM_1_SPEED_MODE_MASK) | 129 | if ((comp_param1 & DW_IC_COMP_PARAM_1_SPEED_MODE_MASK) |
| 130 | != DW_IC_COMP_PARAM_1_SPEED_MODE_HIGH) { | 130 | != DW_IC_COMP_PARAM_1_SPEED_MODE_HIGH) { |
| 131 | dev_err(dev->dev, "High Speed not supported!\n"); | 131 | dev_err(dev->dev, "High Speed not supported!\n"); |
| 132 | t->bus_freq_hz = I2C_MAX_FAST_MODE_FREQ; | ||
| 132 | dev->master_cfg &= ~DW_IC_CON_SPEED_MASK; | 133 | dev->master_cfg &= ~DW_IC_CON_SPEED_MASK; |
| 133 | dev->master_cfg |= DW_IC_CON_SPEED_FAST; | 134 | dev->master_cfg |= DW_IC_CON_SPEED_FAST; |
| 134 | dev->hs_hcnt = 0; | 135 | dev->hs_hcnt = 0; |
| @@ -1,5 +1,5 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0-only | 1 | // SPDX-License-Identifier: GPL-2.0-only |
| 2 | /** | 2 | /* |
| 3 | * i2c-exynos5.c - Samsung Exynos5 I2C Controller Driver | 3 | * i2c-exynos5.c - Samsung Exynos5 I2C Controller Driver |
| 4 | * | 4 | * |
| 5 | * Copyright (C) 2013 Samsung Electronics Co., Ltd. | 5 | * Copyright (C) 2013 Samsung Electronics Co., Ltd. |
| @@ -1,7 +1,7 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0-or-later | 1 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2014 Linaro Ltd. | 3 | * Copyright (c) 2014 Linaro Ltd. |
| 4 | * Copyright (c) 2014 Hisilicon Limited. | 4 | * Copyright (c) 2014 HiSilicon Limited. |
| 5 | * | 5 | * |
| 6 | * Now only support 7 bit address. | 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 | i2c_sta = jz4780_i2c_readw(i2c, JZ4780_I2C_STA); | 525 | i2c_sta = jz4780_i2c_readw(i2c, JZ4780_I2C_STA); |
| 526 | data = *i2c->wbuf; | 526 | data = *i2c->wbuf; |
| 527 | data &= ~JZ4780_I2C_DC_READ; | 527 | data &= ~JZ4780_I2C_DC_READ; |
| 528 | if ((!i2c->stop_hold) && (i2c->cdata->version >= | 528 | if ((i2c->wt_len == 1) && (!i2c->stop_hold) && |
| 529 | ID_X1000)) | 529 | (i2c->cdata->version >= ID_X1000)) |
| 530 | data |= X1000_I2C_DC_STOP; | 530 | data |= X1000_I2C_DC_STOP; |
| 531 | jz4780_i2c_writew(i2c, JZ4780_I2C_DC, data); | 531 | jz4780_i2c_writew(i2c, JZ4780_I2C_DC, data); |
| 532 | i2c->wbuf++; | 532 | i2c->wbuf++; |
| @@ -221,6 +221,10 @@ mv64xxx_i2c_hw_init(struct mv64xxx_i2c_data *drv_data) · 220 unmodified lines | |||
| 221 | writel(0, drv_data->reg_base + drv_data->reg_offsets.ext_addr); | 221 | writel(0, drv_data->reg_base + drv_data->reg_offsets.ext_addr); |
| 222 | writel(MV64XXX_I2C_REG_CONTROL_TWSIEN | MV64XXX_I2C_REG_CONTROL_STOP, | 222 | writel(MV64XXX_I2C_REG_CONTROL_TWSIEN | MV64XXX_I2C_REG_CONTROL_STOP, |
| 223 | drv_data->reg_base + drv_data->reg_offsets.control); | 223 | drv_data->reg_base + drv_data->reg_offsets.control); |
| 224 | |||
| 225 | if (drv_data->errata_delay) | ||
| 226 | udelay(5); | ||
| 227 | |||
| 224 | drv_data->state = MV64XXX_I2C_STATE_IDLE; | 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 | default: | 534 | default: |
| 535 | /* | 535 | /* |
| 536 | * N-byte reception: | 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 | * In that way, ACK will be sent as soon as the current byte | 538 | * In that way, ACK will be sent as soon as the current byte |
| 539 | * will be received in the shift register | 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 | static int i2c_init_recovery(struct i2c_adapter *adap) | 378 | static int i2c_init_recovery(struct i2c_adapter *adap) |
| 379 | { | 379 | { |
| 380 | struct i2c_bus_recovery_info *bri = adap->bus_recovery_info; | 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 | if (!bri) | 383 | if (!bri) |
| 384 | return 0; | 384 | return 0; |
| @@ -387,7 +387,8 @@ static int i2c_init_recovery(struct i2c_adapter *adap) · 2 unmodified lines | |||
| 387 | return -EPROBE_DEFER; | 387 | return -EPROBE_DEFER; |
| 388 | 388 | ||
| 389 | if (!bri->recover_bus) { | 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 | goto err; | 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 | return 0; | 416 | return 0; |
| 416 | err: | 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 | adap->bus_recovery_info = NULL; | 419 | adap->bus_recovery_info = NULL; |
| 419 | 420 | ||
| 420 | return -EINVAL; | 421 | return -EINVAL; |
| @@ -266,6 +266,8 @@ config ADI_AXI_ADC · 265 unmodified lines | |||
| 266 | select IIO_BUFFER | 266 | select IIO_BUFFER |
| 267 | select IIO_BUFFER_HW_CONSUMER | 267 | select IIO_BUFFER_HW_CONSUMER |
| 268 | select IIO_BUFFER_DMAENGINE | 268 | select IIO_BUFFER_DMAENGINE |
| 269 | depends on HAS_IOMEM | ||
| 270 | depends on OF | ||
| 269 | help | 271 | help |
| 270 | Say yes here to build support for Analog Devices Generic | 272 | Say yes here to build support for Analog Devices Generic |
| 271 | AXI ADC IP core. The IP core is used for interfacing with | 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 | depends on ARCH_STM32 || COMPILE_TEST | 925 | depends on ARCH_STM32 || COMPILE_TEST |
| 924 | depends on OF | 926 | depends on OF |
| 925 | depends on REGULATOR | 927 | depends on REGULATOR |
| 928 | depends on HAS_IOMEM | ||
| 926 | select IIO_BUFFER | 929 | select IIO_BUFFER |
| 927 | select MFD_STM32_TIMERS | 930 | select MFD_STM32_TIMERS |
| 928 | select IIO_STM32_TIMER_TRIGGER | 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 | return processed; | 918 | return processed; |
| 919 | 919 | ||
| 920 | /* Return millivolt or milliamps or millicentigrades */ | 920 | /* Return millivolt or milliamps or millicentigrades */ |
| 921 | *val = processed * 1000; | 921 | *val = processed; |
| 922 | return IIO_VAL_INT; | 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 | int ret; | 91 | int ret; |
| 92 | int i; | 92 | int i; |
| 93 | int bits_per_word = ad7949_adc->resolution; | 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 | struct spi_message msg; | 95 | struct spi_message msg; |
| 96 | struct spi_transfer tx[] = { | 96 | struct spi_transfer tx[] = { |
| 97 | { | 97 | { |
| @@ -597,7 +597,7 @@ static const struct vadc_channels vadc_chans[] = { · 596 unmodified lines | |||
| 597 | VADC_CHAN_NO_SCALE(P_MUX16_1_3, 1) | 597 | VADC_CHAN_NO_SCALE(P_MUX16_1_3, 1) |
| 598 | 598 | ||
| 599 | VADC_CHAN_NO_SCALE(LR_MUX1_BAT_THERM, 0) | 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 | VADC_CHAN_NO_SCALE(LR_MUX3_XO_THERM, 0) | 601 | VADC_CHAN_NO_SCALE(LR_MUX3_XO_THERM, 0) |
| 602 | VADC_CHAN_NO_SCALE(LR_MUX4_AMUX_THM1, 0) | 602 | VADC_CHAN_NO_SCALE(LR_MUX4_AMUX_THM1, 0) |
| 603 | VADC_CHAN_NO_SCALE(LR_MUX5_AMUX_THM2, 0) | 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 | MPU3050_FIFO_R, | 551 | MPU3050_FIFO_R, |
| 552 | &fifo_values[offset], | 552 | &fifo_values[offset], |
| 553 | toread); | 553 | toread); |
| 554 | if (ret) | ||
| 555 | goto out_trigger_unlock; | ||
| 554 | 556 | ||
| 555 | dev_dbg(mpu3050->dev, | 557 | dev_dbg(mpu3050->dev, |
| 556 | "%04x %04x %04x %04x %04x\n", | 558 | "%04x %04x %04x %04x %04x\n", |
| @@ -15,7 +15,10 @@ · 14 unmodified lines | |||
| 15 | struct hid_humidity_state { | 15 | struct hid_humidity_state { |
| 16 | struct hid_sensor_common common_attributes; | 16 | struct hid_sensor_common common_attributes; |
| 17 | struct hid_sensor_hub_attribute_info humidity_attr; | 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 | int scale_pre_decml; | 22 | int scale_pre_decml; |
| 20 | int scale_post_decml; | 23 | int scale_post_decml; |
| 21 | int scale_precision; | 24 | int scale_precision; |
| @@ -125,9 +128,8 @@ static int humidity_proc_event(struct hid_sensor_hub_device *hsdev, · 103 unmodified lines | |||
| 125 | struct hid_humidity_state *humid_st = iio_priv(indio_dev); | 128 | struct hid_humidity_state *humid_st = iio_priv(indio_dev); |
| 126 | 129 | ||
| 127 | if (atomic_read(&humid_st->common_attributes.data_ready)) | 130 | if (atomic_read(&humid_st->common_attributes.data_ready)) |
| 128 | iio_push_to_buffers_with_timestamp(indio_dev, | 131 | iio_push_to_buffers_with_timestamp(indio_dev, &humid_st->scan, |
| 129 | &humid_st->humidity_data, | 132 | iio_get_time_ns(indio_dev)); |
| 130 | iio_get_time_ns(indio_dev)); | ||
| 131 | 133 | ||
| 132 | return 0; | 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 | switch (usage_id) { | 145 | switch (usage_id) { |
| 144 | case HID_USAGE_SENSOR_ATMOSPHERIC_HUMIDITY: | 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 | return 0; | 149 | return 0; |
| 148 | default: | 150 | default: |
| @@ -462,8 +462,7 @@ static int adis16400_initial_setup(struct iio_dev *indio_dev) · 461 unmodified lines | |||
| 462 | if (ret) | 462 | if (ret) |
| 463 | goto err_ret; | 463 | goto err_ret; |
| 464 | 464 | ||
| 465 | ret = sscanf(indio_dev->name, "adis%u\n", &device_id); | 465 | if (sscanf(indio_dev->name, "adis%u\n", &device_id) != 1) { |
| 466 | if (ret != 1) { | ||
| 467 | ret = -EINVAL; | 466 | ret = -EINVAL; |
| 468 | goto err_ret; | 467 | goto err_ret; |
| 469 | } | 468 | } |
| @@ -23,6 +23,9 @@ struct prox_state { · 22 unmodified lines | |||
| 23 | struct hid_sensor_common common_attributes; | 23 | struct hid_sensor_common common_attributes; |
| 24 | struct hid_sensor_hub_attribute_info prox_attr; | 24 | struct hid_sensor_hub_attribute_info prox_attr; |
| 25 | u32 human_presence; | 25 | u32 human_presence; |
| 26 | int scale_pre_decml; | ||
| 27 | int scale_post_decml; | ||
| 28 | int scale_precision; | ||
| 26 | }; | 29 | }; |
| 27 | 30 | ||
| 28 | /* Channel definitions */ | 31 | /* Channel definitions */ |
| @@ -93,8 +96,9 @@ static int prox_read_raw(struct iio_dev *indio_dev, · 64 unmodified lines | |||
| 93 | ret_type = IIO_VAL_INT; | 96 | ret_type = IIO_VAL_INT; |
| 94 | break; | 97 | break; |
| 95 | case IIO_CHAN_INFO_SCALE: | 98 | case IIO_CHAN_INFO_SCALE: |
| 96 | *val = prox_state->prox_attr.units; | 99 | *val = prox_state->scale_pre_decml; |
| 97 | ret_type = IIO_VAL_INT; | 100 | *val2 = prox_state->scale_post_decml; |
| 101 | ret_type = prox_state->scale_precision; | ||
| 98 | break; | 102 | break; |
| 99 | case IIO_CHAN_INFO_OFFSET: | 103 | case IIO_CHAN_INFO_OFFSET: |
| 100 | *val = hid_sensor_convert_exponent( | 104 | *val = hid_sensor_convert_exponent( |
| @@ -234,6 +238,11 @@ static int prox_parse_report(struct platform_device *pdev, · 133 unmodified lines | |||
| 234 | HID_USAGE_SENSOR_HUMAN_PRESENCE, | 238 | HID_USAGE_SENSOR_HUMAN_PRESENCE, |
| 235 | &st->common_attributes.sensitivity); | 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 | return ret; | 246 | return ret; |
| 238 | } | 247 | } |
| 239 | 248 | ||
| @@ -15,7 +15,10 @@ · 14 unmodified lines | |||
| 15 | struct temperature_state { | 15 | struct temperature_state { |
| 16 | struct hid_sensor_common common_attributes; | 16 | struct hid_sensor_common common_attributes; |
| 17 | struct hid_sensor_hub_attribute_info temperature_attr; | 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 | int scale_pre_decml; | 22 | int scale_pre_decml; |
| 20 | int scale_post_decml; | 23 | int scale_post_decml; |
| 21 | int scale_precision; | 24 | int scale_precision; |
| @@ -32,7 +35,7 @@ static const struct iio_chan_spec temperature_channels[] = { · 10 unmodified lines | |||
| 32 | BIT(IIO_CHAN_INFO_SAMP_FREQ) | | 35 | BIT(IIO_CHAN_INFO_SAMP_FREQ) | |
| 33 | BIT(IIO_CHAN_INFO_HYSTERESIS), | 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 | /* Adjust channel real bits based on report descriptor */ | 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 | struct temperature_state *temp_st = iio_priv(indio_dev); | 126 | struct temperature_state *temp_st = iio_priv(indio_dev); |
| 124 | 127 | ||
| 125 | if (atomic_read(&temp_st->common_attributes.data_ready)) | 128 | if (atomic_read(&temp_st->common_attributes.data_ready)) |
| 126 | iio_push_to_buffers_with_timestamp(indio_dev, | 129 | iio_push_to_buffers_with_timestamp(indio_dev, &temp_st->scan, |
| 127 | &temp_st->temperature_data, | 130 | iio_get_time_ns(indio_dev)); |
| 128 | iio_get_time_ns(indio_dev)); | ||
| 129 | 131 | ||
| 130 | return 0; | 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 | switch (usage_id) { | 143 | switch (usage_id) { |
| 142 | case HID_USAGE_SENSOR_DATA_ENVIRONMENTAL_TEMPERATURE: | 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 | return 0; | 146 | return 0; |
| 145 | default: | 147 | default: |
| 146 | return -EINVAL; | 148 | return -EINVAL; |
| @@ -76,7 +76,9 @@ static struct workqueue_struct *addr_wq; · 75 unmodified lines | |||
| 76 | 76 | ||
| 77 | static const struct nla_policy ib_nl_addr_policy[LS_NLA_TYPE_MAX] = { | 77 | static const struct nla_policy ib_nl_addr_policy[LS_NLA_TYPE_MAX] = { |
| 78 | [LS_NLA_TYPE_DGID] = {.type = NLA_BINARY, | 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 | static inline bool ib_nl_is_good_ip_resp(const struct nlmsghdr *nlh) | 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 | ep->com.local_addr.ss_family == AF_INET) { | 3610 | ep->com.local_addr.ss_family == AF_INET) { |
| 3611 | err = cxgb4_remove_server_filter( | 3611 | err = cxgb4_remove_server_filter( |
| 3612 | ep->com.dev->rdev.lldi.ports[0], ep->stid, | 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 | } else { | 3614 | } else { |
| 3615 | struct sockaddr_in6 *sin6; | 3615 | struct sockaddr_in6 *sin6; |
| 3616 | c4iw_init_wr_wait(ep->com.wr_waitp); | 3616 | c4iw_init_wr_wait(ep->com.wr_waitp); |
| 3617 | err = cxgb4_remove_server( | 3617 | err = cxgb4_remove_server( |
| 3618 | ep->com.dev->rdev.lldi.ports[0], ep->stid, | 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 | if (err) | 3621 | if (err) |
| 3621 | goto done; | 3622 | goto done; |
| 3622 | err = c4iw_wait_for_reply(&ep->com.dev->rdev, ep->com.wr_waitp, | 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 | int hfi1_dev_affinity_init(struct hfi1_devdata *dd) | 633 | int hfi1_dev_affinity_init(struct hfi1_devdata *dd) |
| 634 | { | 634 | { |
| 635 | int node = pcibus_to_node(dd->pcidev->bus); | ||
| 636 | struct hfi1_affinity_node *entry; | 635 | struct hfi1_affinity_node *entry; |
| 637 | const struct cpumask *local_mask; | 636 | const struct cpumask *local_mask; |
| 638 | int curr_cpu, possible, i, ret; | 637 | int curr_cpu, possible, i, ret; |
| 639 | bool new_entry = false; | 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 | local_mask = cpumask_of_node(dd->node); | 640 | local_mask = cpumask_of_node(dd->node); |
| 652 | if (cpumask_first(local_mask) >= nr_cpu_ids) | 641 | if (cpumask_first(local_mask) >= nr_cpu_ids) |
| 653 | local_mask = topology_core_cpumask(0); | 642 | local_mask = topology_core_cpumask(0); |
| @@ -660,7 +649,7 @@ int hfi1_dev_affinity_init(struct hfi1_devdata *dd) · 6 unmodified lines | |||
| 660 | * create an entry in the global affinity structure and initialize it. | 649 | * create an entry in the global affinity structure and initialize it. |
| 661 | */ | 650 | */ |
| 662 | if (!entry) { | 651 | if (!entry) { |
| 663 | entry = node_affinity_allocate(node); | 652 | entry = node_affinity_allocate(dd->node); |
| 664 | if (!entry) { | 653 | if (!entry) { |
| 665 | dd_dev_err(dd, | 654 | dd_dev_err(dd, |
| 666 | "Unable to allocate global affinity node\n"); | 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 | if (new_entry) | 740 | if (new_entry) |
| 752 | node_affinity_add_tail(entry); | 741 | node_affinity_add_tail(entry); |
| 753 | 742 | ||
| 743 | dd->affinity_entry = entry; | ||
| 754 | mutex_unlock(&node_affinity.lock); | 744 | mutex_unlock(&node_affinity.lock); |
| 755 | 745 | ||
| 756 | return 0; | 746 | return 0; |
| @@ -766,10 +756,9 @@ void hfi1_dev_affinity_clean_up(struct hfi1_devdata *dd) · 9 unmodified lines | |||
| 766 | { | 756 | { |
| 767 | struct hfi1_affinity_node *entry; | 757 | struct hfi1_affinity_node *entry; |
| 768 | 758 | ||
| 769 | if (dd->node < 0) | ||
| 770 | return; | ||
| 771 | |||
| 772 | mutex_lock(&node_affinity.lock); | 759 | mutex_lock(&node_affinity.lock); |
| 760 | if (!dd->affinity_entry) | ||
| 761 | goto unlock; | ||
| 773 | entry = node_affinity_lookup(dd->node); | 762 | entry = node_affinity_lookup(dd->node); |
| 774 | if (!entry) | 763 | if (!entry) |
| 775 | goto unlock; | 764 | goto unlock; |
| @@ -780,8 +769,8 @@ void hfi1_dev_affinity_clean_up(struct hfi1_devdata *dd) · 4 unmodified lines | |||
| 780 | */ | 769 | */ |
| 781 | _dev_comp_vect_cpu_mask_clean_up(dd, entry); | 770 | _dev_comp_vect_cpu_mask_clean_up(dd, entry); |
| 782 | unlock: | 771 | unlock: |
| 772 | dd->affinity_entry = NULL; | ||
| 783 | mutex_unlock(&node_affinity.lock); | 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 | spinlock_t irq_src_lock; | 1409 | spinlock_t irq_src_lock; |
| 1410 | int vnic_num_vports; | 1410 | int vnic_num_vports; |
| 1411 | struct net_device *dummy_netdev; | 1411 | struct net_device *dummy_netdev; |
| 1412 | struct hfi1_affinity_node *affinity_entry; | ||
| 1412 | 1413 | ||
| 1413 | /* Keeps track of IPoIB RSM rule users */ | 1414 | /* Keeps track of IPoIB RSM rule users */ |
| 1414 | atomic_t ipoib_rsm_usr_num; | 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 | dd->pport = (struct hfi1_pportdata *)(dd + 1); | 1277 | dd->pport = (struct hfi1_pportdata *)(dd + 1); |
| 1278 | dd->pcidev = pdev; | 1278 | dd->pcidev = pdev; |
| 1279 | pci_set_drvdata(pdev, dd); | 1279 | pci_set_drvdata(pdev, dd); |
| 1280 | dd->node = NUMA_NO_NODE; | ||
| 1281 | 1280 | ||
| 1282 | ret = xa_alloc_irq(&hfi1_dev_table, &dd->unit, dd, xa_limit_32b, | 1281 | ret = xa_alloc_irq(&hfi1_dev_table, &dd->unit, dd, xa_limit_32b, |
| 1283 | GFP_KERNEL); | 1282 | GFP_KERNEL); |
| @@ -1287,6 +1286,15 @@ static struct hfi1_devdata *hfi1_alloc_devdata(struct pci_dev *pdev, · 3 unmodified lines | |||
| 1287 | goto bail; | 1286 | goto bail; |
| 1288 | } | 1287 | } |
| 1289 | rvt_set_ibdev_name(&dd->verbs_dev.rdi, "%s_%d", class_name(), dd->unit); | 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 | * Initialize all locks for the device. This needs to be as early as | 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 | return 0; | 173 | return 0; |
| 174 | } | 174 | } |
| 175 | 175 | ||
| 176 | cpumask_and(node_cpu_mask, cpu_mask, | 176 | cpumask_and(node_cpu_mask, cpu_mask, cpumask_of_node(dd->node)); |
| 177 | cpumask_of_node(pcibus_to_node(dd->pcidev->bus))); | ||
| 178 | 177 | ||
| 179 | available_cpus = cpumask_weight(node_cpu_mask); | 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 | upper_32_bits(dma)); | 1194 | upper_32_bits(dma)); |
| 1195 | roce_write(hr_dev, ROCEE_TX_CMQ_DEPTH_REG, | 1195 | roce_write(hr_dev, ROCEE_TX_CMQ_DEPTH_REG, |
| 1196 | (u32)ring->desc_num >> HNS_ROCE_CMQ_DESC_NUM_S); | 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 | roce_write(hr_dev, ROCEE_TX_CMQ_TAIL_REG, 0); | 1199 | roce_write(hr_dev, ROCEE_TX_CMQ_TAIL_REG, 0); |
| 1200 | roce_write(hr_dev, ROCEE_TX_CMQ_HEAD_REG, 0); | ||
| 1199 | } else { | 1201 | } else { |
| 1200 | roce_write(hr_dev, ROCEE_RX_CMQ_BASEADDR_L_REG, (u32)dma); | 1202 | roce_write(hr_dev, ROCEE_RX_CMQ_BASEADDR_L_REG, (u32)dma); |
| 1201 | roce_write(hr_dev, ROCEE_RX_CMQ_BASEADDR_H_REG, | 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 | case MLX5_CMD_OP_CREATE_MKEY: | 1116 | case MLX5_CMD_OP_CREATE_MKEY: |
| 1117 | MLX5_SET(destroy_mkey_in, din, opcode, | 1117 | MLX5_SET(destroy_mkey_in, din, opcode, |
| 1118 | MLX5_CMD_OP_DESTROY_MKEY); | 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 | break; | 1120 | break; |
| 1121 | case MLX5_CMD_OP_CREATE_CQ: | 1121 | case MLX5_CMD_OP_CREATE_CQ: |
| 1122 | MLX5_SET(destroy_cq_in, din, opcode, MLX5_CMD_OP_DESTROY_CQ); | 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 | qpc = MLX5_ADDR_OF(create_qp_in, *in, qpc); | 1079 | qpc = MLX5_ADDR_OF(create_qp_in, *in, qpc); |
| 1080 | MLX5_SET(qpc, qpc, uar_page, uar_index); | 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 | MLX5_SET(qpc, qpc, log_page_size, qp->buf.page_shift - MLX5_ADAPTER_PAGE_SHIFT); | 1082 | MLX5_SET(qpc, qpc, log_page_size, qp->buf.page_shift - MLX5_ADAPTER_PAGE_SHIFT); |
| 1083 | 1083 | ||
| 1084 | /* Set "fast registration enabled" for all kernel QPs */ | 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 | return MLX5_RQC_TIMESTAMP_FORMAT_FREE_RUNNING; | 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 | static int get_sq_ts_format(struct mlx5_ib_dev *dev, struct mlx5_ib_cq *send_cq) | 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 | return MLX5_SQC_TIMESTAMP_FORMAT_FREE_RUNNING; | 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 | static int get_qp_ts_format(struct mlx5_ib_dev *dev, struct mlx5_ib_cq *send_cq, | 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 | MLX5_QP_TIMESTAMP_FORMAT_CAP_FREE_RUNNING || | 1219 | MLX5_QP_TIMESTAMP_FORMAT_CAP_FREE_RUNNING || |
| 1218 | MLX5_CAP_ROCE(dev->mdev, qp_ts_format) == | 1220 | MLX5_CAP_ROCE(dev->mdev, qp_ts_format) == |
| 1219 | MLX5_QP_TIMESTAMP_FORMAT_CAP_FREE_RUNNING_AND_REAL_TIME; | 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 | if (recv_cq && | 1225 | if (recv_cq && |
| 1223 | recv_cq->create_flags & IB_UVERBS_CQ_FLAGS_TIMESTAMP_COMPLETION) | 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 | if (qp->flags & IB_QP_CREATE_MANAGED_RECV) | 1933 | if (qp->flags & IB_QP_CREATE_MANAGED_RECV) |
| 1931 | MLX5_SET(qpc, qpc, cd_slave_receive, 1); | 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 | MLX5_SET(qpc, qpc, rq_type, MLX5_SRQ_RQ); | 1937 | MLX5_SET(qpc, qpc, rq_type, MLX5_SRQ_RQ); |
| 1934 | MLX5_SET(qpc, qpc, no_sq, 1); | 1938 | MLX5_SET(qpc, qpc, no_sq, 1); |
| 1935 | MLX5_SET(qpc, qpc, cqn_rcv, to_mcq(devr->c0)->mcq.cqn); | 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 | struct mlx5_ib_dev *dev; | 4877 | struct mlx5_ib_dev *dev; |
| 4874 | int has_net_offloads; | 4878 | int has_net_offloads; |
| 4875 | __be64 *rq_pas0; | 4879 | __be64 *rq_pas0; |
| 4880 | int ts_format; | ||
| 4876 | void *in; | 4881 | void *in; |
| 4877 | void *rqc; | 4882 | void *rqc; |
| 4878 | void *wq; | 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 | dev = to_mdev(pd->device); | 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 | inlen = MLX5_ST_SZ_BYTES(create_rq_in) + sizeof(u64) * rwq->rq_num_pas; | 4893 | inlen = MLX5_ST_SZ_BYTES(create_rq_in) + sizeof(u64) * rwq->rq_num_pas; |
| 4885 | in = kvzalloc(inlen, GFP_KERNEL); | 4894 | in = kvzalloc(inlen, GFP_KERNEL); |
| 4886 | if (!in) | 4895 | if (!in) |
| @@ -4890,6 +4899,7 @@ static int create_rq(struct mlx5_ib_rwq *rwq, struct ib_pd *pd, · 3 unmodified lines | |||
| 4890 | rqc = MLX5_ADDR_OF(create_rq_in, in, ctx); | 4899 | rqc = MLX5_ADDR_OF(create_rq_in, in, ctx); |
| 4891 | MLX5_SET(rqc, rqc, mem_rq_type, | 4900 | MLX5_SET(rqc, rqc, mem_rq_type, |
| 4892 | MLX5_RQC_MEM_RQ_TYPE_MEMORY_RQ_INLINE); | 4901 | MLX5_RQC_MEM_RQ_TYPE_MEMORY_RQ_INLINE); |
| 4902 | MLX5_SET(rqc, rqc, ts_format, ts_format); | ||
| 4893 | MLX5_SET(rqc, rqc, user_index, rwq->user_index); | 4903 | MLX5_SET(rqc, rqc, user_index, rwq->user_index); |
| 4894 | MLX5_SET(rqc, rqc, cqn, to_mcq(init_attr->cq)->mcq.cqn); | 4904 | MLX5_SET(rqc, rqc, cqn, to_mcq(init_attr->cq)->mcq.cqn); |
| 4895 | MLX5_SET(rqc, rqc, state, MLX5_RQC_STATE_RST); | 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 | * TGT QP isn't associated with RQ/SQ | 1244 | * TGT QP isn't associated with RQ/SQ |
| 1245 | */ | 1245 | */ |
| 1246 | if ((attrs->qp_type != IB_QPT_GSI) && (dev->gsi_qp_created) && | 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 | struct qedr_cq *send_cq = get_qedr_cq(attrs->send_cq); | 1249 | struct qedr_cq *send_cq = get_qedr_cq(attrs->send_cq); |
| 1249 | struct qedr_cq *recv_cq = get_qedr_cq(attrs->recv_cq); | 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 | /* Now it is safe to iterate over all paths without locks */ | 2721 | /* Now it is safe to iterate over all paths without locks */ |
| 2722 | list_for_each_entry_safe(sess, tmp, &clt->paths_list, s.entry) { | 2722 | list_for_each_entry_safe(sess, tmp, &clt->paths_list, s.entry) { |
| 2723 | rtrs_clt_destroy_sess_files(sess, NULL); | ||
| 2724 | rtrs_clt_close_conns(sess, true); | 2723 | rtrs_clt_close_conns(sess, true); |
| 2724 | rtrs_clt_destroy_sess_files(sess, NULL); | ||
| 2725 | kobject_put(&sess->kobj); | 2725 | kobject_put(&sess->kobj); |
| 2726 | } | 2726 | } |
| 2727 | free_clt(clt); | 2727 | free_clt(clt); |
| @@ -26,7 +26,6 @@ · 25 unmodified lines | |||
| 26 | 26 | ||
| 27 | MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>"); | 27 | MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>"); |
| 28 | MODULE_DESCRIPTION("Joystick device interfaces"); | 28 | MODULE_DESCRIPTION("Joystick device interfaces"); |
| 29 | MODULE_SUPPORTED_DEVICE("input/js"); | ||
| 30 | MODULE_LICENSE("GPL"); | 29 | MODULE_LICENSE("GPL"); |
| 31 | 30 | ||
| 32 | #define JOYDEV_MINOR_BASE 0 | 31 | #define JOYDEV_MINOR_BASE 0 |
| @@ -252,8 +252,8 @@ static int __init n64joy_probe(struct platform_device *pdev) · 251 unmodified lines | |||
| 252 | mutex_init(&priv->n64joy_mutex); | 252 | mutex_init(&priv->n64joy_mutex); |
| 253 | 253 | ||
| 254 | priv->reg_base = devm_platform_ioremap_resource(pdev, 0); | 254 | priv->reg_base = devm_platform_ioremap_resource(pdev, 0); |
| 255 | if (!priv->reg_base) { | 255 | if (IS_ERR(priv->reg_base)) { |
| 256 | err = -EINVAL; | 256 | err = PTR_ERR(priv->reg_base); |
| 257 | goto fail; | 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 | return IRQ_HANDLED; | 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 | unsigned long val = 0, cycles_per_us, delay_cycles, row_delay_cycles; | 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 | cycles_per_us = (clk_get_rate(keypad->clk) / 1000000); | 106 | cycles_per_us = (clk_get_rate(keypad->clk) / 1000000); |
| 101 | if (cycles_per_us == 0) | 107 | if (cycles_per_us == 0) |
| @@ -121,30 +127,6 @@ static int nspire_keypad_chip_init(struct nspire_keypad *keypad) · 19 unmodified lines | |||
| 121 | keypad->int_mask = 1 << 1; | 127 | keypad->int_mask = 1 << 1; |
| 122 | writel(keypad->int_mask, keypad->reg_base + KEYPAD_INTMSK); | 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 | return 0; | 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 | struct nspire_keypad *keypad = input_get_drvdata(input); | 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 | clk_disable_unprepare(keypad->clk); | 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 | return -ENOMEM; | 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 | input_set_drvdata(input, keypad); | 219 | input_set_drvdata(input, keypad); |
| 214 | 220 | ||
| 215 | input->id.bustype = BUS_HOST; | 221 | input->id.bustype = BUS_HOST; |
| @@ -588,6 +588,7 @@ static const struct dmi_system_id i8042_dmi_noselftest_table[] = { · 587 unmodified lines | |||
| 588 | DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), | 588 | DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), |
| 589 | DMI_MATCH(DMI_CHASSIS_TYPE, "10"), /* Notebook */ | 589 | DMI_MATCH(DMI_CHASSIS_TYPE, "10"), /* Notebook */ |
| 590 | }, | 590 | }, |
| 591 | }, { | ||
| 591 | .matches = { | 592 | .matches = { |
| 592 | DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), | 593 | DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), |
| 593 | DMI_MATCH(DMI_CHASSIS_TYPE, "31"), /* Convertible Notebook */ | 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 | touchscreen_parse_properties(ts->input, true, &ts->prop); | 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 | /* calculate resolution from size */ | 1445 | /* calculate resolution from size */ |
| 1446 | ts->x_res = DIV_ROUND_CLOSEST(ts->prop.max_x, ts->phy_x); | 1446 | ts->x_res = DIV_ROUND_CLOSEST(ts->prop.max_x, ts->phy_x); |
| 1447 | ts->y_res = DIV_ROUND_CLOSEST(ts->prop.max_y, ts->phy_y); | 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 | input_abs_set_res(ts->input, ABS_MT_POSITION_X, ts->x_res); | 1450 | input_abs_set_res(ts->input, ABS_MT_POSITION_X, ts->x_res); |
| 1451 | input_abs_set_res(ts->input, ABS_MT_POSITION_Y, ts->y_res); | 1451 | input_abs_set_res(ts->input, ABS_MT_POSITION_Y, ts->y_res); |
| 1452 | if (ts->major_res > 0) | 1452 | input_abs_set_res(ts->input, ABS_MT_TOUCH_MAJOR, ts->major_res); |
| 1453 | input_abs_set_res(ts->input, ABS_MT_TOUCH_MAJOR, ts->major_res); | ||
| 1454 | 1453 | ||
| 1455 | error = input_mt_init_slots(ts->input, MAX_CONTACT_NUM, | 1454 | error = input_mt_init_slots(ts->input, MAX_CONTACT_NUM, |
| 1456 | INPUT_MT_DIRECT | INPUT_MT_DROP_UNUSED); | 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 | u8 major = event[4]; | 145 | u8 major = event[4]; |
| 146 | u8 minor = event[5]; | 146 | u8 minor = event[5]; |
| 147 | u8 z = event[6] & S6SY761_MASK_Z; | 147 | u8 z = event[6] & S6SY761_MASK_Z; |
| 148 | u16 x = (event[1] << 3) | ((event[3] & S6SY761_MASK_X) >> 4); | 148 | u16 x = (event[1] << 4) | ((event[3] & S6SY761_MASK_X) >> 4); |
| 149 | u16 y = (event[2] << 3) | (event[3] & S6SY761_MASK_Y); | 149 | u16 y = (event[2] << 4) | (event[3] & S6SY761_MASK_Y); |
| 150 | 150 | ||
| 151 | input_mt_slot(sdata->input, tid); | 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 | EXPORT_SYMBOL_GPL(icc_bulk_put); | 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 | * @num_paths: the number of icc_bulk_data | 57 | * @num_paths: the number of icc_bulk_data |
| 58 | * @paths: the icc_bulk_data table containing the paths and bandwidth | 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 | GFP_KERNEL); | 942 | GFP_KERNEL); |
| 943 | if (new) | 943 | if (new) |
| 944 | src->links = new; | 944 | src->links = new; |
| 945 | else | ||
| 946 | ret = -ENOMEM; | ||
| 945 | 947 | ||
| 946 | out: | 948 | out: |
| 947 | mutex_unlock(&icc_lock); | 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 | DEFINE_QNODE(mas_pcnoc_sdcc_2, MSM8939_MASTER_SDCC_2, 8, -1, -1, MSM8939_PNOC_INT_1); | 131 | DEFINE_QNODE(mas_pcnoc_sdcc_2, MSM8939_MASTER_SDCC_2, 8, -1, -1, MSM8939_PNOC_INT_1); |
| 132 | DEFINE_QNODE(mas_qdss_bam, MSM8939_MASTER_QDSS_BAM, 8, -1, -1, MSM8939_SNOC_QDSS_INT); | 132 | DEFINE_QNODE(mas_qdss_bam, MSM8939_MASTER_QDSS_BAM, 8, -1, -1, MSM8939_SNOC_QDSS_INT); |
| 133 | DEFINE_QNODE(mas_qdss_etr, MSM8939_MASTER_QDSS_ETR, 8, -1, -1, MSM8939_SNOC_QDSS_INT); | 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 | DEFINE_QNODE(mas_spdm, MSM8939_MASTER_SPDM, 4, -1, -1, MSM8939_PNOC_MAS_0); | 135 | DEFINE_QNODE(mas_spdm, MSM8939_MASTER_SPDM, 4, -1, -1, MSM8939_PNOC_MAS_0); |
| 136 | DEFINE_QNODE(mas_tcu0, MSM8939_MASTER_TCU0, 16, -1, -1, MSM8939_SLAVE_EBI_CH0, MSM8939_BIMC_SNOC_MAS, MSM8939_SLAVE_AMPSS_L2); | 136 | DEFINE_QNODE(mas_tcu0, MSM8939_MASTER_TCU0, 16, -1, -1, MSM8939_SLAVE_EBI_CH0, MSM8939_BIMC_SNOC_MAS, MSM8939_SLAVE_AMPSS_L2); |
| 137 | DEFINE_QNODE(mas_usb_hs1, MSM8939_MASTER_USB_HS1, 4, -1, -1, MSM8939_PNOC_MAS_1); | 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 | DEFINE_QNODE(pcnoc_snoc_slv, MSM8939_PNOC_SNOC_SLV, 8, -1, 45, MSM8939_SNOC_INT_0, MSM8939_SNOC_INT_BIMC, MSM8939_SNOC_INT_1); | 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 | DEFINE_QNODE(qdss_int, MSM8939_SNOC_QDSS_INT, 8, -1, -1, MSM8939_SNOC_INT_0, MSM8939_SNOC_INT_BIMC); | 157 | DEFINE_QNODE(qdss_int, MSM8939_SNOC_QDSS_INT, 8, -1, -1, MSM8939_SNOC_INT_0, MSM8939_SNOC_INT_BIMC); |
| 158 | DEFINE_QNODE(slv_apps_l2, MSM8939_SLAVE_AMPSS_L2, 16, -1, -1, 0); | 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 | DEFINE_QNODE(slv_audio, MSM8939_SLAVE_LPASS, 4, -1, -1, 0); | 160 | DEFINE_QNODE(slv_audio, MSM8939_SLAVE_LPASS, 4, -1, -1, 0); |
| 161 | DEFINE_QNODE(slv_bimc_cfg, MSM8939_SLAVE_BIMC_CFG, 4, -1, -1, 0); | 161 | DEFINE_QNODE(slv_bimc_cfg, MSM8939_SLAVE_BIMC_CFG, 4, -1, -1, 0); |
| 162 | DEFINE_QNODE(slv_blsp_1, MSM8939_SLAVE_BLSP_1, 4, -1, -1, 0); | 162 | DEFINE_QNODE(slv_blsp_1, MSM8939_SLAVE_BLSP_1, 4, -1, -1, 0); |
| 163 | DEFINE_QNODE(slv_boot_rom, MSM8939_SLAVE_BOOT_ROM, 4, -1, -1, 0); | 163 | DEFINE_QNODE(slv_boot_rom, MSM8939_SLAVE_BOOT_ROM, 4, -1, -1, 0); |
| 164 | DEFINE_QNODE(slv_camera_cfg, MSM8939_SLAVE_CAMERA_CFG, 4, -1, -1, 0); | 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); | 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, 107, 0); | 166 | DEFINE_QNODE(slv_cats_1, MSM8939_SLAVE_OCMEM_64, 8, -1, -1, 0); |
| 167 | DEFINE_QNODE(slv_clk_ctl, MSM8939_SLAVE_CLK_CTL, 4, -1, -1, 0); | 167 | DEFINE_QNODE(slv_clk_ctl, MSM8939_SLAVE_CLK_CTL, 4, -1, -1, 0); |
| 168 | DEFINE_QNODE(slv_crypto_0_cfg, MSM8939_SLAVE_CRYPTO_0_CFG, 4, -1, -1, 0); | 168 | DEFINE_QNODE(slv_crypto_0_cfg, MSM8939_SLAVE_CRYPTO_0_CFG, 4, -1, -1, 0); |
| 169 | DEFINE_QNODE(slv_dehr_cfg, MSM8939_SLAVE_DEHR_CFG, 4, -1, -1, 0); | 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 | DEFINE_QNODE(slv_security, MSM8939_SLAVE_SECURITY, 4, -1, -1, 0); | 187 | DEFINE_QNODE(slv_security, MSM8939_SLAVE_SECURITY, 4, -1, -1, 0); |
| 188 | DEFINE_QNODE(slv_snoc_cfg, MSM8939_SLAVE_SNOC_CFG, 4, -1, -1, 0); | 188 | DEFINE_QNODE(slv_snoc_cfg, MSM8939_SLAVE_SNOC_CFG, 4, -1, -1, 0); |
| 189 | DEFINE_QNODE(slv_spdm, MSM8939_SLAVE_SPDM, 4, -1, -1, 0); | 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 | DEFINE_QNODE(slv_tcsr, MSM8939_SLAVE_TCSR, 4, -1, -1, 0); | 191 | DEFINE_QNODE(slv_tcsr, MSM8939_SLAVE_TCSR, 4, -1, -1, 0); |
| 192 | DEFINE_QNODE(slv_tlmm, MSM8939_SLAVE_TLMM, 4, -1, -1, 0); | 192 | DEFINE_QNODE(slv_tlmm, MSM8939_SLAVE_TLMM, 4, -1, -1, 0); |
| 193 | DEFINE_QNODE(slv_usb_hs1, MSM8939_SLAVE_USB_HS1, 4, -1, -1, 0); | 193 | DEFINE_QNODE(slv_usb_hs1, MSM8939_SLAVE_USB_HS1, 4, -1, -1, 0); |
| 194 | DEFINE_QNODE(slv_usb_hs2, MSM8939_SLAVE_USB_HS2, 4, -1, -1, 0); | 194 | DEFINE_QNODE(slv_usb_hs2, MSM8939_SLAVE_USB_HS2, 4, -1, -1, 0); |
| 195 | DEFINE_QNODE(slv_venus_cfg, MSM8939_SLAVE_VENUS_CFG, 4, -1, -1, 0); | 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); | 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, 24, MSM8939_SLAVE_EBI_CH0); | 197 | DEFINE_QNODE(snoc_bimc_0_slv, MSM8939_SNOC_BIMC_0_SLV, 16, -1, -1, MSM8939_SLAVE_EBI_CH0); |
| 198 | DEFINE_QNODE(snoc_bimc_1_mas, MSM8939_SNOC_BIMC_1_MAS, 16, 76, -1, MSM8939_SNOC_BIMC_1_SLV); | 198 | DEFINE_QNODE(snoc_bimc_1_mas, MSM8939_SNOC_BIMC_1_MAS, 16, 76, -1, MSM8939_SNOC_BIMC_1_SLV); |
| 199 | DEFINE_QNODE(snoc_bimc_1_slv, MSM8939_SNOC_BIMC_1_SLV, 16, -1, 104, MSM8939_SLAVE_EBI_CH0); | 199 | DEFINE_QNODE(snoc_bimc_1_slv, MSM8939_SNOC_BIMC_1_SLV, 16, -1, 104, MSM8939_SLAVE_EBI_CH0); |
| 200 | DEFINE_QNODE(snoc_bimc_2_mas, MSM8939_SNOC_BIMC_2_MAS, 16, -1, -1, MSM8939_SNOC_BIMC_2_SLV); | 200 | DEFINE_QNODE(snoc_bimc_2_mas, MSM8939_SNOC_BIMC_2_MAS, 16, -1, -1, MSM8939_SNOC_BIMC_2_SLV); |
| 201 | DEFINE_QNODE(snoc_bimc_2_slv, MSM8939_SNOC_BIMC_2_SLV, 16, -1, -1, MSM8939_SLAVE_EBI_CH0); | 201 | DEFINE_QNODE(snoc_bimc_2_slv, MSM8939_SNOC_BIMC_2_SLV, 16, -1, -1, MSM8939_SLAVE_EBI_CH0); |
| 202 | DEFINE_QNODE(snoc_int_0, MSM8939_SNOC_INT_0, 8, 99, 130, MSM8939_SLAVE_QDSS_STM, MSM8939_SLAVE_IMEM, MSM8939_SNOC_PNOC_MAS); | 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 | DEFINE_QNODE(snoc_int_bimc, MSM8939_SNOC_INT_BIMC, 8, 101, 132, MSM8939_SNOC_BIMC_1_MAS); | 204 | DEFINE_QNODE(snoc_int_bimc, MSM8939_SNOC_INT_BIMC, 8, 101, 132, MSM8939_SNOC_BIMC_1_MAS); |
| 205 | DEFINE_QNODE(snoc_pcnoc_mas, MSM8939_SNOC_PNOC_MAS, 8, -1, -1, MSM8939_SNOC_PNOC_SLV); | 205 | DEFINE_QNODE(snoc_pcnoc_mas, MSM8939_SNOC_PNOC_MAS, 8, -1, -1, MSM8939_SNOC_PNOC_SLV); |
| 206 | DEFINE_QNODE(snoc_pcnoc_slv, MSM8939_SNOC_PNOC_SLV, 8, -1, -1, MSM8939_PNOC_INT_0); | 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 | struct acpi_table_header *ivrs_base; | 2714 | struct acpi_table_header *ivrs_base; |
| 2715 | int i, remap_cache_sz, ret; | 2715 | int i, remap_cache_sz, ret; |
| 2716 | acpi_status status; | 2716 | acpi_status status; |
| 2717 | u32 pci_id; | ||
| 2718 | 2717 | ||
| 2719 | if (!amd_iommu_detected) | 2718 | if (!amd_iommu_detected) |
| 2720 | return -ENODEV; | 2719 | return -ENODEV; |
| @@ -2804,16 +2803,6 @@ static int __init early_amd_iommu_init(void) · 83 unmodified lines | |||
| 2804 | if (ret) | 2803 | if (ret) |
| 2805 | goto out; | 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 | /* Disable any previously enabled IOMMUs */ | 2806 | /* Disable any previously enabled IOMMUs */ |
| 2818 | if (!is_kdump_kernel() || amd_iommu_disabled) | 2807 | if (!is_kdump_kernel() || amd_iommu_disabled) |
| 2819 | disable_iommus(); | 2808 | disable_iommus(); |
| @@ -2880,6 +2869,7 @@ static bool detect_ivrs(void) · 60 unmodified lines | |||
| 2880 | { | 2869 | { |
| 2881 | struct acpi_table_header *ivrs_base; | 2870 | struct acpi_table_header *ivrs_base; |
| 2882 | acpi_status status; | 2871 | acpi_status status; |
| 2872 | int i; | ||
| 2883 | 2873 | ||
| 2884 | status = acpi_get_table("IVRS", 0, &ivrs_base); | 2874 | status = acpi_get_table("IVRS", 0, &ivrs_base); |
| 2885 | if (status == AE_NOT_FOUND) | 2875 | if (status == AE_NOT_FOUND) |
| @@ -2892,6 +2882,17 @@ static bool detect_ivrs(void) · 6 unmodified lines | |||
| 2892 | 2882 | ||
| 2893 | acpi_put_table(ivrs_base); | 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 | /* Make sure ACS will be enabled during PCI probe */ | 2896 | /* Make sure ACS will be enabled during PCI probe */ |
| 2896 | pci_request_acs(); | 2897 | pci_request_acs(); |
| 2897 | 2898 | ||
| @@ -2918,12 +2919,12 @@ static int __init state_next(void) · 20 unmodified lines | |||
| 2918 | } | 2919 | } |
| 2919 | break; | 2920 | break; |
| 2920 | case IOMMU_IVRS_DETECTED: | 2921 | case IOMMU_IVRS_DETECTED: |
| 2921 | ret = early_amd_iommu_init(); | 2922 | if (amd_iommu_disabled) { |
| 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"); | ||
| 2925 | init_state = IOMMU_CMDLINE_DISABLED; | 2923 | init_state = IOMMU_CMDLINE_DISABLED; |
| 2926 | ret = -EINVAL; | 2924 | ret = -EINVAL; |
| 2925 | } else { | ||
| 2926 | ret = early_amd_iommu_init(); | ||
| 2927 | init_state = ret ? IOMMU_INIT_ERROR : IOMMU_ACPI_FINISHED; | ||
| 2927 | } | 2928 | } |
| 2928 | break; | 2929 | break; |
| 2929 | case IOMMU_ACPI_FINISHED: | 2930 | case IOMMU_ACPI_FINISHED: |
| @@ -3001,8 +3002,11 @@ int __init amd_iommu_prepare(void) · 71 unmodified lines | |||
| 3001 | amd_iommu_irq_remap = true; | 3002 | amd_iommu_irq_remap = true; |
| 3002 | 3003 | ||
| 3003 | ret = iommu_go_to_state(IOMMU_ACPI_FINISHED); | 3004 | ret = iommu_go_to_state(IOMMU_ACPI_FINISHED); |
| 3004 | if (ret) | 3005 | if (ret) { |
| 3006 | amd_iommu_irq_remap = false; | ||
| 3005 | return ret; | 3007 | return ret; |
| 3008 | } | ||
| 3009 | |||
| 3006 | return amd_iommu_irq_remap ? 0 : -ENODEV; | 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 | smmu = tegra_smmu_find(args.np); | 849 | smmu = tegra_smmu_find(args.np); |
| 850 | if (smmu) { | 850 | if (smmu) { |
| 851 | err = tegra_smmu_configure(smmu, dev, &args); | 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 | return ERR_PTR(err); | 855 | return ERR_PTR(err); |
| 856 | 856 | } | |
| 857 | break; | ||
| 858 | } | 857 | } |
| 859 | 858 | ||
| 860 | of_node_put(args.np); | 859 | of_node_put(args.np); |
| @@ -8,7 +8,6 @@ config IRQCHIP · 7 unmodified lines | |||
| 8 | config ARM_GIC | 8 | config ARM_GIC |
| 9 | bool | 9 | bool |
| 10 | select IRQ_DOMAIN_HIERARCHY | 10 | select IRQ_DOMAIN_HIERARCHY |
| 11 | select GENERIC_IRQ_MULTI_HANDLER | ||
| 12 | select GENERIC_IRQ_EFFECTIVE_AFF_MASK | 11 | select GENERIC_IRQ_EFFECTIVE_AFF_MASK |
| 13 | 12 | ||
| 14 | config ARM_GIC_PM | 13 | config ARM_GIC_PM |
| @@ -33,7 +32,6 @@ config GIC_NON_BANKED · 18 unmodified lines | |||
| 33 | 32 | ||
| 34 | config ARM_GIC_V3 | 33 | config ARM_GIC_V3 |
| 35 | bool | 34 | bool |
| 36 | select GENERIC_IRQ_MULTI_HANDLER | ||
| 37 | select IRQ_DOMAIN_HIERARCHY | 35 | select IRQ_DOMAIN_HIERARCHY |
| 38 | select PARTITION_PERCPU | 36 | select PARTITION_PERCPU |
| 39 | select GENERIC_IRQ_EFFECTIVE_AFF_MASK | 37 | select GENERIC_IRQ_EFFECTIVE_AFF_MASK |
| @@ -64,7 +62,6 @@ config ARM_NVIC · 24 unmodified lines | |||
| 64 | config ARM_VIC | 62 | config ARM_VIC |
| 65 | bool | 63 | bool |
| 66 | select IRQ_DOMAIN | 64 | select IRQ_DOMAIN |
| 67 | select GENERIC_IRQ_MULTI_HANDLER | ||
| 68 | 65 | ||
| 69 | config ARM_VIC_NR | 66 | config ARM_VIC_NR |
| 70 | int | 67 | int |
| @@ -99,14 +96,12 @@ config ATMEL_AIC_IRQ · 28 unmodified lines | |||
| 99 | bool | 96 | bool |
| 100 | select GENERIC_IRQ_CHIP | 97 | select GENERIC_IRQ_CHIP |
| 101 | select IRQ_DOMAIN | 98 | select IRQ_DOMAIN |
| 102 | select GENERIC_IRQ_MULTI_HANDLER | ||
| 103 | select SPARSE_IRQ | 99 | select SPARSE_IRQ |
| 104 | 100 | ||
| 105 | config ATMEL_AIC5_IRQ | 101 | config ATMEL_AIC5_IRQ |
| 106 | bool | 102 | bool |
| 107 | select GENERIC_IRQ_CHIP | 103 | select GENERIC_IRQ_CHIP |
| 108 | select IRQ_DOMAIN | 104 | select IRQ_DOMAIN |
| 109 | select GENERIC_IRQ_MULTI_HANDLER | ||
| 110 | select SPARSE_IRQ | 105 | select SPARSE_IRQ |
| 111 | 106 | ||
| 112 | config I8259 | 107 | config I8259 |
| @@ -153,7 +148,6 @@ config DW_APB_ICTL · 40 unmodified lines | |||
| 153 | config FARADAY_FTINTC010 | 148 | config FARADAY_FTINTC010 |
| 154 | bool | 149 | bool |
| 155 | select IRQ_DOMAIN | 150 | select IRQ_DOMAIN |
| 156 | select GENERIC_IRQ_MULTI_HANDLER | ||
| 157 | select SPARSE_IRQ | 151 | select SPARSE_IRQ |
| 158 | 152 | ||
| 159 | config HISILICON_IRQ_MBIGEN | 153 | config HISILICON_IRQ_MBIGEN |
| @@ -169,7 +163,6 @@ config IMGPDC_IRQ · 9 unmodified lines | |||
| 169 | config IXP4XX_IRQ | 163 | config IXP4XX_IRQ |
| 170 | bool | 164 | bool |
| 171 | select IRQ_DOMAIN | 165 | select IRQ_DOMAIN |
| 172 | select GENERIC_IRQ_MULTI_HANDLER | ||
| 173 | select SPARSE_IRQ | 166 | select SPARSE_IRQ |
| 174 | 167 | ||
| 175 | config MADERA_IRQ | 168 | config MADERA_IRQ |
| @@ -186,7 +179,6 @@ config CLPS711X_IRQCHIP · 10 unmodified lines | |||
| 186 | bool | 179 | bool |
| 187 | depends on ARCH_CLPS711X | 180 | depends on ARCH_CLPS711X |
| 188 | select IRQ_DOMAIN | 181 | select IRQ_DOMAIN |
| 189 | select GENERIC_IRQ_MULTI_HANDLER | ||
| 190 | select SPARSE_IRQ | 182 | select SPARSE_IRQ |
| 191 | default y | 183 | default y |
| 192 | 184 | ||
| @@ -205,7 +197,6 @@ config OMAP_IRQCHIP · 12 unmodified lines | |||
| 205 | config ORION_IRQCHIP | 197 | config ORION_IRQCHIP |
| 206 | bool | 198 | bool |
| 207 | select IRQ_DOMAIN | 199 | select IRQ_DOMAIN |
| 208 | select GENERIC_IRQ_MULTI_HANDLER | ||
| 209 | 200 | ||
| 210 | config PIC32_EVIC | 201 | config PIC32_EVIC |
| 211 | bool | 202 | bool |
| @@ -179,5 +179,6 @@ err_free_tcu: · 178 unmodified lines | |||
| 179 | } | 179 | } |
| 180 | IRQCHIP_DECLARE(jz4740_tcu_irq, "ingenic,jz4740-tcu", ingenic_tcu_irq_init); | 180 | IRQCHIP_DECLARE(jz4740_tcu_irq, "ingenic,jz4740-tcu", ingenic_tcu_irq_init); |
| 181 | IRQCHIP_DECLARE(jz4725b_tcu_irq, "ingenic,jz4725b-tcu", ingenic_tcu_irq_init); | 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 | IRQCHIP_DECLARE(jz4770_tcu_irq, "ingenic,jz4770-tcu", ingenic_tcu_irq_init); | 183 | IRQCHIP_DECLARE(jz4770_tcu_irq, "ingenic,jz4770-tcu", ingenic_tcu_irq_init); |
| 183 | IRQCHIP_DECLARE(x1000_tcu_irq, "ingenic,x1000-tcu", ingenic_tcu_irq_init); | 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 | return ingenic_intc_of_init(node, 2); | 156 | return ingenic_intc_of_init(node, 2); |
| 157 | } | 157 | } |
| 158 | IRQCHIP_DECLARE(jz4760_intc, "ingenic,jz4760-intc", intc_2chip_of_init); | ||
| 158 | IRQCHIP_DECLARE(jz4770_intc, "ingenic,jz4770-intc", intc_2chip_of_init); | 159 | IRQCHIP_DECLARE(jz4770_intc, "ingenic,jz4770-intc", intc_2chip_of_init); |
| 159 | IRQCHIP_DECLARE(jz4775_intc, "ingenic,jz4775-intc", intc_2chip_of_init); | 160 | IRQCHIP_DECLARE(jz4775_intc, "ingenic,jz4775-intc", intc_2chip_of_init); |
| 160 | IRQCHIP_DECLARE(jz4780_intc, "ingenic,jz4780-intc", intc_2chip_of_init); | 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 | * Return value: CAPI result code | 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 | struct capi_ctr *ctr; | 726 | struct capi_ctr *ctr; |
| 727 | u16 ret; | 727 | u16 ret; |
| @@ -787,7 +787,7 @@ u16 capi20_get_version(u32 contr, struct capi_version *verp) · 59 unmodified lines | |||
| 787 | * Return value: CAPI result code | 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 | struct capi_ctr *ctr; | 792 | struct capi_ctr *ctr; |
| 793 | u16 ret; | 793 | u16 ret; |
| @@ -694,7 +694,7 @@ isac_release(struct isac_hw *isac) · 693 unmodified lines | |||
| 694 | { | 694 | { |
| 695 | if (isac->type & IPAC_TYPE_ISACX) | 695 | if (isac->type & IPAC_TYPE_ISACX) |
| 696 | WriteISAC(isac, ISACX_MASK, 0xff); | 696 | WriteISAC(isac, ISACX_MASK, 0xff); |
| 697 | else | 697 | else if (isac->type != 0) |
| 698 | WriteISAC(isac, ISAC_MASK, 0xff); | 698 | WriteISAC(isac, ISAC_MASK, 0xff); |
| 699 | if (isac->dch.timer.function != NULL) { | 699 | if (isac->dch.timer.function != NULL) { |
| 700 | del_timer(&isac->dch.timer); | 700 | del_timer(&isac->dch.timer); |
| @@ -2,7 +2,7 @@ · 1 unmodified line | |||
| 2 | /* | 2 | /* |
| 3 | * CZ.NIC's Turris Omnia LEDs driver | 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 | #include <linux/i2c.h> | 8 | #include <linux/i2c.h> |
| @@ -287,6 +287,6 @@ static struct i2c_driver omnia_leds_driver = { · 278 unmodified lines | |||
| 287 | 287 | ||
| 288 | module_i2c_driver(omnia_leds_driver); | 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 | MODULE_DESCRIPTION("CZ.NIC's Turris Omnia LEDs"); | 291 | MODULE_DESCRIPTION("CZ.NIC's Turris Omnia LEDs"); |
| 292 | MODULE_LICENSE("GPL v2"); | 292 | MODULE_LICENSE("GPL v2"); |
| @@ -51,10 +51,8 @@ static ssize_t ttyname_store(struct device *dev, · 50 unmodified lines | |||
| 51 | 51 | ||
| 52 | if (size) { | 52 | if (size) { |
| 53 | ttyname = kmemdup_nul(buf, size, GFP_KERNEL); | 53 | ttyname = kmemdup_nul(buf, size, GFP_KERNEL); |
| 54 | if (!ttyname) { | 54 | if (!ttyname) |
| 55 | ret = -ENOMEM; | 55 | return -ENOMEM; |
| 56 | goto out_unlock; | ||
| 57 | } | ||
| 58 | } else { | 56 | } else { |
| 59 | ttyname = NULL; | 57 | ttyname = NULL; |
| 60 | } | 58 | } |
| @@ -69,7 +67,6 @@ static ssize_t ttyname_store(struct device *dev, · 8 unmodified lines | |||
| 69 | 67 | ||
| 70 | trigger_data->ttyname = ttyname; | 68 | trigger_data->ttyname = ttyname; |
| 71 | 69 | ||
| 72 | out_unlock: | ||
| 73 | mutex_unlock(&trigger_data->mutex); | 70 | mutex_unlock(&trigger_data->mutex); |
| 74 | 71 | ||
| 75 | if (ttyname && !running) | 72 | if (ttyname && !running) |
| @@ -125,12 +122,12 @@ static void ledtrig_tty_work(struct work_struct *work) · 49 unmodified lines | |||
| 125 | 122 | ||
| 126 | if (icount.rx != trigger_data->rx || | 123 | if (icount.rx != trigger_data->rx || |
| 127 | icount.tx != trigger_data->tx) { | 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 | trigger_data->rx = icount.rx; | 127 | trigger_data->rx = icount.rx; |
| 131 | trigger_data->tx = icount.tx; | 128 | trigger_data->tx = icount.tx; |
| 132 | } else { | 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 | out: | 133 | out: |
| @@ -2,7 +2,7 @@ · 1 unmodified line | |||
| 2 | /* | 2 | /* |
| 3 | * rWTM BIU Mailbox driver for Armada 37xx | 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 | #include <linux/device.h> | 8 | #include <linux/device.h> |
| @@ -203,4 +203,4 @@ module_platform_driver(armada_37xx_mbox_driver); · 194 unmodified lines | |||
| 203 | 203 | ||
| 204 | MODULE_LICENSE("GPL v2"); | 204 | MODULE_LICENSE("GPL v2"); |
| 205 | MODULE_DESCRIPTION("rWTM BIU Mailbox driver for Armada 37xx"); | 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 | q->limits.max_hw_sectors = UINT_MAX; | 965 | q->limits.max_hw_sectors = UINT_MAX; |
| 966 | q->limits.max_sectors = UINT_MAX; | 966 | q->limits.max_sectors = UINT_MAX; |
| 967 | q->limits.max_segment_size = UINT_MAX; | 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 | blk_queue_max_discard_sectors(q, UINT_MAX); | 969 | blk_queue_max_discard_sectors(q, UINT_MAX); |
| 970 | q->limits.discard_granularity = 512; | 970 | q->limits.discard_granularity = 512; |
| 971 | q->limits.io_min = block_size; | 971 | q->limits.io_min = block_size; |
| @@ -229,7 +229,7 @@ static DEFINE_SPINLOCK(dm_crypt_clients_lock); · 228 unmodified lines | |||
| 229 | static unsigned dm_crypt_clients_n = 0; | 229 | static unsigned dm_crypt_clients_n = 0; |
| 230 | static volatile unsigned long dm_crypt_pages_per_client; | 230 | static volatile unsigned long dm_crypt_pages_per_client; |
| 231 | #define DM_CRYPT_MEMORY_PERCENT 2 | 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 | static void clone_init(struct dm_crypt_io *, struct bio *); | 234 | static void clone_init(struct dm_crypt_io *, struct bio *); |
| 235 | static void kcryptd_queue_crypt(struct dm_crypt_io *io); | 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 | ALIGN(sizeof(struct dm_crypt_io) + cc->dmreq_start + additional_req_size, | 3246 | ALIGN(sizeof(struct dm_crypt_io) + cc->dmreq_start + additional_req_size, |
| 3247 | ARCH_KMALLOC_MINALIGN); | 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 | if (ret) { | 3250 | if (ret) { |
| 3251 | ti->error = "Cannot allocate page mempool"; | 3251 | ti->error = "Cannot allocate page mempool"; |
| 3252 | goto bad; | 3252 | goto bad; |
| @@ -3373,9 +3373,9 @@ static int crypt_map(struct dm_target *ti, struct bio *bio) · 120 unmodified lines | |||
| 3373 | /* | 3373 | /* |
| 3374 | * Check if bio is too large, split as needed. | 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 | (bio_data_dir(bio) == WRITE || cc->on_disk_tag_size)) | 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 | * Ensure that bio is a multiple of internal sector encryption size | 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 | * Grab our output buffer. | 529 | * Grab our output buffer. |
| 530 | */ | 530 | */ |
| 531 | nl = orig_nl = get_result_buffer(param, param_size, &len); | 531 | nl = orig_nl = get_result_buffer(param, param_size, &len); |
| 532 | if (len < needed) { | 532 | if (len < needed || len < sizeof(nl->dev)) { |
| 533 | param->flags |= DM_BUFFER_FULL_FLAG; | 533 | param->flags |= DM_BUFFER_FULL_FLAG; |
| 534 | goto out; | 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 | return blk_queue_zoned_model(q) != *zoned_model; | 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 | static bool dm_table_supports_zoned_model(struct dm_table *t, | 1604 | static bool dm_table_supports_zoned_model(struct dm_table *t, |
| 1598 | enum blk_zoned_model zoned_model) | 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 | for (i = 0; i < dm_table_get_num_targets(t); i++) { | 1610 | for (i = 0; i < dm_table_get_num_targets(t); i++) { |
| 1604 | ti = dm_table_get_target(t, i); | 1611 | ti = dm_table_get_target(t, i); |
| 1605 | 1612 | ||
| 1606 | if (zoned_model == BLK_ZONED_HM && | 1613 | if (dm_target_supports_zoned_hm(ti->type)) { |
| 1607 | !dm_target_supports_zoned_hm(ti->type)) | 1614 | if (!ti->type->iterate_devices || |
| 1608 | return false; | 1615 | ti->type->iterate_devices(ti, device_not_zoned_model, |
| 1609 | 1616 | &zoned_model)) | |
| 1610 | if (!ti->type->iterate_devices || | 1617 | return false; |
| 1611 | ti->type->iterate_devices(ti, device_not_zoned_model, &zoned_model)) | 1618 | } else if (!dm_target_supports_mixed_zoned_model(ti->type)) { |
| 1612 | return false; | 1619 | if (zoned_model == BLK_ZONED_HM) |
| 1620 | return false; | ||
| 1621 | } | ||
| 1613 | } | 1622 | } |
| 1614 | 1623 | ||
| 1615 | return true; | 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 | struct request_queue *q = bdev_get_queue(dev->bdev); | 1630 | struct request_queue *q = bdev_get_queue(dev->bdev); |
| 1622 | unsigned int *zone_sectors = data; | 1631 | unsigned int *zone_sectors = data; |
| 1623 | 1632 | ||
| 1633 | if (!blk_queue_is_zoned(q)) | ||
| 1634 | return 0; | ||
| 1635 | |||
| 1624 | return blk_queue_zone_sectors(q) != *zone_sectors; | 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 | static int validate_hardware_zoned_model(struct dm_table *table, | 1644 | static int validate_hardware_zoned_model(struct dm_table *table, |
| 1628 | enum blk_zoned_model zoned_model, | 1645 | enum blk_zoned_model zoned_model, |
| 1629 | unsigned int zone_sectors) | 1646 | unsigned int zone_sectors) |
| @@ -1642,7 +1659,7 @@ static int validate_hardware_zoned_model(struct dm_table *table, · 12 unmodified lines | |||
| 1642 | return -EINVAL; | 1659 | return -EINVAL; |
| 1643 | 1660 | ||
| 1644 | if (dm_table_any_dev_attr(table, device_not_matches_zone_sectors, &zone_sectors)) { | 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 | dm_device_name(table->md)); | 1663 | dm_device_name(table->md)); |
| 1647 | return -EINVAL; | 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 | u8 *res; | 65 | u8 *res; |
| 66 | 66 | ||
| 67 | position = (index + rsb) * v->fec->roots; | 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 | *offset = (unsigned)rem; | 69 | *offset = (unsigned)rem; |
| 70 | 70 | ||
| 71 | res = dm_bufio_read(v->fec->bufio, block, buf); | 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 | /* read the next block when we run out of parity bytes */ | 155 | /* read the next block when we run out of parity bytes */ |
| 156 | offset += v->fec->roots; | 156 | offset += v->fec->roots; |
| 157 | if (offset >= v->fec->roots << SECTOR_SHIFT) { | 157 | if (offset >= v->fec->io_size) { |
| 158 | dm_bufio_release(buf); | 158 | dm_bufio_release(buf); |
| 159 | 159 | ||
| 160 | par = fec_read_parity(v, rsb, block_offset, &offset, &buf); | 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 | return -E2BIG; | 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 | f->bufio = dm_bufio_client_create(f->dev->bdev, | 750 | f->bufio = dm_bufio_client_create(f->dev->bdev, |
| 746 | f->roots << SECTOR_SHIFT, | 751 | f->io_size, |
| 747 | 1, 0, NULL, NULL); | 752 | 1, 0, NULL, NULL); |
| 748 | if (IS_ERR(f->bufio)) { | 753 | if (IS_ERR(f->bufio)) { |
| 749 | ti->error = "Cannot initialize FEC bufio client"; | 754 | ti->error = "Cannot initialize FEC bufio client"; |
| @@ -36,6 +36,7 @@ struct dm_verity_fec { · 35 unmodified lines | |||
| 36 | struct dm_dev *dev; /* parity data device */ | 36 | struct dm_dev *dev; /* parity data device */ |
| 37 | struct dm_bufio_client *data_bufio; /* for data dev access */ | 37 | struct dm_bufio_client *data_bufio; /* for data dev access */ |
| 38 | struct dm_bufio_client *bufio; /* for parity data access */ | 38 | struct dm_bufio_client *bufio; /* for parity data access */ |
| 39 | size_t io_size; /* IO size for roots */ | ||
| 39 | sector_t start; /* parity data start in blocks */ | 40 | sector_t start; /* parity data start in blocks */ |
| 40 | sector_t blocks; /* number of blocks covered */ | 41 | sector_t blocks; /* number of blocks covered */ |
| 41 | sector_t rounds; /* number of interleaving rounds */ | 42 | sector_t rounds; /* number of interleaving rounds */ |
| @@ -34,7 +34,7 @@ · 33 unmodified lines | |||
| 34 | #define DM_VERITY_OPT_IGN_ZEROES "ignore_zero_blocks" | 34 | #define DM_VERITY_OPT_IGN_ZEROES "ignore_zero_blocks" |
| 35 | #define DM_VERITY_OPT_AT_MOST_ONCE "check_at_most_once" | 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 | DM_VERITY_ROOT_HASH_VERIFICATION_OPTS) | 38 | DM_VERITY_ROOT_HASH_VERIFICATION_OPTS) |
| 39 | 39 | ||
| 40 | static unsigned dm_verity_prefetch_cluster = DM_VERITY_DEFAULT_PREFETCH_SIZE; | 40 | static unsigned dm_verity_prefetch_cluster = DM_VERITY_DEFAULT_PREFETCH_SIZE; |
| @@ -1892,10 +1892,10 @@ restart: · 1891 unmodified lines | |||
| 1892 | list_add(&g->lru, &wbl.list); | 1892 | list_add(&g->lru, &wbl.list); |
| 1893 | wbl.size++; | 1893 | wbl.size++; |
| 1894 | g->write_in_progress = true; | 1894 | g->write_in_progress = true; |
| 1895 | g->wc_list_contiguous = BIO_MAX_PAGES; | 1895 | g->wc_list_contiguous = BIO_MAX_VECS; |
| 1896 | f = g; | 1896 | f = g; |
| 1897 | e->wc_list_contiguous++; | 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 | if (unlikely(wc->writeback_all)) { | 1899 | if (unlikely(wc->writeback_all)) { |
| 1900 | next_node = rb_next(&f->rb_node); | 1900 | next_node = rb_next(&f->rb_node); |
| 1901 | if (likely(next_node)) | 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 | static struct target_type dmz_type = { | 1143 | static struct target_type dmz_type = { |
| 1144 | .name = "zoned", | 1144 | .name = "zoned", |
| 1145 | .version = {2, 0, 0}, | 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 | .module = THIS_MODULE, | 1147 | .module = THIS_MODULE, |
| 1148 | .ctr = dmz_ctr, | 1148 | .ctr = dmz_ctr, |
| 1149 | .dtr = dmz_dtr, | 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 | if (size != dm_get_size(md)) | 2036 | if (size != dm_get_size(md)) |
| 2037 | memset(&md->geometry, 0, sizeof(md->geometry)); | 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 | dm_table_event_callback(t, event_callback, md); | 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 | static struct bio *r5l_bio_alloc(struct r5l_log *log) | 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 | bio_set_op_attrs(bio, REQ_OP_WRITE, 0); | 740 | bio_set_op_attrs(bio, REQ_OP_WRITE, 0); |
| 741 | bio_set_dev(bio, log->rdev->bdev); | 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 | struct page *page; | 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 | if (!ctx->ra_bio) | 1638 | if (!ctx->ra_bio) |
| 1639 | return -ENOMEM; | 1639 | return -ENOMEM; |
| 1640 | 1640 | ||
| @@ -496,7 +496,7 @@ static void ppl_submit_iounit(struct ppl_io_unit *io) · 495 unmodified lines | |||
| 496 | if (!bio_add_page(bio, sh->ppl_page, PAGE_SIZE, 0)) { | 496 | if (!bio_add_page(bio, sh->ppl_page, PAGE_SIZE, 0)) { |
| 497 | struct bio *prev = bio; | 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 | &ppl_conf->bs); | 500 | &ppl_conf->bs); |
| 501 | bio->bi_opf = prev->bi_opf; | 501 | bio->bi_opf = prev->bi_opf; |
| 502 | bio->bi_write_hint = prev->bi_write_hint; | 502 | bio->bi_write_hint = prev->bi_write_hint; |
| @@ -430,4 +430,3 @@ MODULE_AUTHOR("Andreas Monitzer <andy@monitzer.com>"); · 429 unmodified lines | |||
| 430 | MODULE_AUTHOR("Ben Backx <ben@bbackx.com>"); | 430 | MODULE_AUTHOR("Ben Backx <ben@bbackx.com>"); |
| 431 | MODULE_DESCRIPTION("FireDTV DVB Driver"); | 431 | MODULE_DESCRIPTION("FireDTV DVB Driver"); |
| 432 | MODULE_LICENSE("GPL"); | 432 | MODULE_LICENSE("GPL"); |
| 433 | MODULE_SUPPORTED_DEVICE("FireDTV DVB"); | ||
| @@ -41,7 +41,6 @@ MODULE_PARM_DESC(debug, · 40 unmodified lines | |||
| 41 | 41 | ||
| 42 | MODULE_AUTHOR("Andy Walls"); | 42 | MODULE_AUTHOR("Andy Walls"); |
| 43 | MODULE_DESCRIPTION("CX23418 ALSA Interface"); | 43 | MODULE_DESCRIPTION("CX23418 ALSA Interface"); |
| 44 | MODULE_SUPPORTED_DEVICE("CX23418 MPEG2 encoder"); | ||
| 45 | MODULE_LICENSE("GPL"); | 44 | MODULE_LICENSE("GPL"); |
| 46 | 45 | ||
| 47 | MODULE_VERSION(CX18_VERSION); | 46 | MODULE_VERSION(CX18_VERSION); |
| @@ -232,7 +232,6 @@ MODULE_PARM_DESC(cx18_first_minor, · 231 unmodified lines | |||
| 232 | 232 | ||
| 233 | MODULE_AUTHOR("Hans Verkuil"); | 233 | MODULE_AUTHOR("Hans Verkuil"); |
| 234 | MODULE_DESCRIPTION("CX23418 driver"); | 234 | MODULE_DESCRIPTION("CX23418 driver"); |
| 235 | MODULE_SUPPORTED_DEVICE("CX23418 MPEG2 encoder"); | ||
| 236 | MODULE_LICENSE("GPL"); | 235 | MODULE_LICENSE("GPL"); |
| 237 | 236 | ||
| 238 | MODULE_VERSION(CX18_VERSION); | 237 | MODULE_VERSION(CX18_VERSION); |
| @@ -104,7 +104,6 @@ MODULE_PARM_DESC(index, "Index value for cx25821 capture interface(s)."); · 103 unmodified lines | |||
| 104 | MODULE_DESCRIPTION("ALSA driver module for cx25821 based capture cards"); | 104 | MODULE_DESCRIPTION("ALSA driver module for cx25821 based capture cards"); |
| 105 | MODULE_AUTHOR("Hiep Huynh"); | 105 | MODULE_AUTHOR("Hiep Huynh"); |
| 106 | MODULE_LICENSE("GPL"); | 106 | MODULE_LICENSE("GPL"); |
| 107 | MODULE_SUPPORTED_DEVICE("{{Conexant,25821}"); /* "{{Conexant,23881}," */ | ||
| 108 | 107 | ||
| 109 | static unsigned int debug; | 108 | static unsigned int debug; |
| 110 | module_param(debug, int, 0644); | 109 | module_param(debug, int, 0644); |
| @@ -98,7 +98,6 @@ MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@kernel.org>"); · 97 unmodified lines | |||
| 98 | MODULE_LICENSE("GPL v2"); | 98 | MODULE_LICENSE("GPL v2"); |
| 99 | MODULE_VERSION(CX88_VERSION); | 99 | MODULE_VERSION(CX88_VERSION); |
| 100 | 100 | ||
| 101 | MODULE_SUPPORTED_DEVICE("{{Conexant,23881},{{Conexant,23882},{{Conexant,23883}"); | ||
| 102 | static unsigned int debug; | 101 | static unsigned int debug; |
| 103 | module_param(debug, int, 0644); | 102 | module_param(debug, int, 0644); |
| 104 | MODULE_PARM_DESC(debug, "enable debug messages"); | 103 | MODULE_PARM_DESC(debug, "enable debug messages"); |
| @@ -38,7 +38,6 @@ MODULE_PARM_DESC(index, · 37 unmodified lines | |||
| 38 | 38 | ||
| 39 | MODULE_AUTHOR("Andy Walls"); | 39 | MODULE_AUTHOR("Andy Walls"); |
| 40 | MODULE_DESCRIPTION("CX23415/CX23416 ALSA Interface"); | 40 | MODULE_DESCRIPTION("CX23415/CX23416 ALSA Interface"); |
| 41 | MODULE_SUPPORTED_DEVICE("CX23415/CX23416 MPEG2 encoder"); | ||
| 42 | MODULE_LICENSE("GPL"); | 41 | MODULE_LICENSE("GPL"); |
| 43 | 42 | ||
| 44 | MODULE_VERSION(IVTV_VERSION); | 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 | MODULE_AUTHOR("Kevin Thayer, Chris Kennedy, Hans Verkuil"); | 276 | MODULE_AUTHOR("Kevin Thayer, Chris Kennedy, Hans Verkuil"); |
| 277 | MODULE_DESCRIPTION("CX23415/CX23416 driver"); | 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 | MODULE_LICENSE("GPL"); | 278 | MODULE_LICENSE("GPL"); |
| 282 | 279 | ||
| 283 | MODULE_VERSION(IVTV_VERSION); | 280 | MODULE_VERSION(IVTV_VERSION); |
| @@ -1269,6 +1269,5 @@ late_initcall_sync(sta2x11_vip_init_module); · 1268 unmodified lines | |||
| 1269 | MODULE_DESCRIPTION("STA2X11 Video Input Port driver"); | 1269 | MODULE_DESCRIPTION("STA2X11 Video Input Port driver"); |
| 1270 | MODULE_AUTHOR("Wind River"); | 1270 | MODULE_AUTHOR("Wind River"); |
| 1271 | MODULE_LICENSE("GPL v2"); | 1271 | MODULE_LICENSE("GPL v2"); |
| 1272 | MODULE_SUPPORTED_DEVICE("sta2x11 video input"); | ||
| 1273 | MODULE_VERSION(DRV_VERSION); | 1272 | MODULE_VERSION(DRV_VERSION); |
| 1274 | MODULE_DEVICE_TABLE(pci, sta2x11_vip_pci_tbl); | 1273 | MODULE_DEVICE_TABLE(pci, sta2x11_vip_pci_tbl); |
| @@ -1363,4 +1363,3 @@ module_platform_driver(atmel_isi_driver); · 1362 unmodified lines | |||
| 1363 | MODULE_AUTHOR("Josh Wu <josh.wu@atmel.com>"); | 1363 | MODULE_AUTHOR("Josh Wu <josh.wu@atmel.com>"); |
| 1364 | MODULE_DESCRIPTION("The V4L2 driver for Atmel Linux"); | 1364 | MODULE_DESCRIPTION("The V4L2 driver for Atmel Linux"); |
| 1365 | MODULE_LICENSE("GPL"); | 1365 | MODULE_LICENSE("GPL"); |
| 1366 | MODULE_SUPPORTED_DEVICE("video"); | ||
| @@ -330,4 +330,3 @@ module_platform_driver(atmel_isc_driver); · 329 unmodified lines | |||
| 330 | MODULE_AUTHOR("Songjun Wu"); | 330 | MODULE_AUTHOR("Songjun Wu"); |
| 331 | MODULE_DESCRIPTION("The V4L2 driver for Atmel-ISC"); | 331 | MODULE_DESCRIPTION("The V4L2 driver for Atmel-ISC"); |
| 332 | MODULE_LICENSE("GPL v2"); | 332 | MODULE_LICENSE("GPL v2"); |
| 333 | MODULE_SUPPORTED_DEVICE("video"); | ||
| @@ -44,10 +44,6 @@ · 43 unmodified lines | |||
| 44 | MODULE_AUTHOR("Jonathan Corbet <corbet@lwn.net>"); | 44 | MODULE_AUTHOR("Jonathan Corbet <corbet@lwn.net>"); |
| 45 | MODULE_DESCRIPTION("Marvell 88ALP01 CMOS Camera Controller driver"); | 45 | MODULE_DESCRIPTION("Marvell 88ALP01 CMOS Camera Controller driver"); |
| 46 | MODULE_LICENSE("GPL"); | 46 | MODULE_LICENSE("GPL"); |
| 47 | MODULE_SUPPORTED_DEVICE("Video"); | ||
| 48 | |||
| 49 | |||
| 50 | |||
| 51 | 47 | ||
| 52 | struct cafe_camera { | 48 | struct cafe_camera { |
| 53 | int registered; /* Fully initialized? */ | 49 | int registered; /* Fully initialized? */ |
| @@ -1288,7 +1288,6 @@ static void rkisp1_params_config_parameter(struct rkisp1_params *params) · 1287 unmodified lines | |||
| 1288 | memset(hst.hist_weight, 0x01, sizeof(hst.hist_weight)); | 1288 | memset(hst.hist_weight, 0x01, sizeof(hst.hist_weight)); |
| 1289 | rkisp1_hst_config(params, &hst); | 1289 | rkisp1_hst_config(params, &hst); |
| 1290 | rkisp1_param_set_bits(params, RKISP1_CIF_ISP_HIST_PROP, | 1290 | rkisp1_param_set_bits(params, RKISP1_CIF_ISP_HIST_PROP, |
| 1291 | ~RKISP1_CIF_ISP_HIST_PROP_MODE_MASK | | ||
| 1292 | rkisp1_hst_params_default_config.mode); | 1291 | rkisp1_hst_params_default_config.mode); |
| 1293 | 1292 | ||
| 1294 | /* set the range */ | 1293 | /* set the range */ |
| @@ -2149,4 +2149,3 @@ MODULE_AUTHOR("Yannick Fertre <yannick.fertre@st.com>"); · 2148 unmodified lines | |||
| 2149 | MODULE_AUTHOR("Hugues Fruchet <hugues.fruchet@st.com>"); | 2149 | MODULE_AUTHOR("Hugues Fruchet <hugues.fruchet@st.com>"); |
| 2150 | MODULE_DESCRIPTION("STMicroelectronics STM32 Digital Camera Memory Interface driver"); | 2150 | MODULE_DESCRIPTION("STMicroelectronics STM32 Digital Camera Memory Interface driver"); |
| 2151 | MODULE_LICENSE("GPL"); | 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 | brx = &vsp1->bru->entity; | 245 | brx = &vsp1->bru->entity; |
| 246 | else if (pipe->brx && !drm_pipe->force_brx_release) | 246 | else if (pipe->brx && !drm_pipe->force_brx_release) |
| 247 | brx = pipe->brx; | 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 | brx = &vsp1->bru->entity; | 249 | brx = &vsp1->bru->entity; |
| 250 | else | 250 | else |
| 251 | brx = &vsp1->brs->entity; | 251 | brx = &vsp1->brs->entity; |
| @@ -462,9 +462,9 @@ static int vsp1_du_pipeline_setup_inputs(struct vsp1_device *vsp1, · 210 unmodified lines | |||
| 462 | * make sure it is present in the pipeline's list of entities if it | 462 | * make sure it is present in the pipeline's list of entities if it |
| 463 | * wasn't already. | 463 | * wasn't already. |
| 464 | */ | 464 | */ |
| 465 | if (!use_uif) { | 465 | if (drm_pipe->uif && !use_uif) { |
| 466 | drm_pipe->uif->pipe = NULL; | 466 | drm_pipe->uif->pipe = NULL; |
| 467 | } else if (!drm_pipe->uif->pipe) { | 467 | } else if (drm_pipe->uif && !drm_pipe->uif->pipe) { |
| 468 | drm_pipe->uif->pipe = pipe; | 468 | drm_pipe->uif->pipe = pipe; |
| 469 | list_add_tail(&drm_pipe->uif->list_pipe, &pipe->entities); | 469 | list_add_tail(&drm_pipe->uif->list_pipe, &pipe->entities); |
| 470 | } | 470 | } |
| @@ -5,6 +5,7 @@ obj-y += keymaps/ · 4 unmodified lines | |||
| 5 | obj-$(CONFIG_RC_CORE) += rc-core.o | 5 | obj-$(CONFIG_RC_CORE) += rc-core.o |
| 6 | rc-core-y := rc-main.o rc-ir-raw.o | 6 | rc-core-y := rc-main.o rc-ir-raw.o |
| 7 | rc-core-$(CONFIG_LIRC) += lirc_dev.o | 7 | rc-core-$(CONFIG_LIRC) += lirc_dev.o |
| 8 | rc-core-$(CONFIG_MEDIA_CEC_RC) += keymaps/rc-cec.o | ||
| 8 | rc-core-$(CONFIG_BPF_LIRC_MODE2) += bpf-lirc.o | 9 | rc-core-$(CONFIG_BPF_LIRC_MODE2) += bpf-lirc.o |
| 9 | obj-$(CONFIG_IR_NEC_DECODER) += ir-nec-decoder.o | 10 | obj-$(CONFIG_IR_NEC_DECODER) += ir-nec-decoder.o |
| 10 | obj-$(CONFIG_IR_RC5_DECODER) += ir-rc5-decoder.o | 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 | rc-behold.o \ | 21 | rc-behold.o \ |
| 22 | rc-behold-columbus.o \ | 22 | rc-behold-columbus.o \ |
| 23 | rc-budget-ci-old.o \ | 23 | rc-budget-ci-old.o \ |
| 24 | rc-cec.o \ | ||
| 25 | rc-cinergy-1400.o \ | 24 | rc-cinergy-1400.o \ |
| 26 | rc-cinergy.o \ | 25 | rc-cinergy.o \ |
| 27 | rc-d680-dmb.o \ | 26 | rc-d680-dmb.o \ |
| @@ -1,5 +1,15 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0-or-later | 1 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 2 | /* Keytable for the CEC remote control | 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 | * Copyright (c) 2015 by Kamil Debski | 14 | * Copyright (c) 2015 by Kamil Debski |
| 5 | */ | 15 | */ |
| @@ -152,7 +162,7 @@ static struct rc_map_table cec[] = { · 146 unmodified lines | |||
| 152 | /* 0x77-0xff: Reserved */ | 162 | /* 0x77-0xff: Reserved */ |
| 153 | }; | 163 | }; |
| 154 | 164 | ||
| 155 | static struct rc_map_list cec_map = { | 165 | struct rc_map_list cec_map = { |
| 156 | .map = { | 166 | .map = { |
| 157 | .scan = cec, | 167 | .scan = cec, |
| 158 | .size = ARRAY_SIZE(cec), | 168 | .size = ARRAY_SIZE(cec), |
| @@ -160,19 +170,3 @@ static struct rc_map_list cec_map = { · 1 unmodified line | |||
| 160 | .name = RC_MAP_CEC, | 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 | led_trigger_register_simple("rc-feedback", &led_feedback); | 2070 | led_trigger_register_simple("rc-feedback", &led_feedback); |
| 2071 | rc_map_register(&empty_map); | 2071 | rc_map_register(&empty_map); |
| 2072 | #ifdef CONFIG_MEDIA_CEC_RC | ||
| 2073 | rc_map_register(&cec_map); | ||
| 2074 | #endif | ||
| 2072 | 2075 | ||
| 2073 | return 0; | 2076 | return 0; |
| 2074 | } | 2077 | } |
| @@ -2078,6 +2081,9 @@ static void __exit rc_core_exit(void) · 3 unmodified lines | |||
| 2078 | lirc_dev_exit(); | 2081 | lirc_dev_exit(); |
| 2079 | class_unregister(&rc_class); | 2082 | class_unregister(&rc_class); |
| 2080 | led_trigger_unregister_simple(led_feedback); | 2083 | led_trigger_unregister_simple(led_feedback); |
| 2084 | #ifdef CONFIG_MEDIA_CEC_RC | ||
| 2085 | rc_map_unregister(&cec_map); | ||
| 2086 | #endif | ||
| 2081 | rc_map_unregister(&empty_map); | 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 | MODULE_AUTHOR("Steve Miller (STMicroelectronics) <steve.miller@st.com>"); | 57 | MODULE_AUTHOR("Steve Miller (STMicroelectronics) <steve.miller@st.com>"); |
| 58 | MODULE_DESCRIPTION("V4L-driver for STMicroelectronics CPiA2 based cameras"); | 58 | MODULE_DESCRIPTION("V4L-driver for STMicroelectronics CPiA2 based cameras"); |
| 59 | MODULE_SUPPORTED_DEVICE("video"); | ||
| 60 | MODULE_LICENSE("GPL"); | 59 | MODULE_LICENSE("GPL"); |
| 61 | MODULE_VERSION(CPIA_VERSION); | 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 | MODULE_DESCRIPTION("ALSA driver module for tm5600/tm6000/tm6010 based TV cards"); | 51 | MODULE_DESCRIPTION("ALSA driver module for tm5600/tm6000/tm6010 based TV cards"); |
| 52 | MODULE_AUTHOR("Mauro Carvalho Chehab"); | 52 | MODULE_AUTHOR("Mauro Carvalho Chehab"); |
| 53 | MODULE_LICENSE("GPL v2"); | 53 | MODULE_LICENSE("GPL v2"); |
| 54 | MODULE_SUPPORTED_DEVICE("{{Trident,tm5600},{{Trident,tm6000},{{Trident,tm6010}"); | ||
| 55 | static unsigned int debug; | 54 | static unsigned int debug; |
| 56 | module_param(debug, int, 0644); | 55 | module_param(debug, int, 0644); |
| 57 | MODULE_PARM_DESC(debug, "enable debug messages"); | 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 | MODULE_AUTHOR("Mauro Carvalho Chehab"); | 23 | MODULE_AUTHOR("Mauro Carvalho Chehab"); |
| 24 | MODULE_LICENSE("GPL"); | 24 | MODULE_LICENSE("GPL"); |
| 25 | 25 | ||
| 26 | MODULE_SUPPORTED_DEVICE("{{Trident, tm5600},{{Trident, tm6000},{{Trident, tm6010}"); | ||
| 27 | |||
| 28 | static int debug; | 26 | static int debug; |
| 29 | 27 | ||
| 30 | module_param(debug, int, 0644); | 28 | module_param(debug, int, 0644); |
| @@ -371,7 +371,7 @@ void usbtv_audio_free(struct usbtv *usbtv) · 370 unmodified lines | |||
| 371 | cancel_work_sync(&usbtv->snd_trigger); | 371 | cancel_work_sync(&usbtv->snd_trigger); |
| 372 | 372 | ||
| 373 | if (usbtv->snd && usbtv->udev) { | 373 | if (usbtv->snd && usbtv->udev) { |
| 374 | snd_card_free(usbtv->snd); | 374 | snd_card_free_when_closed(usbtv->snd); |
| 375 | usbtv->snd = NULL; | 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 | [INTEL_QUARK_IORES_MEM] = { | 77 | [INTEL_QUARK_IORES_MEM] = { |
| 77 | .flags = IORESOURCE_MEM, | 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 | .adr = MFD_ACPI_MATCH_I2C, | 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 | [INTEL_QUARK_IORES_MEM] = { | 91 | [INTEL_QUARK_IORES_MEM] = { |
| 90 | .flags = IORESOURCE_MEM, | 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 | if (!fl->cctx->rpdev) | 950 | if (!fl->cctx->rpdev) |
| 951 | return -EPIPE; | 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 | ctx = fastrpc_context_alloc(fl, kernel, sc, args); | 958 | ctx = fastrpc_context_alloc(fl, kernel, sc, args); |
| 954 | if (IS_ERR(ctx)) | 959 | if (IS_ERR(ctx)) |
| 955 | return PTR_ERR(ctx); | 960 | return PTR_ERR(ctx); |
| @@ -992,7 +992,6 @@ void hl_debugfs_add_device(struct hl_device *hdev) · 991 unmodified lines | |||
| 992 | struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs; | 992 | struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs; |
| 993 | int count = ARRAY_SIZE(hl_debugfs_list); | 993 | int count = ARRAY_SIZE(hl_debugfs_list); |
| 994 | struct hl_debugfs_entry *entry; | 994 | struct hl_debugfs_entry *entry; |
| 995 | struct dentry *ent; | ||
| 996 | int i; | 995 | int i; |
| 997 | 996 | ||
| 998 | dev_entry->hdev = hdev; | 997 | dev_entry->hdev = hdev; |
| @@ -1105,13 +1104,11 @@ void hl_debugfs_add_device(struct hl_device *hdev) · 106 unmodified lines | |||
| 1105 | &hl_security_violations_fops); | 1104 | &hl_security_violations_fops); |
| 1106 | 1105 | ||
| 1107 | for (i = 0, entry = dev_entry->entry_arr ; i < count ; i++, entry++) { | 1106 | for (i = 0, entry = dev_entry->entry_arr ; i < count ; i++, entry++) { |
| 1108 | 1107 | debugfs_create_file(hl_debugfs_list[i].name, | |
| 1109 | ent = debugfs_create_file(hl_debugfs_list[i].name, | ||
| 1110 | 0444, | 1108 | 0444, |
| 1111 | dev_entry->root, | 1109 | dev_entry->root, |
| 1112 | entry, | 1110 | entry, |
| 1113 | &hl_debugfs_fops); | 1111 | &hl_debugfs_fops); |
| 1114 | entry->dent = ent; | ||
| 1115 | entry->info_ent = &hl_debugfs_list[i]; | 1112 | entry->info_ent = &hl_debugfs_list[i]; |
| 1116 | entry->dev_entry = dev_entry; | 1113 | entry->dev_entry = dev_entry; |
| 1117 | } | 1114 | } |
| @@ -93,12 +93,19 @@ void hl_hpriv_put(struct hl_fpriv *hpriv) · 92 unmodified lines | |||
| 93 | static int hl_device_release(struct inode *inode, struct file *filp) | 93 | static int hl_device_release(struct inode *inode, struct file *filp) |
| 94 | { | 94 | { |
| 95 | struct hl_fpriv *hpriv = filp->private_data; | 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 | hl_cb_mgr_fini(hpriv->hdev, &hpriv->cb_mgr); | 106 | hl_cb_mgr_fini(hpriv->hdev, &hpriv->cb_mgr); |
| 98 | hl_ctx_mgr_fini(hpriv->hdev, &hpriv->ctx_mgr); | 107 | hl_ctx_mgr_fini(hpriv->hdev, &hpriv->ctx_mgr); |
| 99 | 108 | ||
| 100 | filp->private_data = NULL; | ||
| 101 | |||
| 102 | hl_hpriv_put(hpriv); | 109 | hl_hpriv_put(hpriv); |
| 103 | 110 | ||
| 104 | return 0; | 111 | return 0; |
| @@ -107,15 +114,20 @@ static int hl_device_release(struct inode *inode, struct file *filp) · 2 unmodified lines | |||
| 107 | static int hl_device_release_ctrl(struct inode *inode, struct file *filp) | 114 | static int hl_device_release_ctrl(struct inode *inode, struct file *filp) |
| 108 | { | 115 | { |
| 109 | struct hl_fpriv *hpriv = filp->private_data; | 116 | struct hl_fpriv *hpriv = filp->private_data; |
| 110 | struct hl_device *hdev; | 117 | struct hl_device *hdev = hpriv->hdev; |
| 111 | 118 | ||
| 112 | filp->private_data = NULL; | 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 | mutex_lock(&hdev->fpriv_list_lock); | 126 | mutex_lock(&hdev->fpriv_list_lock); |
| 117 | list_del(&hpriv->dev_node); | 127 | list_del(&hpriv->dev_node); |
| 118 | mutex_unlock(&hdev->fpriv_list_lock); | 128 | mutex_unlock(&hdev->fpriv_list_lock); |
| 129 | out: | ||
| 130 | put_pid(hpriv->taskpid); | ||
| 119 | 131 | ||
| 120 | kfree(hpriv); | 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 | static int hl_mmap(struct file *filp, struct vm_area_struct *vma) | 146 | static int hl_mmap(struct file *filp, struct vm_area_struct *vma) |
| 135 | { | 147 | { |
| 136 | struct hl_fpriv *hpriv = filp->private_data; | 148 | struct hl_fpriv *hpriv = filp->private_data; |
| 149 | struct hl_device *hdev = hpriv->hdev; | ||
| 137 | unsigned long vm_pgoff; | 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 | vm_pgoff = vma->vm_pgoff; | 157 | vm_pgoff = vma->vm_pgoff; |
| 140 | vma->vm_pgoff = HL_MMAP_OFFSET_VALUE_GET(vm_pgoff); | 158 | vma->vm_pgoff = HL_MMAP_OFFSET_VALUE_GET(vm_pgoff); |
| 141 | 159 | ||
| @@ -883,6 +901,16 @@ wait_for_processes: · 741 unmodified lines | |||
| 883 | return -EBUSY; | 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 | * hl_device_reset - reset the device | 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 | HL_PENDING_RESET_LONG_SEC); | 1584 | HL_PENDING_RESET_LONG_SEC); |
| 1557 | 1585 | ||
| 1558 | rc = device_kill_open_processes(hdev, HL_PENDING_RESET_LONG_SEC); | 1586 | rc = device_kill_open_processes(hdev, HL_PENDING_RESET_LONG_SEC); |
| 1559 | if (rc) | 1587 | if (rc) { |
| 1560 | dev_crit(hdev->dev, "Failed to kill all open processes\n"); | 1588 | dev_crit(hdev->dev, "Failed to kill all open processes\n"); |
| 1589 | device_disable_open_processes(hdev); | ||
| 1590 | } | ||
| 1561 | 1591 | ||
| 1562 | hl_cb_pool_fini(hdev); | 1592 | hl_cb_pool_fini(hdev); |
| 1563 | 1593 | ||
| @@ -1465,12 +1465,10 @@ struct hl_info_list { · 1464 unmodified lines | |||
| 1465 | 1465 | ||
| 1466 | /** | 1466 | /** |
| 1467 | * struct hl_debugfs_entry - debugfs dentry wrapper. | 1467 | * struct hl_debugfs_entry - debugfs dentry wrapper. |
| 1468 | * @dent: base debugfs entry structure. | ||
| 1469 | * @info_ent: dentry realted ops. | 1468 | * @info_ent: dentry realted ops. |
| 1470 | * @dev_entry: ASIC specific debugfs manager. | 1469 | * @dev_entry: ASIC specific debugfs manager. |
| 1471 | */ | 1470 | */ |
| 1472 | struct hl_debugfs_entry { | 1471 | struct hl_debugfs_entry { |
| 1473 | struct dentry *dent; | ||
| 1474 | const struct hl_info_list *info_ent; | 1472 | const struct hl_info_list *info_ent; |
| 1475 | struct hl_dbg_device_entry *dev_entry; | 1473 | struct hl_dbg_device_entry *dev_entry; |
| 1476 | }; | 1474 | }; |
| @@ -5,6 +5,8 @@ · 4 unmodified lines | |||
| 5 | * All Rights Reserved. | 5 | * All Rights Reserved. |
| 6 | */ | 6 | */ |
| 7 | 7 | ||
| 8 | #define pr_fmt(fmt) "habanalabs: " fmt | ||
| 9 | |||
| 8 | #include <uapi/misc/habanalabs.h> | 10 | #include <uapi/misc/habanalabs.h> |
| 9 | #include "habanalabs.h" | 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 | const struct hl_ioctl_desc *ioctl = NULL; | 684 | const struct hl_ioctl_desc *ioctl = NULL; |
| 683 | unsigned int nr = _IOC_NR(cmd); | 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 | if ((nr >= HL_COMMAND_START) && (nr < HL_COMMAND_END)) { | 692 | if ((nr >= HL_COMMAND_START) && (nr < HL_COMMAND_END)) { |
| 686 | ioctl = &hl_ioctls[nr]; | 693 | ioctl = &hl_ioctls[nr]; |
| 687 | } else { | 694 | } else { |
| @@ -700,6 +707,11 @@ long hl_ioctl_control(struct file *filep, unsigned int cmd, unsigned long arg) · 12 unmodified lines | |||
| 700 | const struct hl_ioctl_desc *ioctl = NULL; | 707 | const struct hl_ioctl_desc *ioctl = NULL; |
| 701 | unsigned int nr = _IOC_NR(cmd); | 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 | if (nr == _IOC_NR(HL_IOCTL_INFO)) { | 715 | if (nr == _IOC_NR(HL_IOCTL_INFO)) { |
| 704 | ioctl = &hl_ioctls_control[nr]; | 716 | ioctl = &hl_ioctls_control[nr]; |
| 705 | } else { | 717 | } else { |
| @@ -47,7 +47,7 @@ inline u32 hl_cq_inc_ptr(u32 ptr) · 46 unmodified lines | |||
| 47 | * Increment ptr by 1. If it reaches the number of event queue | 47 | * Increment ptr by 1. If it reaches the number of event queue |
| 48 | * entries, set it to 0 | 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 | ptr++; | 52 | ptr++; |
| 53 | if (unlikely(ptr == HL_EQ_LENGTH)) | 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 | else /* HL_VA_RANGE_TYPE_DRAM */ | 499 | else /* HL_VA_RANGE_TYPE_DRAM */ |
| 500 | p = &prop->dmmu; | 500 | p = &prop->dmmu; |
| 501 | 501 | ||
| 502 | /* | 502 | if ((hops->range_type == HL_VA_RANGE_TYPE_DRAM) && |
| 503 | * find the correct hop shift field in hl_mmu_properties structure | 503 | !is_power_of_2(prop->dram_page_size)) { |
| 504 | * in order to determine the right maks for the page offset. | 504 | u32 bit; |
| 505 | */ | 505 | u64 page_offset_mask; |
| 506 | hop0_shift_off = offsetof(struct hl_mmu_properties, hop0_shift); | 506 | u64 phys_addr_mask; |
| 507 | p = (char *)p + hop0_shift_off; | 507 | |
| 508 | p = (char *)p + ((hops->used_hops - 1) * sizeof(u64)); | 508 | bit = __ffs64((u64)prop->dram_page_size); |
| 509 | hop_shift = *(u64 *)p; | 509 | page_offset_mask = ((1ull << bit) - 1); |
| 510 | offset_mask = (1ull << hop_shift) - 1; | 510 | phys_addr_mask = ~page_offset_mask; |
| 511 | addr_mask = ~(offset_mask); | 511 | *phys_addr = (tmp_phys_addr & phys_addr_mask) | |
| 512 | *phys_addr = (tmp_phys_addr & addr_mask) | | 512 | (virt_addr & page_offset_mask); |
| 513 | (virt_addr & 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 | int hl_mmu_va_to_pa(struct hl_ctx *ctx, u64 virt_addr, u64 *phys_addr) | 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 | return -EPERM; | 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 | struct crq_server_adapter *adapter = dev_get_drvdata(&vdev->dev); | 2293 | struct crq_server_adapter *adapter = dev_get_drvdata(&vdev->dev); |
| 2294 | 2294 | ||
| 2295 | dev_info(adapter->dev, "Entering remove for UA 0x%x\n", | 2295 | dev_info(adapter->dev, "Entering remove for UA 0x%x\n", |
| 2296 | vdev->unit_address); | 2296 | vdev->unit_address); |
| 2297 | ibmvmc_release_crq_queue(adapter); | 2297 | ibmvmc_release_crq_queue(adapter); |
| 2298 | |||
| 2299 | return 0; | ||
| 2300 | } | 2298 | } |
| 2301 | 2299 | ||
| 2302 | static struct vio_device_id ibmvmc_device_table[] = { | 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 | if (buffer_id == 0) | 2286 | if (buffer_id == 0) |
| 2287 | return -EINVAL; | 2287 | return -EINVAL; |
| 2288 | 2288 | ||
| 2289 | if (!mei_cl_is_connected(cl)) | 2289 | if (mei_cl_is_connected(cl)) |
| 2290 | return -ENODEV; | 2290 | return -EPROTO; |
| 2291 | 2291 | ||
| 2292 | if (cl->dma_mapped) | 2292 | if (cl->dma_mapped) |
| 2293 | return -EPROTO; | 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 | mutex_unlock(&dev->device_lock); | 2328 | mutex_unlock(&dev->device_lock); |
| 2329 | wait_event_timeout(cl->wait, | 2329 | wait_event_timeout(cl->wait, |
| 2330 | cl->dma_mapped || | 2330 | cl->dma_mapped || cl->status, |
| 2331 | cl->status || | ||
| 2332 | !mei_cl_is_connected(cl), | ||
| 2333 | mei_secs_to_jiffies(MEI_CL_CONNECT_TIMEOUT)); | 2331 | mei_secs_to_jiffies(MEI_CL_CONNECT_TIMEOUT)); |
| 2334 | mutex_lock(&dev->device_lock); | 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 | return -EOPNOTSUPP; | 2374 | return -EOPNOTSUPP; |
| 2377 | } | 2375 | } |
| 2378 | 2376 | ||
| 2379 | if (!mei_cl_is_connected(cl)) | 2377 | /* do not allow unmap for connected client */ |
| 2380 | return -ENODEV; | 2378 | if (mei_cl_is_connected(cl)) |
| 2379 | return -EPROTO; | ||
| 2381 | 2380 | ||
| 2382 | if (!cl->dma_mapped) | 2381 | if (!cl->dma_mapped) |
| 2383 | return -EPROTO; | 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 | mutex_unlock(&dev->device_lock); | 2405 | mutex_unlock(&dev->device_lock); |
| 2407 | wait_event_timeout(cl->wait, | 2406 | wait_event_timeout(cl->wait, |
| 2408 | !cl->dma_mapped || | 2407 | !cl->dma_mapped || cl->status, |
| 2409 | cl->status || | ||
| 2410 | !mei_cl_is_connected(cl), | ||
| 2411 | mei_secs_to_jiffies(MEI_CL_CONNECT_TIMEOUT)); | 2408 | mei_secs_to_jiffies(MEI_CL_CONNECT_TIMEOUT)); |
| 2412 | mutex_lock(&dev->device_lock); | 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 | { .compatible = "qemu,pvpanic-mmio", }, | 140 | { .compatible = "qemu,pvpanic-mmio", }, |
| 141 | {} | 141 | {} |
| 142 | }; | 142 | }; |
| 143 | MODULE_DEVICE_TABLE(of, pvpanic_mmio_match); | ||
| 143 | 144 | ||
| 144 | static const struct acpi_device_id pvpanic_device_ids[] = { | 145 | static const struct acpi_device_id pvpanic_device_ids[] = { |
| 145 | { "QEMU0001", 0 }, | 146 | { "QEMU0001", 0 }, |
| @@ -399,11 +399,6 @@ void mmc_remove_card(struct mmc_card *card) · 398 unmodified lines | |||
| 399 | mmc_remove_card_debugfs(card); | 399 | mmc_remove_card_debugfs(card); |
| 400 | #endif | 400 | #endif |
| 401 | 401 | ||
| 402 | if (host->cqe_enabled) { | ||
| 403 | host->cqe_ops->cqe_disable(host); | ||
| 404 | host->cqe_enabled = false; | ||
| 405 | } | ||
| 406 | |||
| 407 | if (mmc_card_present(card)) { | 402 | if (mmc_card_present(card)) { |
| 408 | if (mmc_host_is_spi(card->host)) { | 403 | if (mmc_host_is_spi(card->host)) { |
| 409 | pr_info("%s: SPI card removed\n", | 404 | pr_info("%s: SPI card removed\n", |
| @@ -416,6 +411,10 @@ void mmc_remove_card(struct mmc_card *card) · 6 unmodified lines | |||
| 416 | of_node_put(card->dev.of_node); | 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 | put_device(&card->dev); | 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 | /* EXT_CSD value is in units of 10ms, but we store in ms */ | 424 | /* EXT_CSD value is in units of 10ms, but we store in ms */ |
| 425 | card->ext_csd.part_time = 10 * ext_csd[EXT_CSD_PART_SWITCH_TIME]; | 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 | /* Sleep / awake timeout in 100ns units */ | 427 | /* Sleep / awake timeout in 100ns units */ |
| 432 | if (sa_shift > 0 && sa_shift <= 0x17) | 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 | card->ext_csd.data_sector_size = 512; | 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 | /* eMMC v5 or later */ | 626 | /* eMMC v5 or later */ |
| 620 | if (card->ext_csd.rev >= 7) { | 627 | if (card->ext_csd.rev >= 7) { |
| 621 | memcpy(card->ext_csd.fwrev, &ext_csd[EXT_CSD_FIRMWARE_VERSION], | 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 | if (!cmd->busy_timeout) | 1242 | if (!cmd->busy_timeout) |
| 1243 | cmd->busy_timeout = 10 * MSEC_PER_SEC; | 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 | do_div(clks, MSEC_PER_SEC); | 1250 | do_div(clks, MSEC_PER_SEC); |
| 1247 | writel_relaxed(clks, host->base + MMCIDATATIMER); | 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 | mmc->caps |= MMC_CAP_WAIT_WHILE_BUSY; | 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 | /* Prepare a CMD12 - needed to clear the DPSM on some variants. */ | 2162 | /* Prepare a CMD12 - needed to clear the DPSM on some variants. */ |
| 2155 | host->stop_abort.opcode = MMC_STOP_TRANSMISSION; | 2163 | host->stop_abort.opcode = MMC_STOP_TRANSMISSION; |
| 2156 | host->stop_abort.arg = 0; | 2164 | host->stop_abort.arg = 0; |
| @@ -32,7 +32,6 @@ · 31 unmodified lines | |||
| 32 | 32 | ||
| 33 | MODULE_AUTHOR("Eric Brower <ebrower@usa.net>"); | 33 | MODULE_AUTHOR("Eric Brower <ebrower@usa.net>"); |
| 34 | MODULE_DESCRIPTION("User-programmable flash device on Sun Microsystems boardsets"); | 34 | MODULE_DESCRIPTION("User-programmable flash device on Sun Microsystems boardsets"); |
| 35 | MODULE_SUPPORTED_DEVICE(DRIVER_NAME); | ||
| 36 | MODULE_LICENSE("GPL"); | 35 | MODULE_LICENSE("GPL"); |
| 37 | MODULE_VERSION("2.1"); | 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 | return 0; | 488 | return 0; |
| 489 | case NAND_OP_WAITRDY_INSTR: | 489 | case NAND_OP_WAITRDY_INSTR: |
| 490 | return readl_poll_timeout(nfc->regs + NFI_STA, status, | 490 | return readl_poll_timeout(nfc->regs + NFI_STA, status, |
| 491 | status & STA_BUSY, 20, | 491 | !(status & STA_BUSY), 20, |
| 492 | instr->ctx.waitrdy.timeout_ms); | 492 | instr->ctx.waitrdy.timeout_ms * 1000); |
| 493 | default: | 493 | default: |
| 494 | break; | 494 | break; |
| 495 | } | 495 | } |
| @@ -94,7 +94,7 @@ config WIREGUARD · 93 unmodified lines | |||
| 94 | select CRYPTO_BLAKE2S_ARM if ARM | 94 | select CRYPTO_BLAKE2S_ARM if ARM |
| 95 | select CRYPTO_CURVE25519_NEON if ARM && KERNEL_MODE_NEON | 95 | select CRYPTO_CURVE25519_NEON if ARM && KERNEL_MODE_NEON |
| 96 | select CRYPTO_CHACHA_MIPS if CPU_MIPS32_R2 | 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 | help | 98 | help |
| 99 | WireGuard is a secure, fast, and easy to use replacement for IPSec | 99 | WireGuard is a secure, fast, and easy to use replacement for IPSec |
| 100 | that uses modern cryptography and clever networking tricks. It's | 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 | int i, ioaddr, ret; | 127 | int i, ioaddr, ret; |
| 128 | struct resource *r; | 128 | struct resource *r; |
| 129 | 129 | ||
| 130 | ret = 0; | ||
| 131 | |||
| 130 | if (pci_enable_device(pdev)) | 132 | if (pci_enable_device(pdev)) |
| 131 | return -EIO; | 133 | return -EIO; |
| 132 | 134 | ||
| @@ -139,6 +141,8 @@ static int com20020pci_probe(struct pci_dev *pdev, · 6 unmodified lines | |||
| 139 | priv->ci = ci; | 141 | priv->ci = ci; |
| 140 | mm = &ci->misc_map; | 142 | mm = &ci->misc_map; |
| 141 | 143 | ||
| 144 | pci_set_drvdata(pdev, priv); | ||
| 145 | |||
| 142 | INIT_LIST_HEAD(&priv->list_dev); | 146 | INIT_LIST_HEAD(&priv->list_dev); |
| 143 | 147 | ||
| 144 | if (mm->size) { | 148 | if (mm->size) { |
| @@ -161,7 +165,7 @@ static int com20020pci_probe(struct pci_dev *pdev, · 16 unmodified lines | |||
| 161 | dev = alloc_arcdev(device); | 165 | dev = alloc_arcdev(device); |
| 162 | if (!dev) { | 166 | if (!dev) { |
| 163 | ret = -ENOMEM; | 167 | ret = -ENOMEM; |
| 164 | goto out_port; | 168 | break; |
| 165 | } | 169 | } |
| 166 | dev->dev_port = i; | 170 | dev->dev_port = i; |
| 167 | 171 | ||
| @@ -178,7 +182,7 @@ static int com20020pci_probe(struct pci_dev *pdev, · 10 unmodified lines | |||
| 178 | pr_err("IO region %xh-%xh already allocated\n", | 182 | pr_err("IO region %xh-%xh already allocated\n", |
| 179 | ioaddr, ioaddr + cm->size - 1); | 183 | ioaddr, ioaddr + cm->size - 1); |
| 180 | ret = -EBUSY; | 184 | ret = -EBUSY; |
| 181 | goto out_port; | 185 | goto err_free_arcdev; |
| 182 | } | 186 | } |
| 183 | 187 | ||
| 184 | /* Dummy access after Reset | 188 | /* Dummy access after Reset |
| @@ -216,18 +220,18 @@ static int com20020pci_probe(struct pci_dev *pdev, · 31 unmodified lines | |||
| 216 | if (arcnet_inb(ioaddr, COM20020_REG_R_STATUS) == 0xFF) { | 220 | if (arcnet_inb(ioaddr, COM20020_REG_R_STATUS) == 0xFF) { |
| 217 | pr_err("IO address %Xh is empty!\n", ioaddr); | 221 | pr_err("IO address %Xh is empty!\n", ioaddr); |
| 218 | ret = -EIO; | 222 | ret = -EIO; |
| 219 | goto out_port; | 223 | goto err_free_arcdev; |
| 220 | } | 224 | } |
| 221 | if (com20020_check(dev)) { | 225 | if (com20020_check(dev)) { |
| 222 | ret = -EIO; | 226 | ret = -EIO; |
| 223 | goto out_port; | 227 | goto err_free_arcdev; |
| 224 | } | 228 | } |
| 225 | 229 | ||
| 226 | card = devm_kzalloc(&pdev->dev, sizeof(struct com20020_dev), | 230 | card = devm_kzalloc(&pdev->dev, sizeof(struct com20020_dev), |
| 227 | GFP_KERNEL); | 231 | GFP_KERNEL); |
| 228 | if (!card) { | 232 | if (!card) { |
| 229 | ret = -ENOMEM; | 233 | ret = -ENOMEM; |
| 230 | goto out_port; | 234 | goto err_free_arcdev; |
| 231 | } | 235 | } |
| 232 | 236 | ||
| 233 | card->index = i; | 237 | card->index = i; |
| @@ -253,29 +257,29 @@ static int com20020pci_probe(struct pci_dev *pdev, · 19 unmodified lines | |||
| 253 | 257 | ||
| 254 | ret = devm_led_classdev_register(&pdev->dev, &card->tx_led); | 258 | ret = devm_led_classdev_register(&pdev->dev, &card->tx_led); |
| 255 | if (ret) | 259 | if (ret) |
| 256 | goto out_port; | 260 | goto err_free_arcdev; |
| 257 | 261 | ||
| 258 | ret = devm_led_classdev_register(&pdev->dev, &card->recon_led); | 262 | ret = devm_led_classdev_register(&pdev->dev, &card->recon_led); |
| 259 | if (ret) | 263 | if (ret) |
| 260 | goto out_port; | 264 | goto err_free_arcdev; |
| 261 | 265 | ||
| 262 | dev_set_drvdata(&dev->dev, card); | 266 | dev_set_drvdata(&dev->dev, card); |
| 263 | 267 | ||
| 264 | ret = com20020_found(dev, IRQF_SHARED); | 268 | ret = com20020_found(dev, IRQF_SHARED); |
| 265 | if (ret) | 269 | if (ret) |
| 266 | goto out_port; | 270 | goto err_free_arcdev; |
| 267 | 271 | ||
| 268 | devm_arcnet_led_init(dev, dev->dev_id, i); | 272 | devm_arcnet_led_init(dev, dev->dev_id, i); |
| 269 | 273 | ||
| 270 | list_add(&card->list, &priv->list_dev); | 274 | list_add(&card->list, &priv->list_dev); |
| 271 | } | 275 | continue; |
| 272 | 276 | ||
| 273 | pci_set_drvdata(pdev, priv); | 277 | err_free_arcdev: |
| 274 | 278 | free_arcdev(dev); | |
| 275 | return 0; | 279 | break; |
| 276 | 280 | } | |
| 277 | out_port: | 281 | if (ret) |
| 278 | com20020pci_remove(pdev); | 282 | com20020pci_remove(pdev); |
| 279 | return ret; | 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 | .brp_inc = 1, | 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 | static inline void c_can_pm_runtime_get_sync(const struct c_can_priv *priv) | 215 | static inline void c_can_pm_runtime_get_sync(const struct c_can_priv *priv) |
| 228 | { | 216 | { |
| 229 | if (priv->device) | 217 | if (priv->device) |
| @@ -1335,7 +1323,6 @@ static const struct net_device_ops c_can_netdev_ops = { · 1105 unmodified lines | |||
| 1335 | 1323 | ||
| 1336 | int register_c_can_dev(struct net_device *dev) | 1324 | int register_c_can_dev(struct net_device *dev) |
| 1337 | { | 1325 | { |
| 1338 | struct c_can_priv *priv = netdev_priv(dev); | ||
| 1339 | int err; | 1326 | int err; |
| 1340 | 1327 | ||
| 1341 | /* Deactivate pins to prevent DRA7 DCAN IP from being | 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 | pinctrl_pm_select_sleep_state(dev->dev.parent); | 1333 | pinctrl_pm_select_sleep_state(dev->dev.parent); |
| 1347 | 1334 | ||
| 1348 | c_can_pm_runtime_enable(priv); | ||
| 1349 | |||
| 1350 | dev->flags |= IFF_ECHO; /* we support local echo */ | 1335 | dev->flags |= IFF_ECHO; /* we support local echo */ |
| 1351 | dev->netdev_ops = &c_can_netdev_ops; | 1336 | dev->netdev_ops = &c_can_netdev_ops; |
| 1352 | 1337 | ||
| 1353 | err = register_candev(dev); | 1338 | err = register_candev(dev); |
| 1354 | if (err) | 1339 | if (!err) |
| 1355 | c_can_pm_runtime_disable(priv); | ||
| 1356 | else | ||
| 1357 | devm_can_led_init(dev); | 1340 | devm_can_led_init(dev); |
| 1358 | |||
| 1359 | return err; | 1341 | return err; |
| 1360 | } | 1342 | } |
| 1361 | EXPORT_SYMBOL_GPL(register_c_can_dev); | 1343 | EXPORT_SYMBOL_GPL(register_c_can_dev); |
| 1362 | 1344 | ||
| 1363 | void unregister_c_can_dev(struct net_device *dev) | 1345 | void unregister_c_can_dev(struct net_device *dev) |
| 1364 | { | 1346 | { |
| 1365 | struct c_can_priv *priv = netdev_priv(dev); | ||
| 1366 | |||
| 1367 | unregister_candev(dev); | 1347 | unregister_candev(dev); |
| 1368 | |||
| 1369 | c_can_pm_runtime_disable(priv); | ||
| 1370 | } | 1348 | } |
| 1371 | EXPORT_SYMBOL_GPL(unregister_c_can_dev); | 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 | struct net_device *dev = pci_get_drvdata(pdev); | 240 | struct net_device *dev = pci_get_drvdata(pdev); |
| 241 | struct c_can_priv *priv = netdev_priv(dev); | 241 | struct c_can_priv *priv = netdev_priv(dev); |
| 242 | void __iomem *addr = priv->base; | ||
| 242 | 243 | ||
| 243 | unregister_c_can_dev(dev); | 244 | unregister_c_can_dev(dev); |
| 244 | 245 | ||
| 245 | free_c_can_dev(dev); | 246 | free_c_can_dev(dev); |
| 246 | 247 | ||
| 247 | pci_iounmap(pdev, priv->base); | 248 | pci_iounmap(pdev, addr); |
| 248 | pci_disable_msi(pdev); | 249 | pci_disable_msi(pdev); |
| 249 | pci_clear_master(pdev); | 250 | pci_clear_master(pdev); |
| 250 | pci_release_regions(pdev); | 251 | pci_release_regions(pdev); |
| @@ -29,6 +29,7 @@ · 28 unmodified lines | |||
| 29 | #include <linux/list.h> | 29 | #include <linux/list.h> |
| 30 | #include <linux/io.h> | 30 | #include <linux/io.h> |
| 31 | #include <linux/platform_device.h> | 31 | #include <linux/platform_device.h> |
| 32 | #include <linux/pm_runtime.h> | ||
| 32 | #include <linux/clk.h> | 33 | #include <linux/clk.h> |
| 33 | #include <linux/of.h> | 34 | #include <linux/of.h> |
| 34 | #include <linux/of_device.h> | 35 | #include <linux/of_device.h> |
| @@ -386,6 +387,7 @@ static int c_can_plat_probe(struct platform_device *pdev) · 351 unmodified lines | |||
| 386 | platform_set_drvdata(pdev, dev); | 387 | platform_set_drvdata(pdev, dev); |
| 387 | SET_NETDEV_DEV(dev, &pdev->dev); | 388 | SET_NETDEV_DEV(dev, &pdev->dev); |
| 388 | 389 | ||
| 390 | pm_runtime_enable(priv->device); | ||
| 389 | ret = register_c_can_dev(dev); | 391 | ret = register_c_can_dev(dev); |
| 390 | if (ret) { | 392 | if (ret) { |
| 391 | dev_err(&pdev->dev, "registering %s failed (err=%d)\n", | 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 | return 0; | 400 | return 0; |
| 399 | 401 | ||
| 400 | exit_free_device: | 402 | exit_free_device: |
| 403 | pm_runtime_disable(priv->device); | ||
| 401 | free_c_can_dev(dev); | 404 | free_c_can_dev(dev); |
| 402 | exit: | 405 | exit: |
| 403 | dev_err(&pdev->dev, "probe failed\n"); | 406 | dev_err(&pdev->dev, "probe failed\n"); |
| @@ -408,9 +411,10 @@ exit: · 4 unmodified lines | |||
| 408 | static int c_can_plat_remove(struct platform_device *pdev) | 411 | static int c_can_plat_remove(struct platform_device *pdev) |
| 409 | { | 412 | { |
| 410 | struct net_device *dev = platform_get_drvdata(pdev); | 413 | struct net_device *dev = platform_get_drvdata(pdev); |
| 414 | struct c_can_priv *priv = netdev_priv(dev); | ||
| 411 | 415 | ||
| 412 | unregister_c_can_dev(dev); | 416 | unregister_c_can_dev(dev); |
| 413 | 417 | pm_runtime_disable(priv->device); | |
| 414 | free_c_can_dev(dev); | 418 | free_c_can_dev(dev); |
| 415 | 419 | ||
| 416 | return 0; | 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 | struct rtnl_link_ops can_link_ops __read_mostly = { | 356 | struct rtnl_link_ops can_link_ops __read_mostly = { |
| 357 | .kind = "can", | 357 | .kind = "can", |
| 358 | .netns_refund = true, | ||
| 358 | .maxtype = IFLA_CAN_MAX, | 359 | .maxtype = IFLA_CAN_MAX, |
| 359 | .policy = can_policy, | 360 | .policy = can_policy, |
| 360 | .setup = can_setup, | 361 | .setup = can_setup, |
| @@ -697,11 +697,17 @@ static int flexcan_chip_disable(struct flexcan_priv *priv) · 696 unmodified lines | |||
| 697 | static int flexcan_chip_freeze(struct flexcan_priv *priv) | 697 | static int flexcan_chip_freeze(struct flexcan_priv *priv) |
| 698 | { | 698 | { |
| 699 | struct flexcan_regs __iomem *regs = priv->regs; | 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 | u32 reg; | 702 | u32 reg; |
| 702 | 703 | ||
| 704 | if (bitrate) | ||
| 705 | timeout = 1000 * 1000 * 10 / bitrate; | ||
| 706 | else | ||
| 707 | timeout = FLEXCAN_TIMEOUT_US / 10; | ||
| 708 | |||
| 703 | reg = priv->read(®s->mcr); | 709 | reg = priv->read(®s->mcr); |
| 704 | reg |= FLEXCAN_MCR_HALT; | 710 | reg |= FLEXCAN_MCR_FRZ | FLEXCAN_MCR_HALT; |
| 705 | priv->write(reg, ®s->mcr); | 711 | priv->write(reg, ®s->mcr); |
| 706 | 712 | ||
| 707 | while (timeout-- && !(priv->read(®s->mcr) & FLEXCAN_MCR_FRZ_ACK)) | 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 | flexcan_set_bittiming(dev); | 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 | /* MCR | 1494 | /* MCR |
| 1484 | * | 1495 | * |
| 1485 | * enable freeze | ||
| 1486 | * halt now | ||
| 1487 | * only supervisor access | 1496 | * only supervisor access |
| 1488 | * enable warning int | 1497 | * enable warning int |
| 1489 | * enable individual RX masking | 1498 | * enable individual RX masking |
| @@ -1492,9 +1501,8 @@ static int flexcan_chip_start(struct net_device *dev) · 2 unmodified lines | |||
| 1492 | */ | 1501 | */ |
| 1493 | reg_mcr = priv->read(®s->mcr); | 1502 | reg_mcr = priv->read(®s->mcr); |
| 1494 | reg_mcr &= ~FLEXCAN_MCR_MAXMB(0xff); | 1503 | reg_mcr &= ~FLEXCAN_MCR_MAXMB(0xff); |
| 1495 | reg_mcr |= FLEXCAN_MCR_FRZ | FLEXCAN_MCR_HALT | FLEXCAN_MCR_SUPV | | 1504 | reg_mcr |= FLEXCAN_MCR_SUPV | FLEXCAN_MCR_WRN_EN | FLEXCAN_MCR_IRMQ | |
| 1496 | FLEXCAN_MCR_WRN_EN | FLEXCAN_MCR_IRMQ | FLEXCAN_MCR_IDAM_C | | 1505 | FLEXCAN_MCR_IDAM_C | FLEXCAN_MCR_MAXMB(priv->tx_mb_idx); |
| 1497 | FLEXCAN_MCR_MAXMB(priv->tx_mb_idx); | ||
| 1498 | 1506 | ||
| 1499 | /* MCR | 1507 | /* MCR |
| 1500 | * | 1508 | * |
| @@ -1865,10 +1873,14 @@ static int register_flexcandev(struct net_device *dev) · 364 unmodified lines | |||
| 1865 | if (err) | 1873 | if (err) |
| 1866 | goto out_chip_disable; | 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 | reg = priv->read(®s->mcr); | 1882 | reg = priv->read(®s->mcr); |
| 1870 | reg |= FLEXCAN_MCR_FRZ | FLEXCAN_MCR_HALT | | 1883 | reg |= FLEXCAN_MCR_FEN | FLEXCAN_MCR_SUPV; |
| 1871 | FLEXCAN_MCR_FEN | FLEXCAN_MCR_SUPV; | ||
| 1872 | priv->write(reg, ®s->mcr); | 1884 | priv->write(reg, ®s->mcr); |
| 1873 | 1885 | ||
| 1874 | /* Currently we only support newer versions of this core | 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 | #define KVASER_PCIEFD_KCAN_STAT_REG 0x418 | 57 | #define KVASER_PCIEFD_KCAN_STAT_REG 0x418 |
| 58 | #define KVASER_PCIEFD_KCAN_MODE_REG 0x41c | 58 | #define KVASER_PCIEFD_KCAN_MODE_REG 0x41c |
| 59 | #define KVASER_PCIEFD_KCAN_BTRN_REG 0x420 | 59 | #define KVASER_PCIEFD_KCAN_BTRN_REG 0x420 |
| 60 | #define KVASER_PCIEFD_KCAN_BUS_LOAD_REG 0x424 | ||
| 60 | #define KVASER_PCIEFD_KCAN_BTRD_REG 0x428 | 61 | #define KVASER_PCIEFD_KCAN_BTRD_REG 0x428 |
| 61 | #define KVASER_PCIEFD_KCAN_PWM_REG 0x430 | 62 | #define KVASER_PCIEFD_KCAN_PWM_REG 0x430 |
| 62 | /* Loopback control register */ | 63 | /* Loopback control register */ |
| @@ -949,6 +950,9 @@ static int kvaser_pciefd_setup_can_ctrls(struct kvaser_pciefd *pcie) · 886 unmodified lines | |||
| 949 | timer_setup(&can->bec_poll_timer, kvaser_pciefd_bec_poll_timer, | 950 | timer_setup(&can->bec_poll_timer, kvaser_pciefd_bec_poll_timer, |
| 950 | 0); | 951 | 0); |
| 951 | 952 | ||
| 953 | /* Disable Bus load reporting */ | ||
| 954 | iowrite32(0, can->reg_base + KVASER_PCIEFD_KCAN_BUS_LOAD_REG); | ||
| 955 | |||
| 952 | tx_npackets = ioread32(can->reg_base + | 956 | tx_npackets = ioread32(can->reg_base + |
| 953 | KVASER_PCIEFD_KCAN_TX_NPACKETS_REG); | 957 | KVASER_PCIEFD_KCAN_TX_NPACKETS_REG); |
| 954 | if (((tx_npackets >> KVASER_PCIEFD_KCAN_TX_NPACKETS_MAX_SHIFT) & | 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 | while ((rxfs & RXFS_FFL_MASK) && (quota > 0)) { | 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 | m_can_read_fifo(dev, rxfs); | 504 | m_can_read_fifo(dev, rxfs); |
| 508 | 505 | ||
| 509 | quota--; | 506 | quota--; |
| @@ -876,7 +873,7 @@ static int m_can_rx_peripheral(struct net_device *dev) · 366 unmodified lines | |||
| 876 | { | 873 | { |
| 877 | struct m_can_classdev *cdev = netdev_priv(dev); | 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 | m_can_enable_all_interrupts(cdev); | 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 | if (ret) | 237 | if (ret) |
| 238 | return ret; | 238 | return ret; |
| 239 | 239 | ||
| 240 | /* Zero out the MCAN buffers */ | ||
| 241 | m_can_init_ram(cdev); | ||
| 242 | |||
| 240 | ret = regmap_update_bits(tcan4x5x->regmap, TCAN4X5X_CONFIG, | 243 | ret = regmap_update_bits(tcan4x5x->regmap, TCAN4X5X_CONFIG, |
| 241 | TCAN4X5X_MODE_SEL_MASK, TCAN4X5X_MODE_NORMAL); | 244 | TCAN4X5X_MODE_SEL_MASK, TCAN4X5X_MODE_NORMAL); |
| 242 | if (ret) | 245 | if (ret) |
| 243 | return ret; | 246 | return ret; |
| 244 | 247 | ||
| 245 | /* Zero out the MCAN buffers */ | ||
| 246 | m_can_init_ram(cdev); | ||
| 247 | |||
| 248 | return ret; | 248 | return ret; |
| 249 | } | 249 | } |
| 250 | 250 | ||
| @@ -21,7 +21,6 @@ · 20 unmodified lines | |||
| 21 | 21 | ||
| 22 | MODULE_AUTHOR("Stephane Grosjean <s.grosjean@peak-system.com>"); | 22 | MODULE_AUTHOR("Stephane Grosjean <s.grosjean@peak-system.com>"); |
| 23 | MODULE_DESCRIPTION("Socket-CAN driver for PEAK PCAN PCIe/M.2 FD family cards"); | 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 | MODULE_LICENSE("GPL v2"); | 24 | MODULE_LICENSE("GPL v2"); |
| 26 | 25 | ||
| 27 | #define PCIEFD_DRV_NAME "peak_pciefd" | 26 | #define PCIEFD_DRV_NAME "peak_pciefd" |
| @@ -21,7 +21,6 @@ · 20 unmodified lines | |||
| 21 | 21 | ||
| 22 | MODULE_AUTHOR("Sebastian Haas <haas@ems-wuenche.com>"); | 22 | MODULE_AUTHOR("Sebastian Haas <haas@ems-wuenche.com>"); |
| 23 | MODULE_DESCRIPTION("Socket-CAN driver for EMS CPC-PCI/PCIe/104P CAN cards"); | 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 | MODULE_LICENSE("GPL v2"); | 24 | MODULE_LICENSE("GPL v2"); |
| 26 | 25 | ||
| 27 | #define EMS_PCI_V1_MAX_CHAN 2 | 26 | #define EMS_PCI_V1_MAX_CHAN 2 |
| @@ -21,7 +21,6 @@ · 20 unmodified lines | |||
| 21 | 21 | ||
| 22 | MODULE_AUTHOR("Markus Plessing <plessing@ems-wuensche.com>"); | 22 | MODULE_AUTHOR("Markus Plessing <plessing@ems-wuensche.com>"); |
| 23 | MODULE_DESCRIPTION("Socket-CAN driver for EMS CPC-CARD cards"); | 23 | MODULE_DESCRIPTION("Socket-CAN driver for EMS CPC-CARD cards"); |
| 24 | MODULE_SUPPORTED_DEVICE("EMS CPC-CARD CAN card"); | ||
| 25 | MODULE_LICENSE("GPL v2"); | 24 | MODULE_LICENSE("GPL v2"); |
| 26 | 25 | ||
| 27 | #define EMS_PCMCIA_MAX_CHAN 2 | 26 | #define EMS_PCMCIA_MAX_CHAN 2 |
| @@ -33,7 +33,6 @@ · 32 unmodified lines | |||
| 33 | 33 | ||
| 34 | MODULE_AUTHOR("Per Dalen <per.dalen@cnw.se>"); | 34 | MODULE_AUTHOR("Per Dalen <per.dalen@cnw.se>"); |
| 35 | MODULE_DESCRIPTION("Socket-CAN driver for KVASER PCAN PCI cards"); | 35 | MODULE_DESCRIPTION("Socket-CAN driver for KVASER PCAN PCI cards"); |
| 36 | MODULE_SUPPORTED_DEVICE("KVASER PCAN PCI CAN card"); | ||
| 37 | MODULE_LICENSE("GPL v2"); | 36 | MODULE_LICENSE("GPL v2"); |
| 38 | 37 | ||
| 39 | #define MAX_NO_OF_CHANNELS 4 /* max no of channels on a single card */ | 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 | MODULE_AUTHOR("Stephane Grosjean <s.grosjean@peak-system.com>"); | 25 | MODULE_AUTHOR("Stephane Grosjean <s.grosjean@peak-system.com>"); |
| 26 | MODULE_DESCRIPTION("Socket-CAN driver for PEAK PCAN PCI family cards"); | 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 | MODULE_LICENSE("GPL v2"); | 27 | MODULE_LICENSE("GPL v2"); |
| 30 | 28 | ||
| 31 | #define DRV_NAME "peak_pci" | 29 | #define DRV_NAME "peak_pci" |
| @@ -22,7 +22,6 @@ · 21 unmodified lines | |||
| 22 | MODULE_AUTHOR("Stephane Grosjean <s.grosjean@peak-system.com>"); | 22 | MODULE_AUTHOR("Stephane Grosjean <s.grosjean@peak-system.com>"); |
| 23 | MODULE_DESCRIPTION("CAN driver for PEAK-System PCAN-PC Cards"); | 23 | MODULE_DESCRIPTION("CAN driver for PEAK-System PCAN-PC Cards"); |
| 24 | MODULE_LICENSE("GPL v2"); | 24 | MODULE_LICENSE("GPL v2"); |
| 25 | MODULE_SUPPORTED_DEVICE("PEAK PCAN-PC Card"); | ||
| 26 | 25 | ||
| 27 | /* PEAK-System PCMCIA driver name */ | 26 | /* PEAK-System PCMCIA driver name */ |
| 28 | #define PCC_NAME "peak_pcmcia" | 27 | #define PCC_NAME "peak_pcmcia" |
| @@ -25,18 +25,6 @@ · 24 unmodified lines | |||
| 25 | MODULE_AUTHOR("Pavel Cheblakov <P.B.Cheblakov@inp.nsk.su>"); | 25 | MODULE_AUTHOR("Pavel Cheblakov <P.B.Cheblakov@inp.nsk.su>"); |
| 26 | MODULE_DESCRIPTION("Socket-CAN driver for PLX90xx PCI-bridge cards with " | 26 | MODULE_DESCRIPTION("Socket-CAN driver for PLX90xx PCI-bridge cards with " |
| 27 | "the SJA1000 chips"); | 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 | MODULE_LICENSE("GPL v2"); | 28 | MODULE_LICENSE("GPL v2"); |
| 41 | 29 | ||
| 42 | #define PLX_PCI_MAX_CHAN 2 | 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 | return ret; | 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 | static u8 mcp251x_read_reg(struct spi_device *spi, u8 reg) | 329 | static u8 mcp251x_read_reg(struct spi_device *spi, u8 reg) |
| 318 | { | 330 | { |
| 319 | struct mcp251x_priv *priv = spi_get_drvdata(spi); | 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 | priv->spi_tx_buf[1] = reg; | 373 | priv->spi_tx_buf[1] = reg; |
| 362 | priv->spi_tx_buf[2] = val; | 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 | static void mcp251x_write_2regs(struct spi_device *spi, u8 reg, u8 v1, u8 v2) | 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 | priv->spi_tx_buf[2] = v1; | 385 | priv->spi_tx_buf[2] = v1; |
| 374 | priv->spi_tx_buf[3] = v2; | 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 | static void mcp251x_write_bits(struct spi_device *spi, u8 reg, | 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 | priv->spi_tx_buf[2] = mask; | 398 | priv->spi_tx_buf[2] = mask; |
| 387 | priv->spi_tx_buf[3] = val; | 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 | static u8 mcp251x_read_stat(struct spi_device *spi) | 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 | buf[i]); | 630 | buf[i]); |
| 619 | } else { | 631 | } else { |
| 620 | memcpy(priv->spi_tx_buf, buf, TXBDAT_OFF + len); | 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 | /* use INSTRUCTION_RTS, to avoid "repeated frame problem" */ | 663 | /* use INSTRUCTION_RTS, to avoid "repeated frame problem" */ |
| 652 | priv->spi_tx_buf[0] = INSTRUCTION_RTS(1 << tx_buf_idx); | 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 | static void mcp251x_hw_rx_frame(struct spi_device *spi, u8 *buf, | 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 | mdelay(MCP251X_OST_DELAY_MS); | 900 | mdelay(MCP251X_OST_DELAY_MS); |
| 889 | 901 | ||
| 890 | priv->spi_tx_buf[0] = INSTRUCTION_RESET; | 902 | priv->spi_tx_buf[0] = INSTRUCTION_RESET; |
| 891 | ret = mcp251x_spi_trans(spi, 1); | 903 | ret = mcp251x_spi_write(spi, 1); |
| 892 | if (ret) | 904 | if (ret) |
| 893 | return ret; | 905 | return ret; |
| 894 | 906 | ||
| @@ -335,8 +335,6 @@ static void mcp251xfd_ring_init(struct mcp251xfd_priv *priv) · 334 unmodified lines | |||
| 335 | u8 len; | 335 | u8 len; |
| 336 | int i, j; | 336 | int i, j; |
| 337 | 337 | ||
| 338 | netdev_reset_queue(priv->ndev); | ||
| 339 | |||
| 340 | /* TEF */ | 338 | /* TEF */ |
| 341 | tef_ring = priv->tef; | 339 | tef_ring = priv->tef; |
| 342 | tef_ring->head = 0; | 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 | static int | 1248 | static int |
| 1251 | mcp251xfd_handle_tefif_one(struct mcp251xfd_priv *priv, | 1249 | mcp251xfd_handle_tefif_one(struct mcp251xfd_priv *priv, |
| 1252 | const struct mcp251xfd_hw_tef_obj *hw_tef_obj, | 1250 | const struct mcp251xfd_hw_tef_obj *hw_tef_obj) |
| 1253 | unsigned int *frame_len_ptr) | ||
| 1254 | { | 1251 | { |
| 1255 | struct net_device_stats *stats = &priv->ndev->stats; | 1252 | struct net_device_stats *stats = &priv->ndev->stats; |
| 1256 | u32 seq, seq_masked, tef_tail_masked; | 1253 | u32 seq, seq_masked, tef_tail_masked; |
| @@ -1272,8 +1269,7 @@ mcp251xfd_handle_tefif_one(struct mcp251xfd_priv *priv, · 15 unmodified lines | |||
| 1272 | stats->tx_bytes += | 1269 | stats->tx_bytes += |
| 1273 | can_rx_offload_get_echo_skb(&priv->offload, | 1270 | can_rx_offload_get_echo_skb(&priv->offload, |
| 1274 | mcp251xfd_get_tef_tail(priv), | 1271 | mcp251xfd_get_tef_tail(priv), |
| 1275 | hw_tef_obj->ts, | 1272 | hw_tef_obj->ts, NULL); |
| 1276 | frame_len_ptr); | ||
| 1277 | stats->tx_packets++; | 1273 | stats->tx_packets++; |
| 1278 | priv->tef->tail++; | 1274 | priv->tef->tail++; |
| 1279 | 1275 | ||
| @@ -1331,7 +1327,6 @@ mcp251xfd_tef_obj_read(const struct mcp251xfd_priv *priv, · 51 unmodified lines | |||
| 1331 | static int mcp251xfd_handle_tefif(struct mcp251xfd_priv *priv) | 1327 | static int mcp251xfd_handle_tefif(struct mcp251xfd_priv *priv) |
| 1332 | { | 1328 | { |
| 1333 | struct mcp251xfd_hw_tef_obj hw_tef_obj[MCP251XFD_TX_OBJ_NUM_MAX]; | 1329 | struct mcp251xfd_hw_tef_obj hw_tef_obj[MCP251XFD_TX_OBJ_NUM_MAX]; |
| 1334 | unsigned int total_frame_len = 0; | ||
| 1335 | u8 tef_tail, len, l; | 1330 | u8 tef_tail, len, l; |
| 1336 | int err, i; | 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 | for (i = 0; i < len; i++) { | 1350 | for (i = 0; i < len; i++) { |
| 1356 | unsigned int frame_len; | 1351 | err = mcp251xfd_handle_tefif_one(priv, &hw_tef_obj[i]); |
| 1357 | |||
| 1358 | err = mcp251xfd_handle_tefif_one(priv, &hw_tef_obj[i], &frame_len); | ||
| 1359 | /* -EAGAIN means the Sequence Number in the TEF | 1352 | /* -EAGAIN means the Sequence Number in the TEF |
| 1360 | * doesn't match our tef_tail. This can happen if we | 1353 | * doesn't match our tef_tail. This can happen if we |
| 1361 | * read the TEF objects too early. Leave loop let the | 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 | goto out_netif_wake_queue; | 1358 | goto out_netif_wake_queue; |
| 1366 | if (err) | 1359 | if (err) |
| 1367 | return err; | 1360 | return err; |
| 1368 | |||
| 1369 | total_frame_len += frame_len; | ||
| 1370 | } | 1361 | } |
| 1371 | 1362 | ||
| 1372 | out_netif_wake_queue: | 1363 | out_netif_wake_queue: |
| @@ -1397,7 +1388,6 @@ static int mcp251xfd_handle_tefif(struct mcp251xfd_priv *priv) · 24 unmodified lines | |||
| 1397 | return err; | 1388 | return err; |
| 1398 | 1389 | ||
| 1399 | tx_ring->tail += len; | 1390 | tx_ring->tail += len; |
| 1400 | netdev_completed_queue(priv->ndev, len, total_frame_len); | ||
| 1401 | 1391 | ||
| 1402 | err = mcp251xfd_check_tef_tail(priv); | 1392 | err = mcp251xfd_check_tef_tail(priv); |
| 1403 | if (err) | 1393 | if (err) |
| @@ -2443,7 +2433,6 @@ static netdev_tx_t mcp251xfd_start_xmit(struct sk_buff *skb, · 1039 unmodified lines | |||
| 2443 | struct mcp251xfd_priv *priv = netdev_priv(ndev); | 2433 | struct mcp251xfd_priv *priv = netdev_priv(ndev); |
| 2444 | struct mcp251xfd_tx_ring *tx_ring = priv->tx; | 2434 | struct mcp251xfd_tx_ring *tx_ring = priv->tx; |
| 2445 | struct mcp251xfd_tx_obj *tx_obj; | 2435 | struct mcp251xfd_tx_obj *tx_obj; |
| 2446 | unsigned int frame_len; | ||
| 2447 | u8 tx_head; | 2436 | u8 tx_head; |
| 2448 | int err; | 2437 | int err; |
| 2449 | 2438 | ||
| @@ -2462,9 +2451,7 @@ static netdev_tx_t mcp251xfd_start_xmit(struct sk_buff *skb, · 12 unmodified lines | |||
| 2462 | if (mcp251xfd_get_tx_free(tx_ring) == 0) | 2451 | if (mcp251xfd_get_tx_free(tx_ring) == 0) |
| 2463 | netif_stop_queue(ndev); | 2452 | netif_stop_queue(ndev); |
| 2464 | 2453 | ||
| 2465 | frame_len = can_skb_get_frame_len(skb); | 2454 | can_put_echo_skb(skb, ndev, tx_head, 0); |
| 2466 | can_put_echo_skb(skb, ndev, tx_head, frame_len); | ||
| 2467 | netdev_sent_queue(priv->ndev, frame_len); | ||
| 2468 | 2455 | ||
| 2469 | err = mcp251xfd_tx_obj_write(priv, tx_obj); | 2456 | err = mcp251xfd_tx_obj_write(priv, tx_obj); |
| 2470 | if (err) | 2457 | if (err) |
| @@ -73,6 +73,7 @@ config CAN_KVASER_USB · 72 unmodified lines | |||
| 73 | - Kvaser Memorator Pro 5xHS | 73 | - Kvaser Memorator Pro 5xHS |
| 74 | - Kvaser USBcan Light 4xHS | 74 | - Kvaser USBcan Light 4xHS |
| 75 | - Kvaser USBcan Pro 2xHS v2 | 75 | - Kvaser USBcan Pro 2xHS v2 |
| 76 | - Kvaser USBcan Pro 4xHS | ||
| 76 | - Kvaser USBcan Pro 5xHS | 77 | - Kvaser USBcan Pro 5xHS |
| 77 | - Kvaser U100 | 78 | - Kvaser U100 |
| 78 | - Kvaser U100P | 79 | - Kvaser U100P |
| @@ -86,8 +86,9 @@ · 85 unmodified lines | |||
| 86 | #define USB_U100_PRODUCT_ID 273 | 86 | #define USB_U100_PRODUCT_ID 273 |
| 87 | #define USB_U100P_PRODUCT_ID 274 | 87 | #define USB_U100P_PRODUCT_ID 274 |
| 88 | #define USB_U100S_PRODUCT_ID 275 | 88 | #define USB_U100S_PRODUCT_ID 275 |
| 89 | #define USB_USBCAN_PRO_4HS_PRODUCT_ID 276 | ||
| 89 | #define USB_HYDRA_PRODUCT_ID_END \ | 90 | #define USB_HYDRA_PRODUCT_ID_END \ |
| 90 | USB_U100S_PRODUCT_ID | 91 | USB_USBCAN_PRO_4HS_PRODUCT_ID |
| 91 | 92 | ||
| 92 | static inline bool kvaser_is_leaf(const struct usb_device_id *id) | 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 | { USB_DEVICE(KVASER_VENDOR_ID, USB_U100_PRODUCT_ID) }, | 194 | { USB_DEVICE(KVASER_VENDOR_ID, USB_U100_PRODUCT_ID) }, |
| 194 | { USB_DEVICE(KVASER_VENDOR_ID, USB_U100P_PRODUCT_ID) }, | 195 | { USB_DEVICE(KVASER_VENDOR_ID, USB_U100P_PRODUCT_ID) }, |
| 195 | { USB_DEVICE(KVASER_VENDOR_ID, USB_U100S_PRODUCT_ID) }, | 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 | MODULE_DEVICE_TABLE(usb, kvaser_usb_table); | 200 | MODULE_DEVICE_TABLE(usb, kvaser_usb_table); |
| @@ -18,8 +18,6 @@ · 17 unmodified lines | |||
| 18 | 18 | ||
| 19 | #include "pcan_usb_core.h" | 19 | #include "pcan_usb_core.h" |
| 20 | 20 | ||
| 21 | MODULE_SUPPORTED_DEVICE("PEAK-System PCAN-USB adapter"); | ||
| 22 | |||
| 23 | /* PCAN-USB Endpoints */ | 21 | /* PCAN-USB Endpoints */ |
| 24 | #define PCAN_USB_EP_CMDOUT 1 | 22 | #define PCAN_USB_EP_CMDOUT 1 |
| 25 | #define PCAN_USB_EP_CMDIN (PCAN_USB_EP_CMDOUT | USB_DIR_IN) | 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 | if (dev->adapter->dev_set_bus) { | 857 | if (dev->adapter->dev_set_bus) { |
| 858 | err = dev->adapter->dev_set_bus(dev, 0); | 858 | err = dev->adapter->dev_set_bus(dev, 0); |
| 859 | if (err) | 859 | if (err) |
| 860 | goto lbl_unregister_candev; | 860 | goto adap_dev_free; |
| 861 | } | 861 | } |
| 862 | 862 | ||
| 863 | /* get device number early */ | 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 | return 0; | 870 | return 0; |
| 871 | 871 | ||
| 872 | adap_dev_free: | ||
| 873 | if (dev->adapter->dev_free) | ||
| 874 | dev->adapter->dev_free(dev); | ||
| 875 | |||
| 872 | lbl_unregister_candev: | 876 | lbl_unregister_candev: |
| 873 | unregister_candev(netdev); | 877 | unregister_candev(netdev); |
| 874 | 878 | ||
| @@ -16,9 +16,6 @@ · 15 unmodified lines | |||
| 16 | #include "pcan_usb_core.h" | 16 | #include "pcan_usb_core.h" |
| 17 | #include "pcan_usb_pro.h" | 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 | #define PCAN_USBPROFD_CHANNEL_COUNT 2 | 19 | #define PCAN_USBPROFD_CHANNEL_COUNT 2 |
| 23 | #define PCAN_USBFD_CHANNEL_COUNT 1 | 20 | #define PCAN_USBFD_CHANNEL_COUNT 1 |
| 24 | 21 | ||
| @@ -17,8 +17,6 @@ · 16 unmodified lines | |||
| 17 | #include "pcan_usb_core.h" | 17 | #include "pcan_usb_core.h" |
| 18 | #include "pcan_usb_pro.h" | 18 | #include "pcan_usb_pro.h" |
| 19 | 19 | ||
| 20 | MODULE_SUPPORTED_DEVICE("PEAK-System PCAN-USB Pro adapter"); | ||
| 21 | |||
| 22 | #define PCAN_USBPRO_CHANNEL_COUNT 2 | 20 | #define PCAN_USBPRO_CHANNEL_COUNT 2 |
| 23 | 21 | ||
| 24 | /* PCAN-USB Pro adapter internal clock (MHz) */ | 22 | /* PCAN-USB Pro adapter internal clock (MHz) */ |
| @@ -1105,13 +1105,6 @@ static int b53_setup(struct dsa_switch *ds) · 1104 unmodified lines | |||
| 1105 | b53_disable_port(ds, port); | 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 | return b53_setup_devlink_resources(ds); | 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 | ds->ops = &b53_switch_ops; | 2657 | ds->ops = &b53_switch_ops; |
| 2665 | ds->untag_bridge_pvid = true; | 2658 | ds->untag_bridge_pvid = true; |
| 2666 | dev->vlan_enabled = true; | 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 | mutex_init(&dev->reg_mutex); | 2667 | mutex_init(&dev->reg_mutex); |
| 2668 | mutex_init(&dev->stats_mutex); | 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 | /* Force link status for IMP port */ | 114 | /* Force link status for IMP port */ |
| 115 | reg = core_readl(priv, offset); | 115 | reg = core_readl(priv, offset); |
| 116 | reg |= (MII_SW_OR | LINK_STS); | 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 | core_writel(priv, reg, offset); | 121 | core_writel(priv, reg, offset); |
| 119 | 122 | ||
| 120 | /* Enable Broadcast, Multicast, Unicast forwarding to IMP port */ | 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 | /* The watchdog reset does not work on 7278, we need to hit the | 409 | /* The watchdog reset does not work on 7278, we need to hit the |
| 407 | * "external" reset line through the reset controller. | 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 | ret = reset_control_assert(priv->rcdev); | 413 | ret = reset_control_assert(priv->rcdev); |
| 411 | if (ret) | 414 | if (ret) |
| 412 | return ret; | 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 | * in bits 15:8 and the patch level in bits 7:0 which is exactly what | 588 | * in bits 15:8 and the patch level in bits 7:0 which is exactly what |
| 586 | * the REG_PHY_REVISION register layout is. | 589 | * the REG_PHY_REVISION register layout is. |
| 587 | */ | 590 | */ |
| 588 | 591 | if (priv->int_phy_mask & BIT(port)) | |
| 589 | return priv->hw_params.gphy_rev; | 592 | return priv->hw_params.gphy_rev; |
| 593 | else | ||
| 594 | return 0; | ||
| 590 | } | 595 | } |
| 591 | 596 | ||
| 592 | static void bcm_sf2_sw_validate(struct dsa_switch *ds, int port, | 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 | priv->rcdev = devm_reset_control_get_optional_exclusive(&pdev->dev, | 1271 | priv->rcdev = devm_reset_control_get_optional_exclusive(&pdev->dev, |
| 1267 | "switch"); | 1272 | "switch"); |
| 1268 | if (PTR_ERR(priv->rcdev) == -EPROBE_DEFER) | 1273 | if (IS_ERR(priv->rcdev)) |
| 1269 | return PTR_ERR(priv->rcdev); | 1274 | return PTR_ERR(priv->rcdev); |
| 1270 | 1275 | ||
| 1271 | /* Auto-detection using standard registers will not work, so | 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 | bcm_sf2_mdio_unregister(priv); | 1431 | bcm_sf2_mdio_unregister(priv); |
| 1427 | clk_disable_unprepare(priv->clk_mdiv); | 1432 | clk_disable_unprepare(priv->clk_mdiv); |
| 1428 | clk_disable_unprepare(priv->clk); | 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 | reset_control_assert(priv->rcdev); | 1435 | reset_control_assert(priv->rcdev); |
| 1431 | 1436 | ||
| 1432 | return 0; | 1437 | return 0; |
| @@ -93,8 +93,12 @@ · 92 unmodified lines | |||
| 93 | 93 | ||
| 94 | /* GSWIP MII Registers */ | 94 | /* GSWIP MII Registers */ |
| 95 | #define GSWIP_MII_CFGp(p) (0x2 * (p)) | 95 | #define GSWIP_MII_CFGp(p) (0x2 * (p)) |
| 96 | #define GSWIP_MII_CFG_RESET BIT(15) | ||
| 96 | #define GSWIP_MII_CFG_EN BIT(14) | 97 | #define GSWIP_MII_CFG_EN BIT(14) |
| 98 | #define GSWIP_MII_CFG_ISOLATE BIT(13) | ||
| 97 | #define GSWIP_MII_CFG_LDCLKDIS BIT(12) | 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 | #define GSWIP_MII_CFG_MODE_MIIP 0x0 | 102 | #define GSWIP_MII_CFG_MODE_MIIP 0x0 |
| 99 | #define GSWIP_MII_CFG_MODE_MIIM 0x1 | 103 | #define GSWIP_MII_CFG_MODE_MIIM 0x1 |
| 100 | #define GSWIP_MII_CFG_MODE_RMIIP 0x2 | 104 | #define GSWIP_MII_CFG_MODE_RMIIP 0x2 |
| @@ -190,6 +194,23 @@ · 89 unmodified lines | |||
| 190 | #define GSWIP_PCE_DEFPVID(p) (0x486 + ((p) * 0xA)) | 194 | #define GSWIP_PCE_DEFPVID(p) (0x486 + ((p) * 0xA)) |
| 191 | 195 | ||
| 192 | #define GSWIP_MAC_FLEN 0x8C5 | 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 | #define GSWIP_MAC_CTRL_2p(p) (0x905 + ((p) * 0xC)) | 214 | #define GSWIP_MAC_CTRL_2p(p) (0x905 + ((p) * 0xC)) |
| 194 | #define GSWIP_MAC_CTRL_2_MLEN BIT(3) /* Maximum Untagged Frame Lnegth */ | 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 | GSWIP_SDMA_PCTRLp(port)); | 674 | GSWIP_SDMA_PCTRLp(port)); |
| 654 | 675 | ||
| 655 | if (!dsa_is_cpu_port(ds, port)) { | 676 | if (!dsa_is_cpu_port(ds, port)) { |
| 656 | u32 macconf = GSWIP_MDIO_PHY_LINK_AUTO | | 677 | u32 mdio_phy = 0; |
| 657 | GSWIP_MDIO_PHY_SPEED_AUTO | | 678 | |
| 658 | GSWIP_MDIO_PHY_FDUP_AUTO | | 679 | if (phydev) |
| 659 | GSWIP_MDIO_PHY_FCONTX_AUTO | | 680 | mdio_phy = phydev->mdio.addr & GSWIP_MDIO_PHY_ADDR_MASK; |
| 660 | GSWIP_MDIO_PHY_FCONRX_AUTO | | 681 | |
| 661 | (phydev->mdio.addr & GSWIP_MDIO_PHY_ADDR_MASK); | 682 | gswip_mdio_mask(priv, GSWIP_MDIO_PHY_ADDR_MASK, mdio_phy, |
| 662 | 683 | GSWIP_MDIO_PHYp(port)); | |
| 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); | ||
| 666 | } | 684 | } |
| 667 | 685 | ||
| 668 | return 0; | 686 | return 0; |
| @@ -675,14 +693,6 @@ static void gswip_port_disable(struct dsa_switch *ds, int port) · 6 unmodified lines | |||
| 675 | if (!dsa_is_user_port(ds, port)) | 693 | if (!dsa_is_user_port(ds, port)) |
| 676 | return; | 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 | gswip_switch_mask(priv, GSWIP_FDMA_PCTRL_EN, 0, | 696 | gswip_switch_mask(priv, GSWIP_FDMA_PCTRL_EN, 0, |
| 687 | GSWIP_FDMA_PCTRLp(port)); | 697 | GSWIP_FDMA_PCTRLp(port)); |
| 688 | gswip_switch_mask(priv, GSWIP_SDMA_PCTRL_EN, 0, | 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 | gswip_switch_w(priv, BIT(cpu_port), GSWIP_PCE_PMAP2); | 804 | gswip_switch_w(priv, BIT(cpu_port), GSWIP_PCE_PMAP2); |
| 795 | gswip_switch_w(priv, BIT(cpu_port), GSWIP_PCE_PMAP3); | 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 | gswip_mdio_w(priv, 0x0, GSWIP_MDIO_MDC_CFG0); | 823 | gswip_mdio_w(priv, 0x0, GSWIP_MDIO_MDC_CFG0); |
| 824 | |||
| 799 | /* Configure the MDIO Clock 2.5 MHz */ | 825 | /* Configure the MDIO Clock 2.5 MHz */ |
| 800 | gswip_mdio_mask(priv, 0xff, 0x09, GSWIP_MDIO_MDC_CFG1); | 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 | for (i = 0; i < priv->hw_info->max_ports; i++) | 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 | /* enable special tag insertion on cpu port */ | 834 | /* enable special tag insertion on cpu port */ |
| 807 | gswip_switch_mask(priv, 0, GSWIP_FDMA_PCTRL_STEN, | 835 | gswip_switch_mask(priv, 0, GSWIP_FDMA_PCTRL_STEN, |
| @@ -1450,6 +1478,112 @@ unsupported: · 642 unmodified lines | |||
| 1450 | return; | 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 | static void gswip_phylink_mac_config(struct dsa_switch *ds, int port, | 1587 | static void gswip_phylink_mac_config(struct dsa_switch *ds, int port, |
| 1454 | unsigned int mode, | 1588 | unsigned int mode, |
| 1455 | const struct phylink_link_state *state) | 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 | break; | 1603 | break; |
| 1470 | case PHY_INTERFACE_MODE_RMII: | 1604 | case PHY_INTERFACE_MODE_RMII: |
| 1471 | miicfg |= GSWIP_MII_CFG_MODE_RMIIM; | 1605 | miicfg |= GSWIP_MII_CFG_MODE_RMIIM; |
| 1606 | |||
| 1607 | /* Configure the RMII clock as output: */ | ||
| 1608 | miicfg |= GSWIP_MII_CFG_RMII_CLK; | ||
| 1472 | break; | 1609 | break; |
| 1473 | case PHY_INTERFACE_MODE_RGMII: | 1610 | case PHY_INTERFACE_MODE_RGMII: |
| 1474 | case PHY_INTERFACE_MODE_RGMII_ID: | 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 | "Unsupported interface: %d\n", state->interface); | 1618 | "Unsupported interface: %d\n", state->interface); |
| 1482 | return; | 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 | switch (state->interface) { | 1627 | switch (state->interface) { |
| 1487 | case PHY_INTERFACE_MODE_RGMII_ID: | 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 | struct gswip_priv *priv = ds->priv; | 1647 | struct gswip_priv *priv = ds->priv; |
| 1507 | 1648 | ||
| 1508 | gswip_mii_mask_cfg(priv, GSWIP_MII_CFG_EN, 0, port); | 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 | static void gswip_phylink_mac_link_up(struct dsa_switch *ds, int port, | 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 | struct gswip_priv *priv = ds->priv; | 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 | gswip_mii_mask_cfg(priv, 0, GSWIP_MII_CFG_EN, port); | 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 | TD_DM_DRVP(8) | TD_DM_DRVN(8)); | 436 | TD_DM_DRVP(8) | TD_DM_DRVN(8)); |
| 437 | 437 | ||
| 438 | /* Setup core clock for MT7530 */ | 438 | /* Setup core clock for MT7530 */ |
| 439 | if (!trgint) { | 439 | /* Disable MT7530 core clock */ |
| 440 | /* Disable MT7530 core clock */ | 440 | core_clear(priv, CORE_TRGMII_GSW_CLK_CG, REG_GSWCK_EN); |
| 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)); | ||
| 457 | 441 | ||
| 458 | /* Enable PLL */ | 442 | /* Disable PLL, since phy_device has not yet been created |
| 459 | core_write(priv, CORE_GSWPLL_GRP1, | 443 | * provided for phy_[read,write]_mmd_indirect is called, we |
| 460 | RG_GSWPLL_EN_PRE | | 444 | * provide our own core_write_mmd_indirect to complete this |
| 461 | RG_GSWPLL_POSDIV_200M(2) | | 445 | * function. |
| 462 | RG_GSWPLL_FBKDIV_200M(32)); | 446 | */ |
| 463 | 447 | core_write_mmd_indirect(priv, | |
| 464 | /* Enable MT7530 core clock */ | 448 | CORE_GSWPLL_GRP1, |
| 465 | core_set(priv, CORE_TRGMII_GSW_CLK_CG, REG_GSWCK_EN); | 449 | MDIO_MMD_VEND2, |
| 466 | } | 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 | /* Setup the MT7530 TRGMII Tx Clock */ | 466 | /* Setup the MT7530 TRGMII Tx Clock */ |
| 469 | core_set(priv, CORE_TRGMII_GSW_CLK_CG, REG_GSWCK_EN); | 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 | static inline u32 | 1626 | static inline u32 |
| 1628 | mt7530_gpio_to_bit(unsigned int offset) | 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 | return devm_gpiochip_add_data(dev, gc, priv); | 1726 | return devm_gpiochip_add_data(dev, gc, priv); |
| 1728 | } | 1727 | } |
| 1728 | #endif /* CONFIG_GPIOLIB */ | ||
| 1729 | 1729 | ||
| 1730 | static int | 1730 | static int |
| 1731 | mt7530_setup(struct dsa_switch *ds) | 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 | if (of_property_read_bool(priv->dev->of_node, "gpio-controller")) { | 1872 | if (of_property_read_bool(priv->dev->of_node, "gpio-controller")) { |
| 1872 | ret = mt7530_setup_gpio(priv); | 1873 | ret = mt7530_setup_gpio(priv); |
| 1873 | if (ret) | 1874 | if (ret) |
| 1874 | return ret; | 1875 | return ret; |
| 1875 | } | 1876 | } |
| 1877 | #endif /* CONFIG_GPIOLIB */ | ||
| 1876 | 1878 | ||
| 1877 | mt7530_setup_port5(ds, interface); | 1879 | mt7530_setup_port5(ds, interface); |
| 1878 | 1880 | ||
| @@ -3026,10 +3026,17 @@ out_resources: · 3025 unmodified lines | |||
| 3026 | return err; | 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 | static int mv88e6xxx_mdio_read(struct mii_bus *bus, int phy, int reg) | 3035 | static int mv88e6xxx_mdio_read(struct mii_bus *bus, int phy, int reg) |
| 3030 | { | 3036 | { |
| 3031 | struct mv88e6xxx_mdio_bus *mdio_bus = bus->priv; | 3037 | struct mv88e6xxx_mdio_bus *mdio_bus = bus->priv; |
| 3032 | struct mv88e6xxx_chip *chip = mdio_bus->chip; | 3038 | struct mv88e6xxx_chip *chip = mdio_bus->chip; |
| 3039 | u16 prod_id; | ||
| 3033 | u16 val; | 3040 | u16 val; |
| 3034 | int err; | 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 | err = chip->info->ops->phy_read(chip, bus, phy, reg, &val); | 3047 | err = chip->info->ops->phy_read(chip, bus, phy, reg, &val); |
| 3041 | mv88e6xxx_reg_unlock(chip); | 3048 | mv88e6xxx_reg_unlock(chip); |
| 3042 | 3049 | ||
| 3043 | if (reg == MII_PHYSID2) { | 3050 | /* Some internal PHYs don't have a model number. */ |
| 3044 | /* Some internal PHYs don't have a model number. */ | 3051 | if (reg == MII_PHYSID2 && !(val & 0x3f0) && |
| 3045 | if (chip->info->family != MV88E6XXX_FAMILY_6165) | 3052 | chip->info->family < ARRAY_SIZE(family_prod_id_table)) { |
| 3046 | /* Then there is the 6165 family. It gets is | 3053 | prod_id = family_prod_id_table[chip->info->family]; |
| 3047 | * PHYs correct. But it can also have two | 3054 | if (prod_id) |
| 3048 | * SERDES interfaces in the PHY address | 3055 | val |= prod_id >> 4; |
| 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; | ||
| 3060 | } | 3056 | } |
| 3061 | 3057 | ||
| 3062 | return err ? err : val; | 3058 | return err ? err : val; |
| @@ -1922,7 +1922,7 @@ out_unlock_ptp: · 1921 unmodified lines | |||
| 1922 | speed = SPEED_1000; | 1922 | speed = SPEED_1000; |
| 1923 | else if (bmcr & BMCR_SPEED100) | 1923 | else if (bmcr & BMCR_SPEED100) |
| 1924 | speed = SPEED_100; | 1924 | speed = SPEED_100; |
| 1925 | else if (bmcr & BMCR_SPEED10) | 1925 | else |
| 1926 | speed = SPEED_10; | 1926 | speed = SPEED_10; |
| 1927 | 1927 | ||
| 1928 | sja1105_sgmii_pcs_force_speed(priv, speed); | 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 | if (flags.val & BR_FLOOD) | 3369 | if (flags.val & BR_FLOOD) |
| 3370 | priv->ucast_egress_floods |= BIT(to); | 3370 | priv->ucast_egress_floods |= BIT(to); |
| 3371 | else | 3371 | else |
| 3372 | priv->ucast_egress_floods |= BIT(to); | 3372 | priv->ucast_egress_floods &= ~BIT(to); |
| 3373 | } | 3373 | } |
| 3374 | 3374 | ||
| 3375 | if (flags.mask & BR_BCAST_FLOOD) { | 3375 | if (flags.mask & BR_BCAST_FLOOD) { |
| 3376 | if (flags.val & BR_BCAST_FLOOD) | 3376 | if (flags.val & BR_BCAST_FLOOD) |
| 3377 | priv->bcast_egress_floods |= BIT(to); | 3377 | priv->bcast_egress_floods |= BIT(to); |
| 3378 | else | 3378 | else |
| 3379 | priv->bcast_egress_floods |= BIT(to); | 3379 | priv->bcast_egress_floods &= ~BIT(to); |
| 3380 | } | 3380 | } |
| 3381 | 3381 | ||
| 3382 | return sja1105_manage_flood_domains(priv); | 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 | return -EOPNOTSUPP; | 528 | return -EOPNOTSUPP; |
| 529 | 529 | ||
| 530 | dsa_hsr_foreach_port(dp, ds, hsr) { | 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 | /* We can't enable redundancy on the switch until both | 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 | unsigned int val; | 585 | unsigned int val; |
| 583 | 586 | ||
| 584 | dsa_hsr_foreach_port(dp, ds, hsr) { | 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 | if (!partner) | 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 | pci_set_master(pdev); | 1535 | pci_set_master(pdev); |
| 1536 | 1536 | ||
| 1537 | ioaddr = pci_resource_start(pdev, 0); | 1537 | if (!pci_resource_len(pdev, 0)) { |
| 1538 | if (!ioaddr) { | ||
| 1539 | if (pcnet32_debug & NETIF_MSG_PROBE) | 1538 | if (pcnet32_debug & NETIF_MSG_PROBE) |
| 1540 | pr_err("card has no PCI IO resources, aborting\n"); | 1539 | pr_err("card has no PCI IO resources, aborting\n"); |
| 1541 | err = -ENODEV; | 1540 | err = -ENODEV; |
| @@ -1548,6 +1547,8 @@ pcnet32_probe_pci(struct pci_dev *pdev, const struct pci_device_id *ent) · 6 unmodified lines | |||
| 1548 | pr_err("architecture does not support 32bit PCI busmaster DMA\n"); | 1547 | pr_err("architecture does not support 32bit PCI busmaster DMA\n"); |
| 1549 | goto err_disable_dev; | 1548 | goto err_disable_dev; |
| 1550 | } | 1549 | } |
| 1550 | |||
| 1551 | ioaddr = pci_resource_start(pdev, 0); | ||
| 1551 | if (!request_region(ioaddr, PCNET32_TOTAL_SIZE, "pcnet32_probe_pci")) { | 1552 | if (!request_region(ioaddr, PCNET32_TOTAL_SIZE, "pcnet32_probe_pci")) { |
| 1552 | if (pcnet32_debug & NETIF_MSG_PROBE) | 1553 | if (pcnet32_debug & NETIF_MSG_PROBE) |
| 1553 | pr_err("io address range already allocated\n"); | 1554 | pr_err("io address range already allocated\n"); |
| @@ -180,9 +180,9 @@ · 179 unmodified lines | |||
| 180 | #define XGBE_DMA_SYS_AWCR 0x30303030 | 180 | #define XGBE_DMA_SYS_AWCR 0x30303030 |
| 181 | 181 | ||
| 182 | /* DMA cache settings - PCI device */ | 182 | /* DMA cache settings - PCI device */ |
| 183 | #define XGBE_DMA_PCI_ARCR 0x00000003 | 183 | #define XGBE_DMA_PCI_ARCR 0x000f0f0f |
| 184 | #define XGBE_DMA_PCI_AWCR 0x13131313 | 184 | #define XGBE_DMA_PCI_AWCR 0x0f0f0f0f |
| 185 | #define XGBE_DMA_PCI_AWARCR 0x00000313 | 185 | #define XGBE_DMA_PCI_AWARCR 0x00000f0f |
| 186 | 186 | ||
| 187 | /* DMA channel interrupt modes */ | 187 | /* DMA channel interrupt modes */ |
| 188 | #define XGBE_IRQ_MODE_EDGE 0 | 188 | #define XGBE_IRQ_MODE_EDGE 0 |
| @@ -1894,13 +1894,16 @@ static int alx_resume(struct device *dev) · 1893 unmodified lines | |||
| 1894 | 1894 | ||
| 1895 | if (!netif_running(alx->dev)) | 1895 | if (!netif_running(alx->dev)) |
| 1896 | return 0; | 1896 | return 0; |
| 1897 | netif_device_attach(alx->dev); | ||
| 1898 | 1897 | ||
| 1899 | rtnl_lock(); | 1898 | rtnl_lock(); |
| 1900 | err = __alx_open(alx, true); | 1899 | err = __alx_open(alx, true); |
| 1901 | rtnl_unlock(); | 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 | static SIMPLE_DEV_PM_OPS(alx_pm_ops, alx_suspend, alx_resume); | 1909 | static SIMPLE_DEV_PM_OPS(alx_pm_ops, alx_suspend, alx_resume); |
| @@ -54,7 +54,7 @@ config B44_PCI · 53 unmodified lines | |||
| 54 | config BCM4908_ENET | 54 | config BCM4908_ENET |
| 55 | tristate "Broadcom BCM4908 internal mac support" | 55 | tristate "Broadcom BCM4908 internal mac support" |
| 56 | depends on ARCH_BCM4908 || COMPILE_TEST | 56 | depends on ARCH_BCM4908 || COMPILE_TEST |
| 57 | default y | 57 | default y if ARCH_BCM4908 |
| 58 | help | 58 | help |
| 59 | This driver supports Ethernet controller integrated into Broadcom | 59 | This driver supports Ethernet controller integrated into Broadcom |
| 60 | BCM4908 family SoCs. | 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 | err_free_buf_descs: | 173 | err_free_buf_descs: |
| 174 | dma_free_coherent(dev, size, ring->cpu_addr, ring->dma_addr); | 174 | dma_free_coherent(dev, size, ring->cpu_addr, ring->dma_addr); |
| 175 | ring->cpu_addr = NULL; | ||
| 175 | return -ENOMEM; | 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 | bcm4908_enet_intrs_on(enet); | 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 | return handled; | 599 | return handled; |
| 596 | } | 600 | } |
| 597 | 601 | ||
| @@ -8556,10 +8556,18 @@ static void bnxt_setup_inta(struct bnxt *bp) · 8555 unmodified lines | |||
| 8556 | bp->irq_tbl[0].handler = bnxt_inta; | 8556 | bp->irq_tbl[0].handler = bnxt_inta; |
| 8557 | } | 8557 | } |
| 8558 | 8558 | ||
| 8559 | static int bnxt_init_int_mode(struct bnxt *bp); | ||
| 8560 | |||
| 8559 | static int bnxt_setup_int_mode(struct bnxt *bp) | 8561 | static int bnxt_setup_int_mode(struct bnxt *bp) |
| 8560 | { | 8562 | { |
| 8561 | int rc; | 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 | if (bp->flags & BNXT_FLAG_USING_MSIX) | 8571 | if (bp->flags & BNXT_FLAG_USING_MSIX) |
| 8564 | bnxt_setup_msix(bp); | 8572 | bnxt_setup_msix(bp); |
| 8565 | else | 8573 | else |
| @@ -8744,7 +8752,7 @@ static int bnxt_init_inta(struct bnxt *bp) · 178 unmodified lines | |||
| 8744 | 8752 | ||
| 8745 | static int bnxt_init_int_mode(struct bnxt *bp) | 8753 | static int bnxt_init_int_mode(struct bnxt *bp) |
| 8746 | { | 8754 | { |
| 8747 | int rc = 0; | 8755 | int rc = -ENODEV; |
| 8748 | 8756 | ||
| 8749 | if (bp->flags & BNXT_FLAG_MSIX_CAP) | 8757 | if (bp->flags & BNXT_FLAG_MSIX_CAP) |
| 8750 | rc = bnxt_init_msix(bp); | 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 | struct hwrm_func_drv_if_change_output *resp = bp->hwrm_cmd_resp_addr; | 9523 | struct hwrm_func_drv_if_change_output *resp = bp->hwrm_cmd_resp_addr; |
| 9516 | struct hwrm_func_drv_if_change_input req = {0}; | 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 | int rc, retry = 0; | 9527 | int rc, retry = 0; |
| 9519 | u32 flags = 0; | 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 | if (test_bit(BNXT_STATE_IN_FW_RESET, &bp->state) && !fw_reset) { | 9567 | if (test_bit(BNXT_STATE_IN_FW_RESET, &bp->state) && !fw_reset) { |
| 9559 | netdev_err(bp->dev, "RESET_DONE not set during FW reset.\n"); | 9568 | netdev_err(bp->dev, "RESET_DONE not set during FW reset.\n"); |
| 9569 | set_bit(BNXT_STATE_ABORT_ERR, &bp->state); | ||
| 9560 | return -ENODEV; | 9570 | return -ENODEV; |
| 9561 | } | 9571 | } |
| 9562 | if (resc_reinit || fw_reset) { | 9572 | if (resc_reinit || fw_reset) { |
| @@ -9890,6 +9900,9 @@ static int bnxt_reinit_after_abort(struct bnxt *bp) · 327 unmodified lines | |||
| 9890 | if (test_bit(BNXT_STATE_IN_FW_RESET, &bp->state)) | 9900 | if (test_bit(BNXT_STATE_IN_FW_RESET, &bp->state)) |
| 9891 | return -EBUSY; | 9901 | return -EBUSY; |
| 9892 | 9902 | ||
| 9903 | if (bp->dev->reg_state == NETREG_UNREGISTERED) | ||
| 9904 | return -ENODEV; | ||
| 9905 | |||
| 9893 | rc = bnxt_fw_init_one(bp); | 9906 | rc = bnxt_fw_init_one(bp); |
| 9894 | if (!rc) { | 9907 | if (!rc) { |
| 9895 | bnxt_clear_int_mode(bp); | 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 | bool cmp_b = false; | 3239 | bool cmp_b = false; |
| 3240 | bool cmp_c = false; | 3240 | bool cmp_c = false; |
| 3241 | 3241 | ||
| 3242 | if (!macb_is_gem(bp)) | ||
| 3243 | return; | ||
| 3244 | |||
| 3242 | tp4sp_v = &(fs->h_u.tcp_ip4_spec); | 3245 | tp4sp_v = &(fs->h_u.tcp_ip4_spec); |
| 3243 | tp4sp_m = &(fs->m_u.tcp_ip4_spec); | 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 | struct net_device *netdev = bp->dev; | 3611 | struct net_device *netdev = bp->dev; |
| 3609 | netdev_features_t features = netdev->features; | 3612 | netdev_features_t features = netdev->features; |
| 3613 | struct ethtool_rx_fs_item *item; | ||
| 3610 | 3614 | ||
| 3611 | /* TX checksum offload */ | 3615 | /* TX checksum offload */ |
| 3612 | macb_set_txcsum_feature(bp, features); | 3616 | macb_set_txcsum_feature(bp, features); |
| @@ -3615,6 +3619,9 @@ static void macb_restore_features(struct macb *bp) · 2 unmodified lines | |||
| 3615 | macb_set_rxcsum_feature(bp, features); | 3619 | macb_set_rxcsum_feature(bp, features); |
| 3616 | 3620 | ||
| 3617 | /* RX Flow Filters */ | 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 | macb_set_rxflow_feature(bp, features); | 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 | reg = gem_readl(bp, DCFG8); | 3918 | reg = gem_readl(bp, DCFG8); |
| 3912 | bp->max_tuples = min((GEM_BFEXT(SCR2CMP, reg) / 3), | 3919 | bp->max_tuples = min((GEM_BFEXT(SCR2CMP, reg) / 3), |
| 3913 | GEM_BFEXT(T2SCR, reg)); | 3920 | GEM_BFEXT(T2SCR, reg)); |
| 3921 | INIT_LIST_HEAD(&bp->rx_fs_list.list); | ||
| 3914 | if (bp->max_tuples > 0) { | 3922 | if (bp->max_tuples > 0) { |
| 3915 | /* also needs one ethtype match to check IPv4 */ | 3923 | /* also needs one ethtype match to check IPv4 */ |
| 3916 | if (GEM_BFEXT(SCR2ETH, reg) > 0) { | 3924 | if (GEM_BFEXT(SCR2ETH, reg) > 0) { |
| @@ -3921,7 +3929,6 @@ static int macb_init(struct platform_device *pdev) · 4 unmodified lines | |||
| 3921 | /* Filtering is supported in hw but don't enable it in kernel now */ | 3929 | /* Filtering is supported in hw but don't enable it in kernel now */ |
| 3922 | dev->hw_features |= NETIF_F_NTUPLE; | 3930 | dev->hw_features |= NETIF_F_NTUPLE; |
| 3923 | /* init Rx flow definitions */ | 3931 | /* init Rx flow definitions */ |
| 3924 | INIT_LIST_HEAD(&bp->rx_fs_list.list); | ||
| 3925 | bp->rx_fs_list.count = 0; | 3932 | bp->rx_fs_list.count = 0; |
| 3926 | spin_lock_init(&bp->rx_fs_lock); | 3933 | spin_lock_init(&bp->rx_fs_lock); |
| 3927 | } else | 3934 | } else |
| @@ -3954,6 +3961,13 @@ static int macb_init(struct platform_device *pdev) · 26 unmodified lines | |||
| 3954 | return 0; | 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 | #if defined(CONFIG_OF) | 3971 | #if defined(CONFIG_OF) |
| 3958 | /* 1518 rounded up */ | 3972 | /* 1518 rounded up */ |
| 3959 | #define AT91ETHER_MAX_RBUFF_SZ 0x600 | 3973 | #define AT91ETHER_MAX_RBUFF_SZ 0x600 |
| @@ -4439,13 +4453,6 @@ static int fu540_c000_init(struct platform_device *pdev) · 479 unmodified lines | |||
| 4439 | return macb_init(pdev); | 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 | static const struct macb_usrio_config sama7g5_usrio = { | 4456 | static const struct macb_usrio_config sama7g5_usrio = { |
| 4450 | .mii = 0, | 4457 | .mii = 0, |
| 4451 | .rmii = 1, | 4458 | .rmii = 1, |
| @@ -4594,6 +4601,7 @@ static const struct macb_config default_gem_config = { · 142 unmodified lines | |||
| 4594 | .dma_burst_length = 16, | 4601 | .dma_burst_length = 16, |
| 4595 | .clk_init = macb_clk_init, | 4602 | .clk_init = macb_clk_init, |
| 4596 | .init = macb_init, | 4603 | .init = macb_init, |
| 4604 | .usrio = &macb_default_usrio, | ||
| 4597 | .jumbo_max_len = 10240, | 4605 | .jumbo_max_len = 10240, |
| 4598 | }; | 4606 | }; |
| 4599 | 4607 | ||
| @@ -412,7 +412,7 @@ · 411 unmodified lines | |||
| 412 | | CN6XXX_INTR_M0UNWI_ERR \ | 412 | | CN6XXX_INTR_M0UNWI_ERR \ |
| 413 | | CN6XXX_INTR_M1UPB0_ERR \ | 413 | | CN6XXX_INTR_M1UPB0_ERR \ |
| 414 | | CN6XXX_INTR_M1UPWI_ERR \ | 414 | | CN6XXX_INTR_M1UPWI_ERR \ |
| 415 | | CN6XXX_INTR_M1UPB0_ERR \ | 415 | | CN6XXX_INTR_M1UNB0_ERR \ |
| 416 | | CN6XXX_INTR_M1UNWI_ERR \ | 416 | | CN6XXX_INTR_M1UNWI_ERR \ |
| 417 | | CN6XXX_INTR_INSTR_DB_OF_ERR \ | 417 | | CN6XXX_INTR_INSTR_DB_OF_ERR \ |
| 418 | | CN6XXX_INTR_SLIST_DB_OF_ERR \ | 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 | struct cudbg_buffer temp_buff = { 0 }; | 1794 | struct cudbg_buffer temp_buff = { 0 }; |
| 1795 | struct sge_qbase_reg_field *sge_qbase; | 1795 | struct sge_qbase_reg_field *sge_qbase; |
| 1796 | struct ireg_buf *ch_sge_dbg; | 1796 | struct ireg_buf *ch_sge_dbg; |
| 1797 | u8 padap_running = 0; | ||
| 1797 | int i, rc; | 1798 | int i, rc; |
| 1799 | u32 size; | ||
| 1798 | 1800 | ||
| 1799 | rc = cudbg_get_buff(pdbg_init, dbg_buff, | 1801 | /* Accessing SGE_QBASE_MAP[0-3] and SGE_QBASE_INDEX regs can |
| 1800 | sizeof(*ch_sge_dbg) * 2 + sizeof(*sge_qbase), | 1802 | * lead to SGE missing doorbells under heavy traffic. So, only |
| 1801 | &temp_buff); | 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 | if (rc) | 1816 | if (rc) |
| 1803 | return rc; | 1817 | return rc; |
| 1804 | 1818 | ||
| @@ -1820,7 +1834,8 @@ int cudbg_collect_sge_indirect(struct cudbg_init *pdbg_init, · 15 unmodified lines | |||
| 1820 | ch_sge_dbg++; | 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 | sge_qbase = (struct sge_qbase_reg_field *)ch_sge_dbg; | 1839 | sge_qbase = (struct sge_qbase_reg_field *)ch_sge_dbg; |
| 1825 | /* 1 addr reg SGE_QBASE_INDEX and 4 data reg | 1840 | /* 1 addr reg SGE_QBASE_INDEX and 4 data reg |
| 1826 | * SGE_QBASE_MAP[0-3] | 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 | 0x1190, 0x1194, | 2090 | 0x1190, 0x1194, |
| 2091 | 0x11a0, 0x11a4, | 2091 | 0x11a0, 0x11a4, |
| 2092 | 0x11b0, 0x11b4, | 2092 | 0x11b0, 0x11b4, |
| 2093 | 0x11fc, 0x1274, | 2093 | 0x11fc, 0x123c, |
| 2094 | 0x1254, 0x1274, | ||
| 2094 | 0x1280, 0x133c, | 2095 | 0x1280, 0x133c, |
| 2095 | 0x1800, 0x18fc, | 2096 | 0x1800, 0x18fc, |
| 2096 | 0x3000, 0x302c, | 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 | return cxgb4_ofld_send(tx_info->netdev, skb); | 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 | * chcr_ktls_dev_del: call back for tls_dev_del. | 353 | * chcr_ktls_dev_del: call back for tls_dev_del. |
| 366 | * Remove the tid and l2t entry and close the connection. | 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 | /* clear tid */ | 384 | /* clear tid */ |
| 397 | if (tx_info->tid != -1) { | 385 | if (tx_info->tid != -1) { |
| 398 | /* clear tcb state and then release tid */ | ||
| 399 | chcr_ktls_mark_tcb_close(tx_info); | ||
| 400 | cxgb4_remove_tid(&tx_info->adap->tids, tx_info->tx_chan, | 386 | cxgb4_remove_tid(&tx_info->adap->tids, tx_info->tx_chan, |
| 401 | tx_info->tid, tx_info->ip_family); | 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 | return 0; | 560 | return 0; |
| 575 | 561 | ||
| 576 | free_tid: | 562 | free_tid: |
| 577 | chcr_ktls_mark_tcb_close(tx_info); | ||
| 578 | #if IS_ENABLED(CONFIG_IPV6) | 563 | #if IS_ENABLED(CONFIG_IPV6) |
| 579 | /* clear clip entry */ | 564 | /* clear clip entry */ |
| 580 | if (tx_info->ip_family == AF_INET6) | 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 | if (tx_info->pending_close) { | 657 | if (tx_info->pending_close) { |
| 673 | spin_unlock(&tx_info->lock); | 658 | spin_unlock(&tx_info->lock); |
| 674 | if (!status) { | 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 | cxgb4_remove_tid(&tx_info->adap->tids, tx_info->tx_chan, | 660 | cxgb4_remove_tid(&tx_info->adap->tids, tx_info->tx_chan, |
| 680 | tid, tx_info->ip_family); | 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 | kvfree(tx_info); | 703 | kvfree(tx_info); |
| 723 | return 0; | 704 | return 0; |
| 724 | } | 705 | } |
| 725 | tx_info->open_state = false; | 706 | tx_info->open_state = CH_KTLS_OPEN_SUCCESS; |
| 726 | spin_unlock(&tx_info->lock); | 707 | spin_unlock(&tx_info->lock); |
| 727 | 708 | ||
| 728 | complete(&tx_info->completion); | 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 | * other than timestamp. | 915 | * other than timestamp. |
| 935 | * @skb - skb contains partial record.. | 916 | * @skb - skb contains partial record.. |
| 936 | * return: 1 / 0 | 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 | if (unlikely(credits < ETHTXQ_STOP_THRES)) { | 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 | * injecting the Work Request for this packet. | 1100 | * injecting the Work Request for this packet. |
| 1120 | */ | 1101 | */ |
| 1121 | chcr_eth_txq_stop(q); | 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 | refcount_add(nskb->truesize, &nskb->sk->sk_wmem_alloc); | 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 | * chcr_end_part_handler: This handler will handle the record which | 1648 | * chcr_end_part_handler: This handler will handle the record which |
| 1716 | * is complete or if record's end part is received. T6 adapter has a issue that | 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 | struct sge_eth_txq *q, u32 skb_offset, | 1668 | struct sge_eth_txq *q, u32 skb_offset, |
| 1736 | u32 tls_end_offset, bool last_wr) | 1669 | u32 tls_end_offset, bool last_wr) |
| 1737 | { | 1670 | { |
| 1671 | bool free_skb_if_tx_fails = false; | ||
| 1738 | struct sk_buff *nskb = NULL; | 1672 | struct sk_buff *nskb = NULL; |
| 1673 | |||
| 1739 | /* check if it is a complete record */ | 1674 | /* check if it is a complete record */ |
| 1740 | if (tls_end_offset == record->len) { | 1675 | if (tls_end_offset == record->len) { |
| 1741 | nskb = skb; | 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 | if (last_wr) | 1694 | if (last_wr) |
| 1760 | dev_kfree_skb_any(skb); | 1695 | dev_kfree_skb_any(skb); |
| 1696 | else | ||
| 1697 | free_skb_if_tx_fails = true; | ||
| 1761 | 1698 | ||
| 1762 | last_wr = true; | 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 | record->num_frags, | 1706 | record->num_frags, |
| 1770 | (last_wr && tcp_push_no_fin), | 1707 | (last_wr && tcp_push_no_fin), |
| 1771 | mss)) { | 1708 | mss)) { |
| 1709 | if (free_skb_if_tx_fails) | ||
| 1710 | dev_kfree_skb_any(skb); | ||
| 1772 | goto out; | 1711 | goto out; |
| 1773 | } | 1712 | } |
| 1774 | tx_info->prev_seq = record->end_seq; | 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 | /* reset tcp_seq as per the prior_data_required len */ | 1844 | /* reset tcp_seq as per the prior_data_required len */ |
| 1906 | tcp_seq -= prior_data_len; | 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 | atomic64_inc(&tx_info->adap->ch_ktls_stats.ktls_tx_middle_pkts); | 1847 | atomic64_inc(&tx_info->adap->ch_ktls_stats.ktls_tx_middle_pkts); |
| 1914 | } else { | 1848 | } else { |
| 1915 | atomic64_inc(&tx_info->adap->ch_ktls_stats.ktls_tx_start_pkts); | 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 | /* TCP segments can be in received either complete or partial. | 1941 | /* TCP segments can be in received either complete or partial. |
| 2008 | * chcr_end_part_handler will handle cases if complete record or end | 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 | * we will send the complete record again. | 1944 | * we will send the complete record again. |
| 2011 | */ | 1945 | */ |
| 2012 | 1946 | ||
| 1947 | spin_lock_irqsave(&tx_ctx->base.lock, flags); | ||
| 1948 | |||
| 2013 | do { | 1949 | do { |
| 2014 | int i; | ||
| 2015 | 1950 | ||
| 2016 | cxgb4_reclaim_completed_tx(adap, &q->q, true); | 1951 | cxgb4_reclaim_completed_tx(adap, &q->q, true); |
| 2017 | /* lock taken */ | ||
| 2018 | spin_lock_irqsave(&tx_ctx->base.lock, flags); | ||
| 2019 | /* fetch the tls record */ | 1952 | /* fetch the tls record */ |
| 2020 | record = tls_get_record(&tx_ctx->base, tcp_seq, | 1953 | record = tls_get_record(&tx_ctx->base, tcp_seq, |
| 2021 | &tx_info->record_no); | 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 | tls_end_offset, skb_offset, | 2007 | tls_end_offset, skb_offset, |
| 2075 | 0); | 2008 | 0); |
| 2076 | 2009 | ||
| 2077 | spin_unlock_irqrestore(&tx_ctx->base.lock, flags); | ||
| 2078 | if (ret) { | 2010 | if (ret) { |
| 2079 | /* free the refcount taken earlier */ | 2011 | /* free the refcount taken earlier */ |
| 2080 | if (tls_end_offset < data_len) | 2012 | if (tls_end_offset < data_len) |
| 2081 | dev_kfree_skb_any(skb); | 2013 | dev_kfree_skb_any(skb); |
| 2014 | spin_unlock_irqrestore(&tx_ctx->base.lock, flags); | ||
| 2082 | goto out; | 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 | continue; | 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 | /* if a tls record is finishing in this SKB */ | 2024 | /* if a tls record is finishing in this SKB */ |
| 2102 | if (tls_end_offset <= data_len) { | 2025 | if (tls_end_offset <= data_len) { |
| 2103 | ret = chcr_end_part_handler(tx_info, skb, record, | 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 | data_len = 0; | 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 | /* if any failure, come out from the loop. */ | 2048 | /* if any failure, come out from the loop. */ |
| 2131 | if (ret) { | 2049 | if (ret) { |
| 2050 | spin_unlock_irqrestore(&tx_ctx->base.lock, flags); | ||
| 2132 | if (th->fin) | 2051 | if (th->fin) |
| 2133 | dev_kfree_skb_any(skb); | 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 | } while (data_len > 0); | 2063 | } while (data_len > 0); |
| 2145 | 2064 | ||
| 2065 | spin_unlock_irqrestore(&tx_ctx->base.lock, flags); | ||
| 2146 | atomic64_inc(&port_stats->ktls_tx_encrypted_packets); | 2066 | atomic64_inc(&port_stats->ktls_tx_encrypted_packets); |
| 2147 | atomic64_add(skb_data_len, &port_stats->ktls_tx_encrypted_bytes); | 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 | u32 wake_state; | 133 | u32 wake_state; |
| 134 | 134 | ||
| 135 | int ip_summed; | 135 | int ip_summed; |
| 136 | |||
| 137 | struct regulator *power_supply; | ||
| 136 | }; | 138 | }; |
| 137 | 139 | ||
| 138 | /* debug code */ | 140 | /* debug code */ |
| @@ -1449,7 +1451,7 @@ dm9000_probe(struct platform_device *pdev) · 1310 unmodified lines | |||
| 1449 | if (ret) { | 1451 | if (ret) { |
| 1450 | dev_err(dev, "failed to request reset gpio %d: %d\n", | 1452 | dev_err(dev, "failed to request reset gpio %d: %d\n", |
| 1451 | reset_gpios, ret); | 1453 | reset_gpios, ret); |
| 1452 | return -ENODEV; | 1454 | goto out_regulator_disable; |
| 1453 | } | 1455 | } |
| 1454 | 1456 | ||
| 1455 | /* According to manual PWRST# Low Period Min 1ms */ | 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 | if (!pdata) { | 1464 | if (!pdata) { |
| 1463 | pdata = dm9000_parse_dt(&pdev->dev); | 1465 | pdata = dm9000_parse_dt(&pdev->dev); |
| 1464 | if (IS_ERR(pdata)) | 1466 | if (IS_ERR(pdata)) { |
| 1465 | return PTR_ERR(pdata); | 1467 | ret = PTR_ERR(pdata); |
| 1468 | goto out_regulator_disable; | ||
| 1469 | } | ||
| 1466 | } | 1470 | } |
| 1467 | 1471 | ||
| 1468 | /* Init network device */ | 1472 | /* Init network device */ |
| 1469 | ndev = alloc_etherdev(sizeof(struct board_info)); | 1473 | ndev = alloc_etherdev(sizeof(struct board_info)); |
| 1470 | if (!ndev) | 1474 | if (!ndev) { |
| 1471 | return -ENOMEM; | 1475 | ret = -ENOMEM; |
| 1476 | goto out_regulator_disable; | ||
| 1477 | } | ||
| 1472 | 1478 | ||
| 1473 | SET_NETDEV_DEV(ndev, &pdev->dev); | 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 | db->dev = &pdev->dev; | 1486 | db->dev = &pdev->dev; |
| 1481 | db->ndev = ndev; | 1487 | db->ndev = ndev; |
| 1488 | if (!IS_ERR(power)) | ||
| 1489 | db->power_supply = power; | ||
| 1482 | 1490 | ||
| 1483 | spin_lock_init(&db->lock); | 1491 | spin_lock_init(&db->lock); |
| 1484 | mutex_init(&db->addr_lock); | 1492 | mutex_init(&db->addr_lock); |
| @@ -1501,7 +1509,7 @@ dm9000_probe(struct platform_device *pdev) · 16 unmodified lines | |||
| 1501 | goto out; | 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 | if (db->irq_wake >= 0) { | 1513 | if (db->irq_wake >= 0) { |
| 1506 | dev_dbg(db->dev, "wakeup irq %d\n", db->irq_wake); | 1514 | dev_dbg(db->dev, "wakeup irq %d\n", db->irq_wake); |
| 1507 | 1515 | ||
| @@ -1703,6 +1711,10 @@ out: · 195 unmodified lines | |||
| 1703 | dm9000_release_board(pdev, db); | 1711 | dm9000_release_board(pdev, db); |
| 1704 | free_netdev(ndev); | 1712 | free_netdev(ndev); |
| 1705 | 1713 | ||
| 1714 | out_regulator_disable: | ||
| 1715 | if (!IS_ERR(power)) | ||
| 1716 | regulator_disable(power); | ||
| 1717 | |||
| 1706 | return ret; | 1718 | return ret; |
| 1707 | } | 1719 | } |
| 1708 | 1720 | ||
| @@ -1760,10 +1772,13 @@ static int · 51 unmodified lines | |||
| 1760 | dm9000_drv_remove(struct platform_device *pdev) | 1772 | dm9000_drv_remove(struct platform_device *pdev) |
| 1761 | { | 1773 | { |
| 1762 | struct net_device *ndev = platform_get_drvdata(pdev); | 1774 | struct net_device *ndev = platform_get_drvdata(pdev); |
| 1775 | struct board_info *dm = to_dm9000_board(ndev); | ||
| 1763 | 1776 | ||
| 1764 | unregister_netdev(ndev); | 1777 | unregister_netdev(ndev); |
| 1765 | dm9000_release_board(pdev, netdev_priv(ndev)); | 1778 | dm9000_release_board(pdev, dm); |
| 1766 | free_netdev(ndev); /* free device structure */ | 1779 | free_netdev(ndev); /* free device structure */ |
| 1780 | if (dm->power_supply) | ||
| 1781 | regulator_disable(dm->power_supply); | ||
| 1767 | 1782 | ||
| 1768 | dev_dbg(&pdev->dev, "released and freed device\n"); | 1783 | dev_dbg(&pdev->dev, "released and freed device\n"); |
| 1769 | return 0; | 1784 | return 0; |
| @@ -1337,6 +1337,7 @@ static int ftgmac100_poll(struct napi_struct *napi, int budget) · 1336 unmodified lines | |||
| 1337 | */ | 1337 | */ |
| 1338 | if (unlikely(priv->need_mac_restart)) { | 1338 | if (unlikely(priv->need_mac_restart)) { |
| 1339 | ftgmac100_start_hw(priv); | 1339 | ftgmac100_start_hw(priv); |
| 1340 | priv->need_mac_restart = false; | ||
| 1340 | 1341 | ||
| 1341 | /* Re-enable "bad" interrupts */ | 1342 | /* Re-enable "bad" interrupts */ |
| 1342 | iowrite32(FTGMAC100_INT_BAD, | 1343 | iowrite32(FTGMAC100_INT_BAD, |
| @@ -281,6 +281,8 @@ static int enetc_poll(struct napi_struct *napi, int budget) · 280 unmodified lines | |||
| 281 | int work_done; | 281 | int work_done; |
| 282 | int i; | 282 | int i; |
| 283 | 283 | ||
| 284 | enetc_lock_mdio(); | ||
| 285 | |||
| 284 | for (i = 0; i < v->count_tx_rings; i++) | 286 | for (i = 0; i < v->count_tx_rings; i++) |
| 285 | if (!enetc_clean_tx_ring(&v->tx_ring[i], budget)) | 287 | if (!enetc_clean_tx_ring(&v->tx_ring[i], budget)) |
| 286 | complete = false; | 288 | complete = false; |
| @@ -291,8 +293,10 @@ static int enetc_poll(struct napi_struct *napi, int budget) · 4 unmodified lines | |||
| 291 | if (work_done) | 293 | if (work_done) |
| 292 | v->rx_napi_work = true; | 294 | v->rx_napi_work = true; |
| 293 | 295 | ||
| 294 | if (!complete) | 296 | if (!complete) { |
| 297 | enetc_unlock_mdio(); | ||
| 295 | return budget; | 298 | return budget; |
| 299 | } | ||
| 296 | 300 | ||
| 297 | napi_complete_done(napi, work_done); | 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 | v->rx_napi_work = false; | 306 | v->rx_napi_work = false; |
| 303 | 307 | ||
| 304 | enetc_lock_mdio(); | ||
| 305 | |||
| 306 | /* enable interrupts */ | 308 | /* enable interrupts */ |
| 307 | enetc_wr_reg_hot(v->rbier, ENETC_RBIER_RXTIE); | 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 | u32 lo, hi, tstamp_lo; | 330 | u32 lo, hi, tstamp_lo; |
| 329 | 331 | ||
| 330 | lo = enetc_rd(hw, ENETC_SICTR0); | 332 | lo = enetc_rd_hot(hw, ENETC_SICTR0); |
| 331 | hi = enetc_rd(hw, ENETC_SICTR1); | 333 | hi = enetc_rd_hot(hw, ENETC_SICTR1); |
| 332 | tstamp_lo = le32_to_cpu(txbd->wb.tstamp); | 334 | tstamp_lo = le32_to_cpu(txbd->wb.tstamp); |
| 333 | if (lo <= tstamp_lo) | 335 | if (lo <= tstamp_lo) |
| 334 | hi -= 1; | 336 | hi -= 1; |
| @@ -342,6 +344,12 @@ static void enetc_tstamp_tx(struct sk_buff *skb, u64 tstamp) · 7 unmodified lines | |||
| 342 | if (skb_shinfo(skb)->tx_flags & SKBTX_IN_PROGRESS) { | 344 | if (skb_shinfo(skb)->tx_flags & SKBTX_IN_PROGRESS) { |
| 343 | memset(&shhwtstamps, 0, sizeof(shhwtstamps)); | 345 | memset(&shhwtstamps, 0, sizeof(shhwtstamps)); |
| 344 | shhwtstamps.hwtstamp = ns_to_ktime(tstamp); | 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 | skb_tstamp_tx(skb, &shhwtstamps); | 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 | i = tx_ring->next_to_clean; | 366 | i = tx_ring->next_to_clean; |
| 359 | tx_swbd = &tx_ring->tx_swbd[i]; | 367 | tx_swbd = &tx_ring->tx_swbd[i]; |
| 360 | 368 | ||
| 361 | enetc_lock_mdio(); | ||
| 362 | bds_to_clean = enetc_bd_ready_count(tx_ring, i); | 369 | bds_to_clean = enetc_bd_ready_count(tx_ring, i); |
| 363 | enetc_unlock_mdio(); | ||
| 364 | 370 | ||
| 365 | do_tstamp = false; | 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 | tx_swbd = tx_ring->tx_swbd; | 409 | tx_swbd = tx_ring->tx_swbd; |
| 404 | } | 410 | } |
| 405 | 411 | ||
| 406 | enetc_lock_mdio(); | ||
| 407 | |||
| 408 | /* BD iteration loop end */ | 412 | /* BD iteration loop end */ |
| 409 | if (is_eof) { | 413 | if (is_eof) { |
| 410 | tx_frm_cnt++; | 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.