Merge series from Mark Brown <broonie@kernel.org>: The recently added pcm-test selftest has pointed out that systems with the tda998x driver end up advertising that they support capture when in reality as far as I can see the tda998x devices are transmit only. The DAIs registered through hdmi-codec are bidirectional, meaning that for I2S systems when combined with a typical bidrectional CPU DAI the overall capability of the PCM is bidirectional. In most cases the I2S links will clock OK but no useful audio will be returned which isn't so bad but we should still not advertise the useless capability, and some systems may notice problems for example due to pinmux management. This is happening due to the hdmi-codec helpers not providing any mechanism for indicating unidirectional audio so add one and use it in the tda998x driver. It is likely other hdmi-codec users are also affected but I don't have those systems to hand. Mark Brown (2): ASoC: hdmi-codec: Allow playback and capture to be disabled drm: tda99x: Don't advertise non-existent capture support drivers/gpu/drm/i2c/tda998x_drv.c | 2 ++ include/sound/hdmi-codec.h | 4 ++++ sound/soc/codecs/hdmi-codec.c | 30 +++++++++++++++++++++++++----- 3 files changed, 31 insertions(+), 5 deletions(-) base-commit: f0c4d9fc9cc9462659728d168387191387e903cc -- 2.30.2
Unified · Split
| @@ -2452,6 +2452,10 @@ S: 482 Shadowgraph Dr. · 2451 unmodified lines | |||
| 2452 | S: San Jose, CA 95110 | 2452 | S: San Jose, CA 95110 |
| 2453 | S: USA | 2453 | S: USA |
| 2454 | 2454 | ||
| 2455 | N: Michal Marek | ||
| 2456 | E: michal.lkml@markovi.net | ||
| 2457 | D: Kbuild Maintainer 2009-2017 | ||
| 2458 | |||
| 2455 | N: Martin Mares | 2459 | N: Martin Mares |
| 2456 | E: mj@ucw.cz | 2460 | E: mj@ucw.cz |
| 2457 | W: http://www.ucw.cz/~mj/ | 2461 | W: http://www.ucw.cz/~mj/ |
| @@ -16,8 +16,11 @@ description: · 15 unmodified lines | |||
| 16 | 16 | ||
| 17 | properties: | 17 | properties: |
| 18 | compatible: | 18 | compatible: |
| 19 | items: | 19 | oneOf: |
| 20 | - const: goodix,gt7375p | 20 | - const: goodix,gt7375p |
| 21 | - items: | ||
| 22 | - const: goodix,gt7986u | ||
| 23 | - const: goodix,gt7375p | ||
| 21 | 24 | ||
| 22 | reg: | 25 | reg: |
| 23 | enum: | 26 | enum: |
| @@ -16,12 +16,11 @@ Parallel Port Devices · 15 unmodified lines | |||
| 16 | 16x50 UART Driver | 16 | 16x50 UART Driver |
| 17 | ================= | 17 | ================= |
| 18 | 18 | ||
| 19 | .. kernel-doc:: drivers/tty/serial/serial_core.c | ||
| 20 | :export: | ||
| 21 | |||
| 22 | .. kernel-doc:: drivers/tty/serial/8250/8250_core.c | 19 | .. kernel-doc:: drivers/tty/serial/8250/8250_core.c |
| 23 | :export: | 20 | :export: |
| 24 | 21 | ||
| 22 | See serial/driver.rst for related APIs. | ||
| 23 | |||
| 25 | Pulse-Width Modulation (PWM) | 24 | Pulse-Width Modulation (PWM) |
| 26 | ============================ | 25 | ============================ |
| 27 | 26 | ||
| @@ -51,7 +51,7 @@ the Technical Advisory Board (TAB) or other maintainers if you're · 50 unmodified lines | |||
| 51 | uncertain how to handle situations that come up. It will not be | 51 | uncertain how to handle situations that come up. It will not be |
| 52 | considered a violation report unless you want it to be. If you are | 52 | considered a violation report unless you want it to be. If you are |
| 53 | uncertain about approaching the TAB or any other maintainers, please | 53 | uncertain about approaching the TAB or any other maintainers, please |
| 54 | reach out to our conflict mediator, Joanna Lee <joanna.lee@gesmer.com>. | 54 | reach out to our conflict mediator, Joanna Lee <jlee@linuxfoundation.org>. |
| 55 | 55 | ||
| 56 | In the end, "be kind to each other" is really what the end goal is for | 56 | In the end, "be kind to each other" is really what the end goal is for |
| 57 | everybody. We know everyone is human and we all fail at times, but the | 57 | everybody. We know everyone is human and we all fail at times, but the |
| @@ -2197,7 +2197,7 @@ M: Wei Xu <xuwei5@hisilicon.com> · 2196 unmodified lines | |||
| 2197 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) | 2197 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) |
| 2198 | S: Supported | 2198 | S: Supported |
| 2199 | W: http://www.hisilicon.com | 2199 | W: http://www.hisilicon.com |
| 2200 | T: git git://github.com/hisilicon/linux-hisi.git | 2200 | T: git https://github.com/hisilicon/linux-hisi.git |
| 2201 | F: arch/arm/boot/dts/hi3* | 2201 | F: arch/arm/boot/dts/hi3* |
| 2202 | F: arch/arm/boot/dts/hip* | 2202 | F: arch/arm/boot/dts/hip* |
| 2203 | F: arch/arm/boot/dts/hisi* | 2203 | F: arch/arm/boot/dts/hisi* |
| @@ -4809,7 +4809,7 @@ R: Jeff Layton <jlayton@kernel.org> · 2605 unmodified lines | |||
| 4809 | L: ceph-devel@vger.kernel.org | 4809 | L: ceph-devel@vger.kernel.org |
| 4810 | S: Supported | 4810 | S: Supported |
| 4811 | W: http://ceph.com/ | 4811 | W: http://ceph.com/ |
| 4812 | T: git git://github.com/ceph/ceph-client.git | 4812 | T: git https://github.com/ceph/ceph-client.git |
| 4813 | F: include/linux/ceph/ | 4813 | F: include/linux/ceph/ |
| 4814 | F: include/linux/crush/ | 4814 | F: include/linux/crush/ |
| 4815 | F: net/ceph/ | 4815 | F: net/ceph/ |
| @@ -4821,7 +4821,7 @@ R: Jeff Layton <jlayton@kernel.org> · 5 unmodified lines | |||
| 4821 | L: ceph-devel@vger.kernel.org | 4821 | L: ceph-devel@vger.kernel.org |
| 4822 | S: Supported | 4822 | S: Supported |
| 4823 | W: http://ceph.com/ | 4823 | W: http://ceph.com/ |
| 4824 | T: git git://github.com/ceph/ceph-client.git | 4824 | T: git https://github.com/ceph/ceph-client.git |
| 4825 | F: Documentation/filesystems/ceph.rst | 4825 | F: Documentation/filesystems/ceph.rst |
| 4826 | F: fs/ceph/ | 4826 | F: fs/ceph/ |
| 4827 | 4827 | ||
| @@ -11035,6 +11035,7 @@ KCONFIG · 6207 unmodified lines | |||
| 11035 | M: Masahiro Yamada <masahiroy@kernel.org> | 11035 | M: Masahiro Yamada <masahiroy@kernel.org> |
| 11036 | L: linux-kbuild@vger.kernel.org | 11036 | L: linux-kbuild@vger.kernel.org |
| 11037 | S: Maintained | 11037 | S: Maintained |
| 11038 | Q: https://patchwork.kernel.org/project/linux-kbuild/list/ | ||
| 11038 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git kconfig | 11039 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git kconfig |
| 11039 | F: Documentation/kbuild/kconfig* | 11040 | F: Documentation/kbuild/kconfig* |
| 11040 | F: scripts/Kconfig.include | 11041 | F: scripts/Kconfig.include |
| @@ -11092,10 +11093,12 @@ F: fs/autofs/ · 51 unmodified lines | |||
| 11092 | 11093 | ||
| 11093 | KERNEL BUILD + files below scripts/ (unless maintained elsewhere) | 11094 | KERNEL BUILD + files below scripts/ (unless maintained elsewhere) |
| 11094 | M: Masahiro Yamada <masahiroy@kernel.org> | 11095 | M: Masahiro Yamada <masahiroy@kernel.org> |
| 11095 | M: Michal Marek <michal.lkml@markovi.net> | 11096 | R: Nathan Chancellor <nathan@kernel.org> |
| 11096 | R: Nick Desaulniers <ndesaulniers@google.com> | 11097 | R: Nick Desaulniers <ndesaulniers@google.com> |
| 11098 | R: Nicolas Schier <nicolas@fjasle.eu> | ||
| 11097 | L: linux-kbuild@vger.kernel.org | 11099 | L: linux-kbuild@vger.kernel.org |
| 11098 | S: Maintained | 11100 | S: Maintained |
| 11101 | Q: https://patchwork.kernel.org/project/linux-kbuild/list/ | ||
| 11099 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git | 11102 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git |
| 11100 | F: Documentation/kbuild/ | 11103 | F: Documentation/kbuild/ |
| 11101 | F: Makefile | 11104 | F: Makefile |
| @@ -13625,6 +13628,12 @@ S: Supported · 2523 unmodified lines | |||
| 13625 | F: drivers/misc/atmel-ssc.c | 13628 | F: drivers/misc/atmel-ssc.c |
| 13626 | F: include/linux/atmel-ssc.h | 13629 | F: include/linux/atmel-ssc.h |
| 13627 | 13630 | ||
| 13631 | MICROCHIP SOC DRIVERS | ||
| 13632 | M: Conor Dooley <conor@kernel.org> | ||
| 13633 | S: Supported | ||
| 13634 | T: git https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux.git/ | ||
| 13635 | F: drivers/soc/microchip/ | ||
| 13636 | |||
| 13628 | MICROCHIP USB251XB DRIVER | 13637 | MICROCHIP USB251XB DRIVER |
| 13629 | M: Richard Leitner <richard.leitner@skidata.com> | 13638 | M: Richard Leitner <richard.leitner@skidata.com> |
| 13630 | L: linux-usb@vger.kernel.org | 13639 | L: linux-usb@vger.kernel.org |
| @@ -17222,7 +17231,7 @@ R: Dongsheng Yang <dongsheng.yang@easystack.cn> · 3591 unmodified lines | |||
| 17222 | L: ceph-devel@vger.kernel.org | 17231 | L: ceph-devel@vger.kernel.org |
| 17223 | S: Supported | 17232 | S: Supported |
| 17224 | W: http://ceph.com/ | 17233 | W: http://ceph.com/ |
| 17225 | T: git git://github.com/ceph/ceph-client.git | 17234 | T: git https://github.com/ceph/ceph-client.git |
| 17226 | F: Documentation/ABI/testing/sysfs-bus-rbd | 17235 | F: Documentation/ABI/testing/sysfs-bus-rbd |
| 17227 | F: drivers/block/rbd.c | 17236 | F: drivers/block/rbd.c |
| 17228 | F: drivers/block/rbd_types.h | 17237 | F: drivers/block/rbd_types.h |
| @@ -17723,7 +17732,7 @@ F: arch/riscv/ · 494 unmodified lines | |||
| 17723 | N: riscv | 17732 | N: riscv |
| 17724 | K: riscv | 17733 | K: riscv |
| 17725 | 17734 | ||
| 17726 | RISC-V/MICROCHIP POLARFIRE SOC SUPPORT | 17735 | RISC-V MICROCHIP FPGA SUPPORT |
| 17727 | M: Conor Dooley <conor.dooley@microchip.com> | 17736 | M: Conor Dooley <conor.dooley@microchip.com> |
| 17728 | M: Daire McNamara <daire.mcnamara@microchip.com> | 17737 | M: Daire McNamara <daire.mcnamara@microchip.com> |
| 17729 | L: linux-riscv@lists.infradead.org | 17738 | L: linux-riscv@lists.infradead.org |
| @@ -17741,17 +17750,26 @@ F: Documentation/devicetree/bindings/usb/microchip,mpfs-musb.yaml · 11 unmodified lines | |||
| 17741 | F: arch/riscv/boot/dts/microchip/ | 17750 | F: arch/riscv/boot/dts/microchip/ |
| 17742 | F: drivers/char/hw_random/mpfs-rng.c | 17751 | F: drivers/char/hw_random/mpfs-rng.c |
| 17743 | F: drivers/clk/microchip/clk-mpfs.c | 17752 | F: drivers/clk/microchip/clk-mpfs.c |
| 17744 | F: drivers/i2c/busses/i2c-microchip-core.c | 17753 | F: drivers/i2c/busses/i2c-microchip-corei2c.c |
| 17745 | F: drivers/mailbox/mailbox-mpfs.c | 17754 | F: drivers/mailbox/mailbox-mpfs.c |
| 17746 | F: drivers/pci/controller/pcie-microchip-host.c | 17755 | F: drivers/pci/controller/pcie-microchip-host.c |
| 17747 | F: drivers/reset/reset-mpfs.c | 17756 | F: drivers/reset/reset-mpfs.c |
| 17748 | F: drivers/rtc/rtc-mpfs.c | 17757 | F: drivers/rtc/rtc-mpfs.c |
| 17749 | F: drivers/soc/microchip/ | 17758 | F: drivers/soc/microchip/mpfs-sys-controller.c |
| 17750 | F: drivers/spi/spi-microchip-core-qspi.c | 17759 | F: drivers/spi/spi-microchip-core-qspi.c |
| 17751 | F: drivers/spi/spi-microchip-core.c | 17760 | F: drivers/spi/spi-microchip-core.c |
| 17752 | F: drivers/usb/musb/mpfs.c | 17761 | F: drivers/usb/musb/mpfs.c |
| 17753 | F: include/soc/microchip/mpfs.h | 17762 | F: include/soc/microchip/mpfs.h |
| 17754 | 17763 | ||
| 17764 | RISC-V MISC SOC SUPPORT | ||
| 17765 | M: Conor Dooley <conor@kernel.org> | ||
| 17766 | L: linux-riscv@lists.infradead.org | ||
| 17767 | S: Maintained | ||
| 17768 | Q: https://patchwork.kernel.org/project/linux-riscv/list/ | ||
| 17769 | T: git https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux.git/ | ||
| 17770 | F: Documentation/devicetree/bindings/riscv/ | ||
| 17771 | F: arch/riscv/boot/dts/ | ||
| 17772 | |||
| 17755 | RNBD BLOCK DRIVERS | 17773 | RNBD BLOCK DRIVERS |
| 17756 | M: Md. Haris Iqbal <haris.iqbal@ionos.com> | 17774 | M: Md. Haris Iqbal <haris.iqbal@ionos.com> |
| 17757 | M: Jack Wang <jinpu.wang@ionos.com> | 17775 | M: Jack Wang <jinpu.wang@ionos.com> |
| @@ -18778,7 +18796,6 @@ M: Palmer Dabbelt <palmer@dabbelt.com> · 1020 unmodified lines | |||
| 18778 | M: Paul Walmsley <paul.walmsley@sifive.com> | 18796 | M: Paul Walmsley <paul.walmsley@sifive.com> |
| 18779 | L: linux-riscv@lists.infradead.org | 18797 | L: linux-riscv@lists.infradead.org |
| 18780 | S: Supported | 18798 | S: Supported |
| 18781 | T: git https://github.com/sifive/riscv-linux.git | ||
| 18782 | N: sifive | 18799 | N: sifive |
| 18783 | K: [^@]sifive | 18800 | K: [^@]sifive |
| 18784 | 18801 | ||
| @@ -18797,6 +18814,13 @@ S: Maintained · 12 unmodified lines | |||
| 18797 | F: Documentation/devicetree/bindings/dma/sifive,fu540-c000-pdma.yaml | 18814 | F: Documentation/devicetree/bindings/dma/sifive,fu540-c000-pdma.yaml |
| 18798 | F: drivers/dma/sf-pdma/ | 18815 | F: drivers/dma/sf-pdma/ |
| 18799 | 18816 | ||
| 18817 | SIFIVE SOC DRIVERS | ||
| 18818 | M: Conor Dooley <conor@kernel.org> | ||
| 18819 | L: linux-riscv@lists.infradead.org | ||
| 18820 | S: Maintained | ||
| 18821 | T: git https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux.git/ | ||
| 18822 | F: drivers/soc/sifive/ | ||
| 18823 | |||
| 18800 | SILEAD TOUCHSCREEN DRIVER | 18824 | SILEAD TOUCHSCREEN DRIVER |
| 18801 | M: Hans de Goede <hdegoede@redhat.com> | 18825 | M: Hans de Goede <hdegoede@redhat.com> |
| 18802 | L: linux-input@vger.kernel.org | 18826 | L: linux-input@vger.kernel.org |
| @@ -19598,6 +19622,11 @@ M: Ion Badulescu <ionut@badula.org> · 795 unmodified lines | |||
| 19598 | S: Odd Fixes | 19622 | S: Odd Fixes |
| 19599 | F: drivers/net/ethernet/adaptec/starfire* | 19623 | F: drivers/net/ethernet/adaptec/starfire* |
| 19600 | 19624 | ||
| 19625 | STARFIVE DEVICETREES | ||
| 19626 | M: Emil Renner Berthing <kernel@esmil.dk> | ||
| 19627 | S: Maintained | ||
| 19628 | F: arch/riscv/boot/dts/starfive/ | ||
| 19629 | |||
| 19601 | STARFIVE JH7100 CLOCK DRIVERS | 19630 | STARFIVE JH7100 CLOCK DRIVERS |
| 19602 | M: Emil Renner Berthing <kernel@esmil.dk> | 19631 | M: Emil Renner Berthing <kernel@esmil.dk> |
| 19603 | S: Maintained | 19632 | S: Maintained |
| @@ -2,7 +2,7 @@ · 1 unmodified line | |||
| 2 | VERSION = 6 | 2 | VERSION = 6 |
| 3 | PATCHLEVEL = 1 | 3 | PATCHLEVEL = 1 |
| 4 | SUBLEVEL = 0 | 4 | SUBLEVEL = 0 |
| 5 | EXTRAVERSION = -rc5 | 5 | EXTRAVERSION = -rc6 |
| 6 | NAME = Hurr durr I'ma ninja sloth | 6 | NAME = Hurr durr I'ma ninja sloth |
| 7 | 7 | ||
| 8 | # *DOCUMENTATION* | 8 | # *DOCUMENTATION* |
| @@ -1270,10 +1270,10 @@ · 1269 unmodified lines | |||
| 1270 | clocks = <&clks IMX7D_NAND_USDHC_BUS_RAWNAND_CLK>; | 1270 | clocks = <&clks IMX7D_NAND_USDHC_BUS_RAWNAND_CLK>; |
| 1271 | }; | 1271 | }; |
| 1272 | 1272 | ||
| 1273 | gpmi: nand-controller@33002000{ | 1273 | gpmi: nand-controller@33002000 { |
| 1274 | compatible = "fsl,imx7d-gpmi-nand"; | 1274 | compatible = "fsl,imx7d-gpmi-nand"; |
| 1275 | #address-cells = <1>; | 1275 | #address-cells = <1>; |
| 1276 | #size-cells = <1>; | 1276 | #size-cells = <0>; |
| 1277 | reg = <0x33002000 0x2000>, <0x33004000 0x4000>; | 1277 | reg = <0x33002000 0x2000>, <0x33004000 0x4000>; |
| 1278 | reg-names = "gpmi-nand", "bch"; | 1278 | reg-names = "gpmi-nand", "bch"; |
| 1279 | interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>; | 1279 | interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>; |
| @@ -69,6 +69,12 @@ · 68 unmodified lines | |||
| 69 | pins = "GPIO_35", "GPIO_36"; | 69 | pins = "GPIO_35", "GPIO_36"; |
| 70 | function = "can0_b"; | 70 | function = "can0_b"; |
| 71 | }; | 71 | }; |
| 72 | |||
| 73 | sgpio_a_pins: sgpio-a-pins { | ||
| 74 | /* SCK, D0, D1, LD */ | ||
| 75 | pins = "GPIO_32", "GPIO_33", "GPIO_34", "GPIO_35"; | ||
| 76 | function = "sgpio_a"; | ||
| 77 | }; | ||
| 72 | }; | 78 | }; |
| 73 | 79 | ||
| 74 | &can0 { | 80 | &can0 { |
| @@ -118,6 +124,20 @@ · 43 unmodified lines | |||
| 118 | status = "okay"; | 124 | status = "okay"; |
| 119 | }; | 125 | }; |
| 120 | 126 | ||
| 127 | &sgpio { | ||
| 128 | pinctrl-0 = <&sgpio_a_pins>; | ||
| 129 | pinctrl-names = "default"; | ||
| 130 | microchip,sgpio-port-ranges = <0 3>, <8 11>; | ||
| 131 | status = "okay"; | ||
| 132 | |||
| 133 | gpio@0 { | ||
| 134 | ngpios = <64>; | ||
| 135 | }; | ||
| 136 | gpio@1 { | ||
| 137 | ngpios = <64>; | ||
| 138 | }; | ||
| 139 | }; | ||
| 140 | |||
| 121 | &switch { | 141 | &switch { |
| 122 | status = "okay"; | 142 | status = "okay"; |
| 123 | }; | 143 | }; |
| @@ -261,7 +261,7 @@ · 260 unmodified lines | |||
| 261 | #define PIN_PB2__FLEXCOM6_IO0 PINMUX_PIN(PIN_PB2, 2, 1) | 261 | #define PIN_PB2__FLEXCOM6_IO0 PINMUX_PIN(PIN_PB2, 2, 1) |
| 262 | #define PIN_PB2__ADTRG PINMUX_PIN(PIN_PB2, 3, 1) | 262 | #define PIN_PB2__ADTRG PINMUX_PIN(PIN_PB2, 3, 1) |
| 263 | #define PIN_PB2__A20 PINMUX_PIN(PIN_PB2, 4, 1) | 263 | #define PIN_PB2__A20 PINMUX_PIN(PIN_PB2, 4, 1) |
| 264 | #define PIN_PB2__FLEXCOM11_IO0 PINMUX_PIN(PIN_PB2, 6, 3) | 264 | #define PIN_PB2__FLEXCOM11_IO1 PINMUX_PIN(PIN_PB2, 6, 3) |
| 265 | #define PIN_PB3 35 | 265 | #define PIN_PB3 35 |
| 266 | #define PIN_PB3__GPIO PINMUX_PIN(PIN_PB3, 0, 0) | 266 | #define PIN_PB3__GPIO PINMUX_PIN(PIN_PB3, 0, 0) |
| 267 | #define PIN_PB3__RF1 PINMUX_PIN(PIN_PB3, 1, 1) | 267 | #define PIN_PB3__RF1 PINMUX_PIN(PIN_PB3, 1, 1) |
| @@ -169,10 +169,15 @@ sr_ena_2: · 168 unmodified lines | |||
| 169 | cmp tmp1, #UDDRC_STAT_SELFREF_TYPE_SW | 169 | cmp tmp1, #UDDRC_STAT_SELFREF_TYPE_SW |
| 170 | bne sr_ena_2 | 170 | bne sr_ena_2 |
| 171 | 171 | ||
| 172 | /* Put DDR PHY's DLL in bypass mode for non-backup modes. */ | 172 | /* Disable DX DLLs for non-backup modes. */ |
| 173 | cmp r7, #AT91_PM_BACKUP | 173 | cmp r7, #AT91_PM_BACKUP |
| 174 | beq sr_ena_3 | 174 | beq sr_ena_3 |
| 175 | 175 | ||
| 176 | /* Do not soft reset the AC DLL. */ | ||
| 177 | ldr tmp1, [r3, DDR3PHY_ACDLLCR] | ||
| 178 | bic tmp1, tmp1, DDR3PHY_ACDLLCR_DLLSRST | ||
| 179 | str tmp1, [r3, DDR3PHY_ACDLLCR] | ||
| 180 | |||
| 176 | /* Disable DX DLLs. */ | 181 | /* Disable DX DLLs. */ |
| 177 | ldr tmp1, [r3, #DDR3PHY_DX0DLLCR] | 182 | ldr tmp1, [r3, #DDR3PHY_DX0DLLCR] |
| 178 | orr tmp1, tmp1, #DDR3PHY_DXDLLCR_DLLDIS | 183 | orr tmp1, tmp1, #DDR3PHY_DXDLLCR_DLLDIS |
| @@ -34,11 +34,25 @@ · 33 unmodified lines | |||
| 34 | off-on-delay-us = <12000>; | 34 | off-on-delay-us = <12000>; |
| 35 | }; | 35 | }; |
| 36 | 36 | ||
| 37 | extcon_usbotg1: extcon-usbotg1 { | 37 | connector { |
| 38 | compatible = "linux,extcon-usb-gpio"; | 38 | compatible = "gpio-usb-b-connector", "usb-b-connector"; |
| 39 | type = "micro"; | ||
| 40 | label = "X19"; | ||
| 39 | pinctrl-names = "default"; | 41 | pinctrl-names = "default"; |
| 40 | pinctrl-0 = <&pinctrl_usb1_extcon>; | 42 | pinctrl-0 = <&pinctrl_usb1_connector>; |
| 41 | id-gpio = <&gpio1 10 GPIO_ACTIVE_HIGH>; | 43 | id-gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>; |
| 44 | |||
| 45 | ports { | ||
| 46 | #address-cells = <1>; | ||
| 47 | #size-cells = <0>; | ||
| 48 | |||
| 49 | port@0 { | ||
| 50 | reg = <0>; | ||
| 51 | usb_dr_connector: endpoint { | ||
| 52 | remote-endpoint = <&usb1_drd_sw>; | ||
| 53 | }; | ||
| 54 | }; | ||
| 55 | }; | ||
| 42 | }; | 56 | }; |
| 43 | }; | 57 | }; |
| 44 | 58 | ||
| @@ -105,13 +119,19 @@ · 60 unmodified lines | |||
| 105 | pinctrl-names = "default"; | 119 | pinctrl-names = "default"; |
| 106 | pinctrl-0 = <&pinctrl_usbotg1>; | 120 | pinctrl-0 = <&pinctrl_usbotg1>; |
| 107 | dr_mode = "otg"; | 121 | dr_mode = "otg"; |
| 108 | extcon = <&extcon_usbotg1>; | ||
| 109 | srp-disable; | 122 | srp-disable; |
| 110 | hnp-disable; | 123 | hnp-disable; |
| 111 | adp-disable; | 124 | adp-disable; |
| 112 | power-active-high; | 125 | power-active-high; |
| 113 | over-current-active-low; | 126 | over-current-active-low; |
| 127 | usb-role-switch; | ||
| 114 | status = "okay"; | 128 | status = "okay"; |
| 129 | |||
| 130 | port { | ||
| 131 | usb1_drd_sw: endpoint { | ||
| 132 | remote-endpoint = <&usb_dr_connector>; | ||
| 133 | }; | ||
| 134 | }; | ||
| 115 | }; | 135 | }; |
| 116 | 136 | ||
| 117 | &usbotg2 { | 137 | &usbotg2 { |
| @@ -231,7 +251,7 @@ · 113 unmodified lines | |||
| 231 | <MX8MM_IOMUXC_GPIO1_IO13_USB1_OTG_OC 0x84>; | 251 | <MX8MM_IOMUXC_GPIO1_IO13_USB1_OTG_OC 0x84>; |
| 232 | }; | 252 | }; |
| 233 | 253 | ||
| 234 | pinctrl_usb1_extcon: usb1-extcongrp { | 254 | pinctrl_usb1_connector: usb1-connectorgrp { |
| 235 | fsl,pins = <MX8MM_IOMUXC_GPIO1_IO10_GPIO1_IO10 0x1c0>; | 255 | fsl,pins = <MX8MM_IOMUXC_GPIO1_IO10_GPIO1_IO10 0x1c0>; |
| 236 | }; | 256 | }; |
| 237 | 257 | ||
| @@ -1244,10 +1244,10 @@ · 1243 unmodified lines | |||
| 1244 | clocks = <&clk IMX8MM_CLK_NAND_USDHC_BUS_RAWNAND_CLK>; | 1244 | clocks = <&clk IMX8MM_CLK_NAND_USDHC_BUS_RAWNAND_CLK>; |
| 1245 | }; | 1245 | }; |
| 1246 | 1246 | ||
| 1247 | gpmi: nand-controller@33002000{ | 1247 | gpmi: nand-controller@33002000 { |
| 1248 | compatible = "fsl,imx8mm-gpmi-nand", "fsl,imx7d-gpmi-nand"; | 1248 | compatible = "fsl,imx8mm-gpmi-nand", "fsl,imx7d-gpmi-nand"; |
| 1249 | #address-cells = <1>; | 1249 | #address-cells = <1>; |
| 1250 | #size-cells = <1>; | 1250 | #size-cells = <0>; |
| 1251 | reg = <0x33002000 0x2000>, <0x33004000 0x4000>; | 1251 | reg = <0x33002000 0x2000>, <0x33004000 0x4000>; |
| 1252 | reg-names = "gpmi-nand", "bch"; | 1252 | reg-names = "gpmi-nand", "bch"; |
| 1253 | interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>; | 1253 | interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>; |
| @@ -1102,7 +1102,7 @@ · 1101 unmodified lines | |||
| 1102 | gpmi: nand-controller@33002000 { | 1102 | gpmi: nand-controller@33002000 { |
| 1103 | compatible = "fsl,imx8mn-gpmi-nand", "fsl,imx7d-gpmi-nand"; | 1103 | compatible = "fsl,imx8mn-gpmi-nand", "fsl,imx7d-gpmi-nand"; |
| 1104 | #address-cells = <1>; | 1104 | #address-cells = <1>; |
| 1105 | #size-cells = <1>; | 1105 | #size-cells = <0>; |
| 1106 | reg = <0x33002000 0x2000>, <0x33004000 0x4000>; | 1106 | reg = <0x33002000 0x2000>, <0x33004000 0x4000>; |
| 1107 | reg-names = "gpmi-nand", "bch"; | 1107 | reg-names = "gpmi-nand", "bch"; |
| 1108 | interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>; | 1108 | interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>; |
File mode changed from 100755 to 100644.
| @@ -668,7 +668,7 @@ · 667 unmodified lines | |||
| 668 | 668 | ||
| 669 | apcs_glb: mailbox@b111000 { | 669 | apcs_glb: mailbox@b111000 { |
| 670 | compatible = "qcom,ipq8074-apcs-apps-global"; | 670 | compatible = "qcom,ipq8074-apcs-apps-global"; |
| 671 | reg = <0x0b111000 0x6000>; | 671 | reg = <0x0b111000 0x1000>; |
| 672 | 672 | ||
| 673 | #clock-cells = <1>; | 673 | #clock-cells = <1>; |
| 674 | #mbox-cells = <1>; | 674 | #mbox-cells = <1>; |
| @@ -3504,7 +3504,7 @@ · 3503 unmodified lines | |||
| 3504 | }; | 3504 | }; |
| 3505 | 3505 | ||
| 3506 | saw3: syscon@9a10000 { | 3506 | saw3: syscon@9a10000 { |
| 3507 | compatible = "qcom,tcsr-msm8996", "syscon"; | 3507 | compatible = "syscon"; |
| 3508 | reg = <0x09a10000 0x1000>; | 3508 | reg = <0x09a10000 0x1000>; |
| 3509 | }; | 3509 | }; |
| 3510 | 3510 | ||
| @@ -43,7 +43,6 @@ · 42 unmodified lines | |||
| 43 | 43 | ||
| 44 | regulator-always-on; | 44 | regulator-always-on; |
| 45 | regulator-boot-on; | 45 | regulator-boot-on; |
| 46 | regulator-allow-set-load; | ||
| 47 | 46 | ||
| 48 | vin-supply = <&vreg_3p3>; | 47 | vin-supply = <&vreg_3p3>; |
| 49 | }; | 48 | }; |
| @@ -137,6 +136,9 @@ · 87 unmodified lines | |||
| 137 | regulator-max-microvolt = <880000>; | 136 | regulator-max-microvolt = <880000>; |
| 138 | regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; | 137 | regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; |
| 139 | regulator-allow-set-load; | 138 | regulator-allow-set-load; |
| 139 | regulator-allowed-modes = | ||
| 140 | <RPMH_REGULATOR_MODE_LPM | ||
| 141 | RPMH_REGULATOR_MODE_HPM>; | ||
| 140 | }; | 142 | }; |
| 141 | 143 | ||
| 142 | vreg_l7a_1p8: ldo7 { | 144 | vreg_l7a_1p8: ldo7 { |
| @@ -152,6 +154,9 @@ · 9 unmodified lines | |||
| 152 | regulator-max-microvolt = <2960000>; | 154 | regulator-max-microvolt = <2960000>; |
| 153 | regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; | 155 | regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; |
| 154 | regulator-allow-set-load; | 156 | regulator-allow-set-load; |
| 157 | regulator-allowed-modes = | ||
| 158 | <RPMH_REGULATOR_MODE_LPM | ||
| 159 | RPMH_REGULATOR_MODE_HPM>; | ||
| 155 | }; | 160 | }; |
| 156 | 161 | ||
| 157 | vreg_l11a_0p8: ldo11 { | 162 | vreg_l11a_0p8: ldo11 { |
| @@ -258,6 +263,9 @@ · 100 unmodified lines | |||
| 258 | regulator-max-microvolt = <1200000>; | 263 | regulator-max-microvolt = <1200000>; |
| 259 | regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; | 264 | regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; |
| 260 | regulator-allow-set-load; | 265 | regulator-allow-set-load; |
| 266 | regulator-allowed-modes = | ||
| 267 | <RPMH_REGULATOR_MODE_LPM | ||
| 268 | RPMH_REGULATOR_MODE_HPM>; | ||
| 261 | }; | 269 | }; |
| 262 | 270 | ||
| 263 | vreg_l7c_1p8: ldo7 { | 271 | vreg_l7c_1p8: ldo7 { |
| @@ -273,6 +281,9 @@ · 9 unmodified lines | |||
| 273 | regulator-max-microvolt = <1200000>; | 281 | regulator-max-microvolt = <1200000>; |
| 274 | regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; | 282 | regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; |
| 275 | regulator-allow-set-load; | 283 | regulator-allow-set-load; |
| 284 | regulator-allowed-modes = | ||
| 285 | <RPMH_REGULATOR_MODE_LPM | ||
| 286 | RPMH_REGULATOR_MODE_HPM>; | ||
| 276 | }; | 287 | }; |
| 277 | 288 | ||
| 278 | vreg_l10c_3p3: ldo10 { | 289 | vreg_l10c_3p3: ldo10 { |
| @@ -83,6 +83,9 @@ · 82 unmodified lines | |||
| 83 | regulator-max-microvolt = <1200000>; | 83 | regulator-max-microvolt = <1200000>; |
| 84 | regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; | 84 | regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; |
| 85 | regulator-allow-set-load; | 85 | regulator-allow-set-load; |
| 86 | regulator-allowed-modes = | ||
| 87 | <RPMH_REGULATOR_MODE_LPM | ||
| 88 | RPMH_REGULATOR_MODE_HPM>; | ||
| 86 | }; | 89 | }; |
| 87 | 90 | ||
| 88 | vreg_l4c: ldo4 { | 91 | vreg_l4c: ldo4 { |
| @@ -98,6 +101,9 @@ · 9 unmodified lines | |||
| 98 | regulator-max-microvolt = <1200000>; | 101 | regulator-max-microvolt = <1200000>; |
| 99 | regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; | 102 | regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; |
| 100 | regulator-allow-set-load; | 103 | regulator-allow-set-load; |
| 104 | regulator-allowed-modes = | ||
| 105 | <RPMH_REGULATOR_MODE_LPM | ||
| 106 | RPMH_REGULATOR_MODE_HPM>; | ||
| 101 | }; | 107 | }; |
| 102 | 108 | ||
| 103 | vreg_l7c: ldo7 { | 109 | vreg_l7c: ldo7 { |
| @@ -113,6 +119,9 @@ · 9 unmodified lines | |||
| 113 | regulator-max-microvolt = <2504000>; | 119 | regulator-max-microvolt = <2504000>; |
| 114 | regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; | 120 | regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; |
| 115 | regulator-allow-set-load; | 121 | regulator-allow-set-load; |
| 122 | regulator-allowed-modes = | ||
| 123 | <RPMH_REGULATOR_MODE_LPM | ||
| 124 | RPMH_REGULATOR_MODE_HPM>; | ||
| 116 | }; | 125 | }; |
| 117 | 126 | ||
| 118 | vreg_l17c: ldo17 { | 127 | vreg_l17c: ldo17 { |
| @@ -121,6 +130,9 @@ · 2 unmodified lines | |||
| 121 | regulator-max-microvolt = <2504000>; | 130 | regulator-max-microvolt = <2504000>; |
| 122 | regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; | 131 | regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; |
| 123 | regulator-allow-set-load; | 132 | regulator-allow-set-load; |
| 133 | regulator-allowed-modes = | ||
| 134 | <RPMH_REGULATOR_MODE_LPM | ||
| 135 | RPMH_REGULATOR_MODE_HPM>; | ||
| 124 | }; | 136 | }; |
| 125 | }; | 137 | }; |
| 126 | 138 | ||
| @@ -2296,7 +2296,8 @@ · 2295 unmodified lines | |||
| 2296 | 2296 | ||
| 2297 | lpass_audiocc: clock-controller@3300000 { | 2297 | lpass_audiocc: clock-controller@3300000 { |
| 2298 | compatible = "qcom,sc7280-lpassaudiocc"; | 2298 | compatible = "qcom,sc7280-lpassaudiocc"; |
| 2299 | reg = <0 0x03300000 0 0x30000>; | 2299 | reg = <0 0x03300000 0 0x30000>, |
| 2300 | <0 0x032a9000 0 0x1000>; | ||
| 2300 | clocks = <&rpmhcc RPMH_CXO_CLK>, | 2301 | clocks = <&rpmhcc RPMH_CXO_CLK>, |
| 2301 | <&lpass_aon LPASS_AON_CC_MAIN_RCG_CLK_SRC>; | 2302 | <&lpass_aon LPASS_AON_CC_MAIN_RCG_CLK_SRC>; |
| 2302 | clock-names = "bi_tcxo", "lpass_aon_cc_main_rcg_clk_src"; | 2303 | clock-names = "bi_tcxo", "lpass_aon_cc_main_rcg_clk_src"; |
| @@ -124,6 +124,9 @@ · 123 unmodified lines | |||
| 124 | regulator-max-microvolt = <2504000>; | 124 | regulator-max-microvolt = <2504000>; |
| 125 | regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; | 125 | regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; |
| 126 | regulator-allow-set-load; | 126 | regulator-allow-set-load; |
| 127 | regulator-allowed-modes = | ||
| 128 | <RPMH_REGULATOR_MODE_LPM | ||
| 129 | RPMH_REGULATOR_MODE_HPM>; | ||
| 127 | }; | 130 | }; |
| 128 | 131 | ||
| 129 | vreg_l13c: ldo13 { | 132 | vreg_l13c: ldo13 { |
| @@ -146,6 +149,9 @@ · 16 unmodified lines | |||
| 146 | regulator-max-microvolt = <1200000>; | 149 | regulator-max-microvolt = <1200000>; |
| 147 | regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; | 150 | regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; |
| 148 | regulator-allow-set-load; | 151 | regulator-allow-set-load; |
| 152 | regulator-allowed-modes = | ||
| 153 | <RPMH_REGULATOR_MODE_LPM | ||
| 154 | RPMH_REGULATOR_MODE_HPM>; | ||
| 149 | }; | 155 | }; |
| 150 | 156 | ||
| 151 | vreg_l4d: ldo4 { | 157 | vreg_l4d: ldo4 { |
| @@ -885,13 +885,13 @@ · 884 unmodified lines | |||
| 885 | 885 | ||
| 886 | ufs_mem_phy: phy@1d87000 { | 886 | ufs_mem_phy: phy@1d87000 { |
| 887 | compatible = "qcom,sc8280xp-qmp-ufs-phy"; | 887 | compatible = "qcom,sc8280xp-qmp-ufs-phy"; |
| 888 | reg = <0 0x01d87000 0 0xe10>; | 888 | reg = <0 0x01d87000 0 0x1c8>; |
| 889 | #address-cells = <2>; | 889 | #address-cells = <2>; |
| 890 | #size-cells = <2>; | 890 | #size-cells = <2>; |
| 891 | ranges; | 891 | ranges; |
| 892 | clock-names = "ref", | 892 | clock-names = "ref", |
| 893 | "ref_aux"; | 893 | "ref_aux"; |
| 894 | clocks = <&rpmhcc RPMH_CXO_CLK>, | 894 | clocks = <&gcc GCC_UFS_REF_CLKREF_CLK>, |
| 895 | <&gcc GCC_UFS_PHY_PHY_AUX_CLK>; | 895 | <&gcc GCC_UFS_PHY_PHY_AUX_CLK>; |
| 896 | 896 | ||
| 897 | resets = <&ufs_mem_hc 0>; | 897 | resets = <&ufs_mem_hc 0>; |
| @@ -953,13 +953,13 @@ · 55 unmodified lines | |||
| 953 | 953 | ||
| 954 | ufs_card_phy: phy@1da7000 { | 954 | ufs_card_phy: phy@1da7000 { |
| 955 | compatible = "qcom,sc8280xp-qmp-ufs-phy"; | 955 | compatible = "qcom,sc8280xp-qmp-ufs-phy"; |
| 956 | reg = <0 0x01da7000 0 0xe10>; | 956 | reg = <0 0x01da7000 0 0x1c8>; |
| 957 | #address-cells = <2>; | 957 | #address-cells = <2>; |
| 958 | #size-cells = <2>; | 958 | #size-cells = <2>; |
| 959 | ranges; | 959 | ranges; |
| 960 | clock-names = "ref", | 960 | clock-names = "ref", |
| 961 | "ref_aux"; | 961 | "ref_aux"; |
| 962 | clocks = <&gcc GCC_UFS_1_CARD_CLKREF_CLK>, | 962 | clocks = <&gcc GCC_UFS_REF_CLKREF_CLK>, |
| 963 | <&gcc GCC_UFS_CARD_PHY_AUX_CLK>; | 963 | <&gcc GCC_UFS_CARD_PHY_AUX_CLK>; |
| 964 | 964 | ||
| 965 | resets = <&ufs_card_hc 0>; | 965 | resets = <&ufs_card_hc 0>; |
| @@ -1181,26 +1181,16 @@ · 215 unmodified lines | |||
| 1181 | usb_0_ssphy: usb3-phy@88eb400 { | 1181 | usb_0_ssphy: usb3-phy@88eb400 { |
| 1182 | reg = <0 0x088eb400 0 0x100>, | 1182 | reg = <0 0x088eb400 0 0x100>, |
| 1183 | <0 0x088eb600 0 0x3ec>, | 1183 | <0 0x088eb600 0 0x3ec>, |
| 1184 | <0 0x088ec400 0 0x1f0>, | 1184 | <0 0x088ec400 0 0x364>, |
| 1185 | <0 0x088eba00 0 0x100>, | 1185 | <0 0x088eba00 0 0x100>, |
| 1186 | <0 0x088ebc00 0 0x3ec>, | 1186 | <0 0x088ebc00 0 0x3ec>, |
| 1187 | <0 0x088ec700 0 0x64>; | 1187 | <0 0x088ec200 0 0x18>; |
| 1188 | #phy-cells = <0>; | 1188 | #phy-cells = <0>; |
| 1189 | #clock-cells = <0>; | 1189 | #clock-cells = <0>; |
| 1190 | clocks = <&gcc GCC_USB3_PRIM_PHY_PIPE_CLK>; | 1190 | clocks = <&gcc GCC_USB3_PRIM_PHY_PIPE_CLK>; |
| 1191 | clock-names = "pipe0"; | 1191 | clock-names = "pipe0"; |
| 1192 | clock-output-names = "usb0_phy_pipe_clk_src"; | 1192 | clock-output-names = "usb0_phy_pipe_clk_src"; |
| 1193 | }; | 1193 | }; |
| 1194 | |||
| 1195 | usb_0_dpphy: dp-phy@88ed200 { | ||
| 1196 | reg = <0 0x088ed200 0 0x200>, | ||
| 1197 | <0 0x088ed400 0 0x200>, | ||
| 1198 | <0 0x088eda00 0 0x200>, | ||
| 1199 | <0 0x088ea600 0 0x200>, | ||
| 1200 | <0 0x088ea800 0 0x200>; | ||
| 1201 | #clock-cells = <1>; | ||
| 1202 | #phy-cells = <0>; | ||
| 1203 | }; | ||
| 1204 | }; | 1194 | }; |
| 1205 | 1195 | ||
| 1206 | usb_1_hsphy: phy@8902000 { | 1196 | usb_1_hsphy: phy@8902000 { |
| @@ -1242,8 +1232,8 @@ · 35 unmodified lines | |||
| 1242 | 1232 | ||
| 1243 | usb_1_ssphy: usb3-phy@8903400 { | 1233 | usb_1_ssphy: usb3-phy@8903400 { |
| 1244 | reg = <0 0x08903400 0 0x100>, | 1234 | reg = <0 0x08903400 0 0x100>, |
| 1245 | <0 0x08903c00 0 0x3ec>, | 1235 | <0 0x08903600 0 0x3ec>, |
| 1246 | <0 0x08904400 0 0x1f0>, | 1236 | <0 0x08904400 0 0x364>, |
| 1247 | <0 0x08903a00 0 0x100>, | 1237 | <0 0x08903a00 0 0x100>, |
| 1248 | <0 0x08903c00 0 0x3ec>, | 1238 | <0 0x08903c00 0 0x3ec>, |
| 1249 | <0 0x08904200 0 0x18>; | 1239 | <0 0x08904200 0 0x18>; |
| @@ -1253,16 +1243,6 @@ · 3 unmodified lines | |||
| 1253 | clock-names = "pipe0"; | 1243 | clock-names = "pipe0"; |
| 1254 | clock-output-names = "usb1_phy_pipe_clk_src"; | 1244 | clock-output-names = "usb1_phy_pipe_clk_src"; |
| 1255 | }; | 1245 | }; |
| 1256 | |||
| 1257 | usb_1_dpphy: dp-phy@8904200 { | ||
| 1258 | reg = <0 0x08904200 0 0x200>, | ||
| 1259 | <0 0x08904400 0 0x200>, | ||
| 1260 | <0 0x08904a00 0 0x200>, | ||
| 1261 | <0 0x08904600 0 0x200>, | ||
| 1262 | <0 0x08904800 0 0x200>; | ||
| 1263 | #clock-cells = <1>; | ||
| 1264 | #phy-cells = <0>; | ||
| 1265 | }; | ||
| 1266 | }; | 1246 | }; |
| 1267 | 1247 | ||
| 1268 | system-cache-controller@9200000 { | 1248 | system-cache-controller@9200000 { |
| @@ -348,6 +348,9 @@ · 347 unmodified lines | |||
| 348 | regulator-max-microvolt = <2960000>; | 348 | regulator-max-microvolt = <2960000>; |
| 349 | regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; | 349 | regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; |
| 350 | regulator-allow-set-load; | 350 | regulator-allow-set-load; |
| 351 | regulator-allowed-modes = | ||
| 352 | <RPMH_REGULATOR_MODE_LPM | ||
| 353 | RPMH_REGULATOR_MODE_HPM>; | ||
| 351 | }; | 354 | }; |
| 352 | 355 | ||
| 353 | vreg_l7c_3p0: ldo7 { | 356 | vreg_l7c_3p0: ldo7 { |
| @@ -367,6 +370,9 @@ · 13 unmodified lines | |||
| 367 | regulator-max-microvolt = <2960000>; | 370 | regulator-max-microvolt = <2960000>; |
| 368 | regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; | 371 | regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; |
| 369 | regulator-allow-set-load; | 372 | regulator-allow-set-load; |
| 373 | regulator-allowed-modes = | ||
| 374 | <RPMH_REGULATOR_MODE_LPM | ||
| 375 | RPMH_REGULATOR_MODE_HPM>; | ||
| 370 | }; | 376 | }; |
| 371 | 377 | ||
| 372 | vreg_l10c_3p3: ldo10 { | 378 | vreg_l10c_3p3: ldo10 { |
| @@ -317,6 +317,9 @@ · 316 unmodified lines | |||
| 317 | regulator-max-microvolt = <2960000>; | 317 | regulator-max-microvolt = <2960000>; |
| 318 | regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; | 318 | regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; |
| 319 | regulator-allow-set-load; | 319 | regulator-allow-set-load; |
| 320 | regulator-allowed-modes = | ||
| 321 | <RPMH_REGULATOR_MODE_LPM | ||
| 322 | RPMH_REGULATOR_MODE_HPM>; | ||
| 320 | }; | 323 | }; |
| 321 | 324 | ||
| 322 | vreg_l7c_2p85: ldo7 { | 325 | vreg_l7c_2p85: ldo7 { |
| @@ -339,6 +342,9 @@ · 16 unmodified lines | |||
| 339 | regulator-max-microvolt = <2960000>; | 342 | regulator-max-microvolt = <2960000>; |
| 340 | regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; | 343 | regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; |
| 341 | regulator-allow-set-load; | 344 | regulator-allow-set-load; |
| 345 | regulator-allowed-modes = | ||
| 346 | <RPMH_REGULATOR_MODE_LPM | ||
| 347 | RPMH_REGULATOR_MODE_HPM>; | ||
| 342 | }; | 348 | }; |
| 343 | 349 | ||
| 344 | vreg_l10c_3p3: ldo10 { | 350 | vreg_l10c_3p3: ldo10 { |
| @@ -334,6 +334,7 @@ · 333 unmodified lines | |||
| 334 | exit-latency-us = <6562>; | 334 | exit-latency-us = <6562>; |
| 335 | min-residency-us = <9987>; | 335 | min-residency-us = <9987>; |
| 336 | local-timer-stop; | 336 | local-timer-stop; |
| 337 | status = "disabled"; | ||
| 337 | }; | 338 | }; |
| 338 | }; | 339 | }; |
| 339 | }; | 340 | }; |
| @@ -107,6 +107,9 @@ · 106 unmodified lines | |||
| 107 | regulator-max-microvolt = <888000>; | 107 | regulator-max-microvolt = <888000>; |
| 108 | regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; | 108 | regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; |
| 109 | regulator-allow-set-load; | 109 | regulator-allow-set-load; |
| 110 | regulator-allowed-modes = | ||
| 111 | <RPMH_REGULATOR_MODE_LPM | ||
| 112 | RPMH_REGULATOR_MODE_HPM>; | ||
| 110 | }; | 113 | }; |
| 111 | 114 | ||
| 112 | vreg_l6b_1p2: ldo6 { | 115 | vreg_l6b_1p2: ldo6 { |
| @@ -115,6 +118,9 @@ · 2 unmodified lines | |||
| 115 | regulator-max-microvolt = <1208000>; | 118 | regulator-max-microvolt = <1208000>; |
| 116 | regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; | 119 | regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; |
| 117 | regulator-allow-set-load; | 120 | regulator-allow-set-load; |
| 121 | regulator-allowed-modes = | ||
| 122 | <RPMH_REGULATOR_MODE_LPM | ||
| 123 | RPMH_REGULATOR_MODE_HPM>; | ||
| 118 | }; | 124 | }; |
| 119 | 125 | ||
| 120 | vreg_l7b_2p96: ldo7 { | 126 | vreg_l7b_2p96: ldo7 { |
| @@ -123,6 +129,9 @@ · 2 unmodified lines | |||
| 123 | regulator-max-microvolt = <2504000>; | 129 | regulator-max-microvolt = <2504000>; |
| 124 | regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; | 130 | regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; |
| 125 | regulator-allow-set-load; | 131 | regulator-allow-set-load; |
| 132 | regulator-allowed-modes = | ||
| 133 | <RPMH_REGULATOR_MODE_LPM | ||
| 134 | RPMH_REGULATOR_MODE_HPM>; | ||
| 126 | }; | 135 | }; |
| 127 | 136 | ||
| 128 | vreg_l9b_1p2: ldo9 { | 137 | vreg_l9b_1p2: ldo9 { |
| @@ -131,6 +140,9 @@ · 2 unmodified lines | |||
| 131 | regulator-max-microvolt = <1200000>; | 140 | regulator-max-microvolt = <1200000>; |
| 132 | regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; | 141 | regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; |
| 133 | regulator-allow-set-load; | 142 | regulator-allow-set-load; |
| 143 | regulator-allowed-modes = | ||
| 144 | <RPMH_REGULATOR_MODE_LPM | ||
| 145 | RPMH_REGULATOR_MODE_HPM>; | ||
| 134 | }; | 146 | }; |
| 135 | }; | 147 | }; |
| 136 | 148 | ||
| @@ -863,12 +863,12 @@ static inline bool pte_user_accessible_page(pte_t pte) · 862 unmodified lines | |||
| 863 | 863 | ||
| 864 | static inline bool pmd_user_accessible_page(pmd_t pmd) | 864 | static inline bool pmd_user_accessible_page(pmd_t pmd) |
| 865 | { | 865 | { |
| 866 | return pmd_present(pmd) && (pmd_user(pmd) || pmd_user_exec(pmd)); | 866 | return pmd_leaf(pmd) && (pmd_user(pmd) || pmd_user_exec(pmd)); |
| 867 | } | 867 | } |
| 868 | 868 | ||
| 869 | static inline bool pud_user_accessible_page(pud_t pud) | 869 | static inline bool pud_user_accessible_page(pud_t pud) |
| 870 | { | 870 | { |
| 871 | return pud_present(pud) && pud_user(pud); | 871 | return pud_leaf(pud) && pud_user(pud); |
| 872 | } | 872 | } |
| 873 | #endif | 873 | #endif |
| 874 | 874 | ||
| @@ -299,11 +299,11 @@ SYM_TYPED_FUNC_START(ftrace_stub) · 298 unmodified lines | |||
| 299 | ret | 299 | ret |
| 300 | SYM_FUNC_END(ftrace_stub) | 300 | SYM_FUNC_END(ftrace_stub) |
| 301 | 301 | ||
| 302 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
| 302 | SYM_TYPED_FUNC_START(ftrace_stub_graph) | 303 | SYM_TYPED_FUNC_START(ftrace_stub_graph) |
| 303 | ret | 304 | ret |
| 304 | SYM_FUNC_END(ftrace_stub_graph) | 305 | SYM_FUNC_END(ftrace_stub_graph) |
| 305 | 306 | ||
| 306 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
| 307 | /* | 307 | /* |
| 308 | * void return_to_handler(void) | 308 | * void return_to_handler(void) |
| 309 | * | 309 | * |
| @@ -142,7 +142,7 @@ SECTIONS · 141 unmodified lines | |||
| 142 | #endif | 142 | #endif |
| 143 | 143 | ||
| 144 | .data.rel.ro : AT(ADDR(.data.rel.ro) - LOAD_OFFSET) { | 144 | .data.rel.ro : AT(ADDR(.data.rel.ro) - LOAD_OFFSET) { |
| 145 | *(.data.rel.ro*) | 145 | *(.data.rel.ro .data.rel.ro.*) |
| 146 | } | 146 | } |
| 147 | 147 | ||
| 148 | .branch_lt : AT(ADDR(.branch_lt) - LOAD_OFFSET) { | 148 | .branch_lt : AT(ADDR(.branch_lt) - LOAD_OFFSET) { |
| @@ -199,7 +199,16 @@ unsigned long __get_wchan(struct task_struct *p); · 198 unmodified lines | |||
| 199 | /* Has task runtime instrumentation enabled ? */ | 199 | /* Has task runtime instrumentation enabled ? */ |
| 200 | #define is_ri_task(tsk) (!!(tsk)->thread.ri_cb) | 200 | #define is_ri_task(tsk) (!!(tsk)->thread.ri_cb) |
| 201 | 201 | ||
| 202 | register unsigned long current_stack_pointer asm("r15"); | 202 | /* avoid using global register due to gcc bug in versions < 8.4 */ |
| 203 | #define current_stack_pointer (__current_stack_pointer()) | ||
| 204 | |||
| 205 | static __always_inline unsigned long __current_stack_pointer(void) | ||
| 206 | { | ||
| 207 | unsigned long sp; | ||
| 208 | |||
| 209 | asm volatile("lgr %0,15" : "=d" (sp)); | ||
| 210 | return sp; | ||
| 211 | } | ||
| 203 | 212 | ||
| 204 | static __always_inline unsigned short stap(void) | 213 | static __always_inline unsigned short stap(void) |
| 205 | { | 214 | { |
| @@ -861,8 +861,7 @@ static int amd_pmu_handle_irq(struct pt_regs *regs) · 860 unmodified lines | |||
| 861 | pmu_enabled = cpuc->enabled; | 861 | pmu_enabled = cpuc->enabled; |
| 862 | cpuc->enabled = 0; | 862 | cpuc->enabled = 0; |
| 863 | 863 | ||
| 864 | /* stop everything (includes BRS) */ | 864 | amd_brs_disable_all(); |
| 865 | amd_pmu_disable_all(); | ||
| 866 | 865 | ||
| 867 | /* Drain BRS is in use (could be inactive) */ | 866 | /* Drain BRS is in use (could be inactive) */ |
| 868 | if (cpuc->lbr_users) | 867 | if (cpuc->lbr_users) |
| @@ -873,7 +872,7 @@ static int amd_pmu_handle_irq(struct pt_regs *regs) · 4 unmodified lines | |||
| 873 | 872 | ||
| 874 | cpuc->enabled = pmu_enabled; | 873 | cpuc->enabled = pmu_enabled; |
| 875 | if (pmu_enabled) | 874 | if (pmu_enabled) |
| 876 | amd_pmu_enable_all(0); | 875 | amd_brs_enable_all(); |
| 877 | 876 | ||
| 878 | return amd_pmu_adjust_nmi_window(handled); | 877 | return amd_pmu_adjust_nmi_window(handled); |
| 879 | } | 878 | } |
| @@ -553,6 +553,7 @@ static void uncore_clean_online(void) · 552 unmodified lines | |||
| 553 | 553 | ||
| 554 | hlist_for_each_entry_safe(uncore, n, &uncore_unused_list, node) { | 554 | hlist_for_each_entry_safe(uncore, n, &uncore_unused_list, node) { |
| 555 | hlist_del(&uncore->node); | 555 | hlist_del(&uncore->node); |
| 556 | kfree(uncore->events); | ||
| 556 | kfree(uncore); | 557 | kfree(uncore); |
| 557 | } | 558 | } |
| 558 | } | 559 | } |
| @@ -1263,6 +1263,15 @@ static int pt_buffer_try_single(struct pt_buffer *buf, int nr_pages) · 1262 unmodified lines | |||
| 1263 | if (1 << order != nr_pages) | 1263 | if (1 << order != nr_pages) |
| 1264 | goto out; | 1264 | goto out; |
| 1265 | 1265 | ||
| 1266 | /* | ||
| 1267 | * Some processors cannot always support single range for more than | ||
| 1268 | * 4KB - refer errata TGL052, ADL037 and RPL017. Future processors might | ||
| 1269 | * also be affected, so for now rather than trying to keep track of | ||
| 1270 | * which ones, just disable it for all. | ||
| 1271 | */ | ||
| 1272 | if (nr_pages > 1) | ||
| 1273 | goto out; | ||
| 1274 | |||
| 1266 | buf->single = true; | 1275 | buf->single = true; |
| 1267 | buf->nr_pages = nr_pages; | 1276 | buf->nr_pages = nr_pages; |
| 1268 | ret = 0; | 1277 | ret = 0; |
| @@ -535,6 +535,11 @@ · 534 unmodified lines | |||
| 535 | #define MSR_AMD64_CPUID_FN_1 0xc0011004 | 535 | #define MSR_AMD64_CPUID_FN_1 0xc0011004 |
| 536 | #define MSR_AMD64_LS_CFG 0xc0011020 | 536 | #define MSR_AMD64_LS_CFG 0xc0011020 |
| 537 | #define MSR_AMD64_DC_CFG 0xc0011022 | 537 | #define MSR_AMD64_DC_CFG 0xc0011022 |
| 538 | |||
| 539 | #define MSR_AMD64_DE_CFG 0xc0011029 | ||
| 540 | #define MSR_AMD64_DE_CFG_LFENCE_SERIALIZE_BIT 1 | ||
| 541 | #define MSR_AMD64_DE_CFG_LFENCE_SERIALIZE BIT_ULL(MSR_AMD64_DE_CFG_LFENCE_SERIALIZE_BIT) | ||
| 542 | |||
| 538 | #define MSR_AMD64_BU_CFG2 0xc001102a | 543 | #define MSR_AMD64_BU_CFG2 0xc001102a |
| 539 | #define MSR_AMD64_IBSFETCHCTL 0xc0011030 | 544 | #define MSR_AMD64_IBSFETCHCTL 0xc0011030 |
| 540 | #define MSR_AMD64_IBSFETCHLINAD 0xc0011031 | 545 | #define MSR_AMD64_IBSFETCHLINAD 0xc0011031 |
| @@ -640,9 +645,6 @@ · 99 unmodified lines | |||
| 640 | #define FAM10H_MMIO_CONF_BASE_MASK 0xfffffffULL | 645 | #define FAM10H_MMIO_CONF_BASE_MASK 0xfffffffULL |
| 641 | #define FAM10H_MMIO_CONF_BASE_SHIFT 20 | 646 | #define FAM10H_MMIO_CONF_BASE_SHIFT 20 |
| 642 | #define MSR_FAM10H_NODE_ID 0xc001100c | 647 | #define MSR_FAM10H_NODE_ID 0xc001100c |
| 643 | #define MSR_F10H_DECFG 0xc0011029 | ||
| 644 | #define MSR_F10H_DECFG_LFENCE_SERIALIZE_BIT 1 | ||
| 645 | #define MSR_F10H_DECFG_LFENCE_SERIALIZE BIT_ULL(MSR_F10H_DECFG_LFENCE_SERIALIZE_BIT) | ||
| 646 | 648 | ||
| 647 | /* K8 MSRs */ | 649 | /* K8 MSRs */ |
| 648 | #define MSR_K8_TOP_MEM1 0xc001001a | 650 | #define MSR_K8_TOP_MEM1 0xc001001a |
| @@ -37,7 +37,7 @@ __PV_CALLEE_SAVE_REGS_THUNK(__pv_queued_spin_unlock_slowpath, ".spinlock.text"); · 36 unmodified lines | |||
| 37 | * rsi = lockval (second argument) | 37 | * rsi = lockval (second argument) |
| 38 | * rdx = internal variable (set to 0) | 38 | * rdx = internal variable (set to 0) |
| 39 | */ | 39 | */ |
| 40 | asm (".pushsection .spinlock.text;" | 40 | asm (".pushsection .spinlock.text, \"ax\";" |
| 41 | ".globl " PV_UNLOCK ";" | 41 | ".globl " PV_UNLOCK ";" |
| 42 | ".type " PV_UNLOCK ", @function;" | 42 | ".type " PV_UNLOCK ", @function;" |
| 43 | ".align 4,0x90;" | 43 | ".align 4,0x90;" |
| @@ -770,8 +770,6 @@ static void init_amd_gh(struct cpuinfo_x86 *c) · 769 unmodified lines | |||
| 770 | set_cpu_bug(c, X86_BUG_AMD_TLB_MMATCH); | 770 | set_cpu_bug(c, X86_BUG_AMD_TLB_MMATCH); |
| 771 | } | 771 | } |
| 772 | 772 | ||
| 773 | #define MSR_AMD64_DE_CFG 0xC0011029 | ||
| 774 | |||
| 775 | static void init_amd_ln(struct cpuinfo_x86 *c) | 773 | static void init_amd_ln(struct cpuinfo_x86 *c) |
| 776 | { | 774 | { |
| 777 | /* | 775 | /* |
| @@ -965,8 +963,8 @@ static void init_amd(struct cpuinfo_x86 *c) · 187 unmodified lines | |||
| 965 | * msr_set_bit() uses the safe accessors, too, even if the MSR | 963 | * msr_set_bit() uses the safe accessors, too, even if the MSR |
| 966 | * is not present. | 964 | * is not present. |
| 967 | */ | 965 | */ |
| 968 | msr_set_bit(MSR_F10H_DECFG, | 966 | msr_set_bit(MSR_AMD64_DE_CFG, |
| 969 | MSR_F10H_DECFG_LFENCE_SERIALIZE_BIT); | 967 | MSR_AMD64_DE_CFG_LFENCE_SERIALIZE_BIT); |
| 970 | 968 | ||
| 971 | /* A serializing LFENCE stops RDTSC speculation */ | 969 | /* A serializing LFENCE stops RDTSC speculation */ |
| 972 | set_cpu_cap(c, X86_FEATURE_LFENCE_RDTSC); | 970 | set_cpu_cap(c, X86_FEATURE_LFENCE_RDTSC); |
| @@ -326,8 +326,8 @@ static void init_hygon(struct cpuinfo_x86 *c) · 325 unmodified lines | |||
| 326 | * msr_set_bit() uses the safe accessors, too, even if the MSR | 326 | * msr_set_bit() uses the safe accessors, too, even if the MSR |
| 327 | * is not present. | 327 | * is not present. |
| 328 | */ | 328 | */ |
| 329 | msr_set_bit(MSR_F10H_DECFG, | 329 | msr_set_bit(MSR_AMD64_DE_CFG, |
| 330 | MSR_F10H_DECFG_LFENCE_SERIALIZE_BIT); | 330 | MSR_AMD64_DE_CFG_LFENCE_SERIALIZE_BIT); |
| 331 | 331 | ||
| 332 | /* A serializing LFENCE stops RDTSC speculation */ | 332 | /* A serializing LFENCE stops RDTSC speculation */ |
| 333 | set_cpu_cap(c, X86_FEATURE_LFENCE_RDTSC); | 333 | set_cpu_cap(c, X86_FEATURE_LFENCE_RDTSC); |
| @@ -356,6 +356,9 @@ static int sgx_validate_offset_length(struct sgx_encl *encl, · 355 unmodified lines | |||
| 356 | if (!length || !IS_ALIGNED(length, PAGE_SIZE)) | 356 | if (!length || !IS_ALIGNED(length, PAGE_SIZE)) |
| 357 | return -EINVAL; | 357 | return -EINVAL; |
| 358 | 358 | ||
| 359 | if (offset + length < offset) | ||
| 360 | return -EINVAL; | ||
| 361 | |||
| 359 | if (offset + length - PAGE_SIZE >= encl->size) | 362 | if (offset + length - PAGE_SIZE >= encl->size) |
| 360 | return -EINVAL; | 363 | return -EINVAL; |
| 361 | 364 | ||
| @@ -605,9 +605,9 @@ int fpu_clone(struct task_struct *dst, unsigned long clone_flags, bool minimal) · 604 unmodified lines | |||
| 605 | if (test_thread_flag(TIF_NEED_FPU_LOAD)) | 605 | if (test_thread_flag(TIF_NEED_FPU_LOAD)) |
| 606 | fpregs_restore_userregs(); | 606 | fpregs_restore_userregs(); |
| 607 | save_fpregs_to_fpstate(dst_fpu); | 607 | save_fpregs_to_fpstate(dst_fpu); |
| 608 | fpregs_unlock(); | ||
| 608 | if (!(clone_flags & CLONE_THREAD)) | 609 | if (!(clone_flags & CLONE_THREAD)) |
| 609 | fpu_inherit_perms(dst_fpu); | 610 | fpu_inherit_perms(dst_fpu); |
| 610 | fpregs_unlock(); | ||
| 611 | 611 | ||
| 612 | /* | 612 | /* |
| 613 | * Children never inherit PASID state. | 613 | * Children never inherit PASID state. |
| @@ -2709,9 +2709,9 @@ static int svm_get_msr_feature(struct kvm_msr_entry *msr) · 2708 unmodified lines | |||
| 2709 | msr->data = 0; | 2709 | msr->data = 0; |
| 2710 | 2710 | ||
| 2711 | switch (msr->index) { | 2711 | switch (msr->index) { |
| 2712 | case MSR_F10H_DECFG: | 2712 | case MSR_AMD64_DE_CFG: |
| 2713 | if (boot_cpu_has(X86_FEATURE_LFENCE_RDTSC)) | 2713 | if (cpu_feature_enabled(X86_FEATURE_LFENCE_RDTSC)) |
| 2714 | msr->data |= MSR_F10H_DECFG_LFENCE_SERIALIZE; | 2714 | msr->data |= MSR_AMD64_DE_CFG_LFENCE_SERIALIZE; |
| 2715 | break; | 2715 | break; |
| 2716 | case MSR_IA32_PERF_CAPABILITIES: | 2716 | case MSR_IA32_PERF_CAPABILITIES: |
| 2717 | return 0; | 2717 | return 0; |
| @@ -2812,7 +2812,7 @@ static int svm_get_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info) · 94 unmodified lines | |||
| 2812 | msr_info->data = 0x1E; | 2812 | msr_info->data = 0x1E; |
| 2813 | } | 2813 | } |
| 2814 | break; | 2814 | break; |
| 2815 | case MSR_F10H_DECFG: | 2815 | case MSR_AMD64_DE_CFG: |
| 2816 | msr_info->data = svm->msr_decfg; | 2816 | msr_info->data = svm->msr_decfg; |
| 2817 | break; | 2817 | break; |
| 2818 | default: | 2818 | default: |
| @@ -3041,7 +3041,7 @@ static int svm_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr) · 222 unmodified lines | |||
| 3041 | case MSR_VM_IGNNE: | 3041 | case MSR_VM_IGNNE: |
| 3042 | vcpu_unimpl(vcpu, "unimplemented wrmsr: 0x%x data 0x%llx\n", ecx, data); | 3042 | vcpu_unimpl(vcpu, "unimplemented wrmsr: 0x%x data 0x%llx\n", ecx, data); |
| 3043 | break; | 3043 | break; |
| 3044 | case MSR_F10H_DECFG: { | 3044 | case MSR_AMD64_DE_CFG: { |
| 3045 | struct kvm_msr_entry msr_entry; | 3045 | struct kvm_msr_entry msr_entry; |
| 3046 | 3046 | ||
| 3047 | msr_entry.index = msr->index; | 3047 | msr_entry.index = msr->index; |
| @@ -1557,7 +1557,7 @@ static const u32 msr_based_features_all[] = { · 1556 unmodified lines | |||
| 1557 | MSR_IA32_VMX_EPT_VPID_CAP, | 1557 | MSR_IA32_VMX_EPT_VPID_CAP, |
| 1558 | MSR_IA32_VMX_VMFUNC, | 1558 | MSR_IA32_VMX_VMFUNC, |
| 1559 | 1559 | ||
| 1560 | MSR_F10H_DECFG, | 1560 | MSR_AMD64_DE_CFG, |
| 1561 | MSR_IA32_UCODE_REV, | 1561 | MSR_IA32_UCODE_REV, |
| 1562 | MSR_IA32_ARCH_CAPABILITIES, | 1562 | MSR_IA32_ARCH_CAPABILITIES, |
| 1563 | MSR_IA32_PERF_CAPABILITIES, | 1563 | MSR_IA32_PERF_CAPABILITIES, |
| @@ -11,7 +11,6 @@ · 10 unmodified lines | |||
| 11 | #include <linux/bpf.h> | 11 | #include <linux/bpf.h> |
| 12 | #include <linux/memory.h> | 12 | #include <linux/memory.h> |
| 13 | #include <linux/sort.h> | 13 | #include <linux/sort.h> |
| 14 | #include <linux/init.h> | ||
| 15 | #include <asm/extable.h> | 14 | #include <asm/extable.h> |
| 16 | #include <asm/set_memory.h> | 15 | #include <asm/set_memory.h> |
| 17 | #include <asm/nospec-branch.h> | 16 | #include <asm/nospec-branch.h> |
| @@ -389,18 +388,6 @@ out: · 371 unmodified lines | |||
| 389 | return ret; | 388 | return ret; |
| 390 | } | 389 | } |
| 391 | 390 | ||
| 392 | int __init bpf_arch_init_dispatcher_early(void *ip) | ||
| 393 | { | ||
| 394 | const u8 *nop_insn = x86_nops[5]; | ||
| 395 | |||
| 396 | if (is_endbr(*(u32 *)ip)) | ||
| 397 | ip += ENDBR_INSN_SIZE; | ||
| 398 | |||
| 399 | if (memcmp(ip, nop_insn, X86_PATCH_SIZE)) | ||
| 400 | text_poke_early(ip, nop_insn, X86_PATCH_SIZE); | ||
| 401 | return 0; | ||
| 402 | } | ||
| 403 | |||
| 404 | int bpf_arch_text_poke(void *ip, enum bpf_text_poke_type t, | 391 | int bpf_arch_text_poke(void *ip, enum bpf_text_poke_type t, |
| 405 | void *old_addr, void *new_addr) | 392 | void *old_addr, void *new_addr) |
| 406 | { | 393 | { |
| @@ -519,6 +519,7 @@ static void pm_save_spec_msr(void) · 518 unmodified lines | |||
| 519 | MSR_TSX_FORCE_ABORT, | 519 | MSR_TSX_FORCE_ABORT, |
| 520 | MSR_IA32_MCU_OPT_CTRL, | 520 | MSR_IA32_MCU_OPT_CTRL, |
| 521 | MSR_AMD64_LS_CFG, | 521 | MSR_AMD64_LS_CFG, |
| 522 | MSR_AMD64_DE_CFG, | ||
| 522 | }; | 523 | }; |
| 523 | 524 | ||
| 524 | msr_build_context(spec_msr_id, ARRAY_SIZE(spec_msr_id)); | 525 | msr_build_context(spec_msr_id, ARRAY_SIZE(spec_msr_id)); |
| @@ -23,6 +23,7 @@ · 22 unmodified lines | |||
| 23 | #include <linux/start_kernel.h> | 23 | #include <linux/start_kernel.h> |
| 24 | #include <linux/sched.h> | 24 | #include <linux/sched.h> |
| 25 | #include <linux/kprobes.h> | 25 | #include <linux/kprobes.h> |
| 26 | #include <linux/kstrtox.h> | ||
| 26 | #include <linux/memblock.h> | 27 | #include <linux/memblock.h> |
| 27 | #include <linux/export.h> | 28 | #include <linux/export.h> |
| 28 | #include <linux/mm.h> | 29 | #include <linux/mm.h> |
| @@ -113,7 +114,7 @@ static __read_mostly bool xen_msr_safe = IS_ENABLED(CONFIG_XEN_PV_MSR_SAFE); · 84 unmodified lines | |||
| 113 | static int __init parse_xen_msr_safe(char *str) | 114 | static int __init parse_xen_msr_safe(char *str) |
| 114 | { | 115 | { |
| 115 | if (str) | 116 | if (str) |
| 116 | return strtobool(str, &xen_msr_safe); | 117 | return kstrtobool(str, &xen_msr_safe); |
| 117 | return -EINVAL; | 118 | return -EINVAL; |
| 118 | } | 119 | } |
| 119 | early_param("xen_msr_safe", parse_xen_msr_safe); | 120 | early_param("xen_msr_safe", parse_xen_msr_safe); |
| @@ -7,6 +7,7 @@ · 6 unmodified lines | |||
| 7 | 7 | ||
| 8 | #include <linux/init.h> | 8 | #include <linux/init.h> |
| 9 | #include <linux/sched.h> | 9 | #include <linux/sched.h> |
| 10 | #include <linux/kstrtox.h> | ||
| 10 | #include <linux/mm.h> | 11 | #include <linux/mm.h> |
| 11 | #include <linux/pm.h> | 12 | #include <linux/pm.h> |
| 12 | #include <linux/memblock.h> | 13 | #include <linux/memblock.h> |
| @@ -85,7 +86,7 @@ static void __init xen_parse_512gb(void) · 72 unmodified lines | |||
| 85 | arg = strstr(xen_start_info->cmd_line, "xen_512gb_limit="); | 86 | arg = strstr(xen_start_info->cmd_line, "xen_512gb_limit="); |
| 86 | if (!arg) | 87 | if (!arg) |
| 87 | val = true; | 88 | val = true; |
| 88 | else if (strtobool(arg + strlen("xen_512gb_limit="), &val)) | 89 | else if (kstrtobool(arg + strlen("xen_512gb_limit="), &val)) |
| 89 | return; | 90 | return; |
| 90 | 91 | ||
| 91 | xen_512gb_limit = val; | 92 | xen_512gb_limit = val; |
| @@ -1213,7 +1213,7 @@ static int blkcg_css_online(struct cgroup_subsys_state *css) · 1212 unmodified lines | |||
| 1213 | * parent so that offline always happens towards the root. | 1213 | * parent so that offline always happens towards the root. |
| 1214 | */ | 1214 | */ |
| 1215 | if (parent) | 1215 | if (parent) |
| 1216 | blkcg_pin_online(css); | 1216 | blkcg_pin_online(&parent->css); |
| 1217 | return 0; | 1217 | return 0; |
| 1218 | } | 1218 | } |
| 1219 | 1219 | ||
| @@ -425,7 +425,6 @@ struct request_queue *blk_alloc_queue(int node_id, bool alloc_srcu) · 424 unmodified lines | |||
| 425 | PERCPU_REF_INIT_ATOMIC, GFP_KERNEL)) | 425 | PERCPU_REF_INIT_ATOMIC, GFP_KERNEL)) |
| 426 | goto fail_stats; | 426 | goto fail_stats; |
| 427 | 427 | ||
| 428 | blk_queue_dma_alignment(q, 511); | ||
| 429 | blk_set_default_limits(&q->limits); | 428 | blk_set_default_limits(&q->limits); |
| 430 | q->nr_requests = BLKDEV_DEFAULT_RQ; | 429 | q->nr_requests = BLKDEV_DEFAULT_RQ; |
| 431 | 430 | ||
| @@ -57,8 +57,8 @@ void blk_set_default_limits(struct queue_limits *lim) · 56 unmodified lines | |||
| 57 | lim->misaligned = 0; | 57 | lim->misaligned = 0; |
| 58 | lim->zoned = BLK_ZONED_NONE; | 58 | lim->zoned = BLK_ZONED_NONE; |
| 59 | lim->zone_write_granularity = 0; | 59 | lim->zone_write_granularity = 0; |
| 60 | lim->dma_alignment = 511; | ||
| 60 | } | 61 | } |
| 61 | EXPORT_SYMBOL(blk_set_default_limits); | ||
| 62 | 62 | ||
| 63 | /** | 63 | /** |
| 64 | * blk_set_stacking_limits - set default limits for stacking devices | 64 | * blk_set_stacking_limits - set default limits for stacking devices |
| @@ -600,6 +600,7 @@ int blk_stack_limits(struct queue_limits *t, struct queue_limits *b, · 535 unmodified lines | |||
| 600 | 600 | ||
| 601 | t->io_min = max(t->io_min, b->io_min); | 601 | t->io_min = max(t->io_min, b->io_min); |
| 602 | t->io_opt = lcm_not_zero(t->io_opt, b->io_opt); | 602 | t->io_opt = lcm_not_zero(t->io_opt, b->io_opt); |
| 603 | t->dma_alignment = max(t->dma_alignment, b->dma_alignment); | ||
| 603 | 604 | ||
| 604 | /* Set non-power-of-2 compatible chunk_sectors boundary */ | 605 | /* Set non-power-of-2 compatible chunk_sectors boundary */ |
| 605 | if (b->chunk_sectors) | 606 | if (b->chunk_sectors) |
| @@ -773,7 +774,7 @@ EXPORT_SYMBOL(blk_queue_virt_boundary); · 167 unmodified lines | |||
| 773 | **/ | 774 | **/ |
| 774 | void blk_queue_dma_alignment(struct request_queue *q, int mask) | 775 | void blk_queue_dma_alignment(struct request_queue *q, int mask) |
| 775 | { | 776 | { |
| 776 | q->dma_alignment = mask; | 777 | q->limits.dma_alignment = mask; |
| 777 | } | 778 | } |
| 778 | EXPORT_SYMBOL(blk_queue_dma_alignment); | 779 | EXPORT_SYMBOL(blk_queue_dma_alignment); |
| 779 | 780 | ||
| @@ -795,8 +796,8 @@ void blk_queue_update_dma_alignment(struct request_queue *q, int mask) · 15 unmodified lines | |||
| 795 | { | 796 | { |
| 796 | BUG_ON(mask > PAGE_SIZE); | 797 | BUG_ON(mask > PAGE_SIZE); |
| 797 | 798 | ||
| 798 | if (mask > q->dma_alignment) | 799 | if (mask > q->limits.dma_alignment) |
| 799 | q->dma_alignment = mask; | 800 | q->limits.dma_alignment = mask; |
| 800 | } | 801 | } |
| 801 | EXPORT_SYMBOL(blk_queue_update_dma_alignment); | 802 | EXPORT_SYMBOL(blk_queue_update_dma_alignment); |
| 802 | 803 | ||
| @@ -331,6 +331,7 @@ void blk_rq_set_mixed_merge(struct request *rq); · 330 unmodified lines | |||
| 331 | bool blk_rq_merge_ok(struct request *rq, struct bio *bio); | 331 | bool blk_rq_merge_ok(struct request *rq, struct bio *bio); |
| 332 | enum elv_merge blk_try_merge(struct request *rq, struct bio *bio); | 332 | enum elv_merge blk_try_merge(struct request *rq, struct bio *bio); |
| 333 | 333 | ||
| 334 | void blk_set_default_limits(struct queue_limits *lim); | ||
| 334 | int blk_dev_init(void); | 335 | int blk_dev_init(void); |
| 335 | 336 | ||
| 336 | /* | 337 | /* |
| @@ -1778,7 +1778,7 @@ static void speakup_con_update(struct vc_data *vc) · 1777 unmodified lines | |||
| 1778 | { | 1778 | { |
| 1779 | unsigned long flags; | 1779 | unsigned long flags; |
| 1780 | 1780 | ||
| 1781 | if (!speakup_console[vc->vc_num] || spk_parked) | 1781 | if (!speakup_console[vc->vc_num] || spk_parked || !synth) |
| 1782 | return; | 1782 | return; |
| 1783 | if (!spin_trylock_irqsave(&speakup_info.spinlock, flags)) | 1783 | if (!spin_trylock_irqsave(&speakup_info.spinlock, flags)) |
| 1784 | /* Speakup output, discard */ | 1784 | /* Speakup output, discard */ |
| @@ -54,7 +54,7 @@ static inline int oops(const char *msg, const char *info) · 53 unmodified lines | |||
| 54 | 54 | ||
| 55 | static inline struct st_key *hash_name(char *name) | 55 | static inline struct st_key *hash_name(char *name) |
| 56 | { | 56 | { |
| 57 | u_char *pn = (u_char *)name; | 57 | unsigned char *pn = (unsigned char *)name; |
| 58 | int hash = 0; | 58 | int hash = 0; |
| 59 | 59 | ||
| 60 | while (*pn) { | 60 | while (*pn) { |
| @@ -739,6 +739,12 @@ int binder_alloc_mmap_handler(struct binder_alloc *alloc, · 738 unmodified lines | |||
| 739 | const char *failure_string; | 739 | const char *failure_string; |
| 740 | struct binder_buffer *buffer; | 740 | struct binder_buffer *buffer; |
| 741 | 741 | ||
| 742 | if (unlikely(vma->vm_mm != alloc->mm)) { | ||
| 743 | ret = -EINVAL; | ||
| 744 | failure_string = "invalid vma->vm_mm"; | ||
| 745 | goto err_invalid_mm; | ||
| 746 | } | ||
| 747 | |||
| 742 | mutex_lock(&binder_alloc_mmap_lock); | 748 | mutex_lock(&binder_alloc_mmap_lock); |
| 743 | if (alloc->buffer_size) { | 749 | if (alloc->buffer_size) { |
| 744 | ret = -EBUSY; | 750 | ret = -EBUSY; |
| @@ -785,6 +791,7 @@ err_alloc_pages_failed: · 40 unmodified lines | |||
| 785 | alloc->buffer_size = 0; | 791 | alloc->buffer_size = 0; |
| 786 | err_already_mapped: | 792 | err_already_mapped: |
| 787 | mutex_unlock(&binder_alloc_mmap_lock); | 793 | mutex_unlock(&binder_alloc_mmap_lock); |
| 794 | err_invalid_mm: | ||
| 788 | binder_alloc_debug(BINDER_DEBUG_USER_ERROR, | 795 | binder_alloc_debug(BINDER_DEBUG_USER_ERROR, |
| 789 | "%s: %d %lx-%lx %s failed %d\n", __func__, | 796 | "%s: %d %lx-%lx %s failed %d\n", __func__, |
| 790 | alloc->pid, vma->vm_start, vma->vm_end, | 797 | alloc->pid, vma->vm_start, vma->vm_end, |
| @@ -2672,7 +2672,7 @@ static int init_submitter(struct drbd_device *device) · 2671 unmodified lines | |||
| 2672 | enum drbd_ret_code drbd_create_device(struct drbd_config_context *adm_ctx, unsigned int minor) | 2672 | enum drbd_ret_code drbd_create_device(struct drbd_config_context *adm_ctx, unsigned int minor) |
| 2673 | { | 2673 | { |
| 2674 | struct drbd_resource *resource = adm_ctx->resource; | 2674 | struct drbd_resource *resource = adm_ctx->resource; |
| 2675 | struct drbd_connection *connection; | 2675 | struct drbd_connection *connection, *n; |
| 2676 | struct drbd_device *device; | 2676 | struct drbd_device *device; |
| 2677 | struct drbd_peer_device *peer_device, *tmp_peer_device; | 2677 | struct drbd_peer_device *peer_device, *tmp_peer_device; |
| 2678 | struct gendisk *disk; | 2678 | struct gendisk *disk; |
| @@ -2789,7 +2789,7 @@ enum drbd_ret_code drbd_create_device(struct drbd_config_context *adm_ctx, unsig · 110 unmodified lines | |||
| 2789 | return NO_ERROR; | 2789 | return NO_ERROR; |
| 2790 | 2790 | ||
| 2791 | out_idr_remove_from_resource: | 2791 | out_idr_remove_from_resource: |
| 2792 | for_each_connection(connection, resource) { | 2792 | for_each_connection_safe(connection, n, resource) { |
| 2793 | peer_device = idr_remove(&connection->peer_devices, vnr); | 2793 | peer_device = idr_remove(&connection->peer_devices, vnr); |
| 2794 | if (peer_device) | 2794 | if (peer_device) |
| 2795 | kref_put(&connection->kref, drbd_destroy_connection); | 2795 | kref_put(&connection->kref, drbd_destroy_connection); |
| @@ -327,7 +327,13 @@ static irqreturn_t tusb320_irq_handler(int irq, void *dev_id) · 326 unmodified lines | |||
| 327 | return IRQ_NONE; | 327 | return IRQ_NONE; |
| 328 | 328 | ||
| 329 | tusb320_extcon_irq_handler(priv, reg); | 329 | tusb320_extcon_irq_handler(priv, reg); |
| 330 | tusb320_typec_irq_handler(priv, reg); | 330 | |
| 331 | /* | ||
| 332 | * Type-C support is optional. Only call the Type-C handler if a | ||
| 333 | * port had been registered previously. | ||
| 334 | */ | ||
| 335 | if (priv->port) | ||
| 336 | tusb320_typec_irq_handler(priv, reg); | ||
| 331 | 337 | ||
| 332 | regmap_write(priv->regmap, TUSB320_REG9, reg); | 338 | regmap_write(priv->regmap, TUSB320_REG9, reg); |
| 333 | 339 | ||
| @@ -149,12 +149,8 @@ static int coreboot_table_probe(struct platform_device *pdev) · 148 unmodified lines | |||
| 149 | if (!ptr) | 149 | if (!ptr) |
| 150 | return -ENOMEM; | 150 | return -ENOMEM; |
| 151 | 151 | ||
| 152 | ret = bus_register(&coreboot_bus_type); | 152 | ret = coreboot_table_populate(dev, ptr); |
| 153 | if (!ret) { | 153 | |
| 154 | ret = coreboot_table_populate(dev, ptr); | ||
| 155 | if (ret) | ||
| 156 | bus_unregister(&coreboot_bus_type); | ||
| 157 | } | ||
| 158 | memunmap(ptr); | 154 | memunmap(ptr); |
| 159 | 155 | ||
| 160 | return ret; | 156 | return ret; |
| @@ -169,7 +165,6 @@ static int __cb_dev_unregister(struct device *dev, void *dummy) · 8 unmodified lines | |||
| 169 | static int coreboot_table_remove(struct platform_device *pdev) | 165 | static int coreboot_table_remove(struct platform_device *pdev) |
| 170 | { | 166 | { |
| 171 | bus_for_each_dev(&coreboot_bus_type, NULL, NULL, __cb_dev_unregister); | 167 | bus_for_each_dev(&coreboot_bus_type, NULL, NULL, __cb_dev_unregister); |
| 172 | bus_unregister(&coreboot_bus_type); | ||
| 173 | return 0; | 168 | return 0; |
| 174 | } | 169 | } |
| 175 | 170 | ||
| @@ -199,6 +194,32 @@ static struct platform_driver coreboot_table_driver = { · 23 unmodified lines | |||
| 199 | .of_match_table = of_match_ptr(coreboot_of_match), | 194 | .of_match_table = of_match_ptr(coreboot_of_match), |
| 200 | }, | 195 | }, |
| 201 | }; | 196 | }; |
| 202 | module_platform_driver(coreboot_table_driver); | 197 | |
| 198 | static int __init coreboot_table_driver_init(void) | ||
| 199 | { | ||
| 200 | int ret; | ||
| 201 | |||
| 202 | ret = bus_register(&coreboot_bus_type); | ||
| 203 | if (ret) | ||
| 204 | return ret; | ||
| 205 | |||
| 206 | ret = platform_driver_register(&coreboot_table_driver); | ||
| 207 | if (ret) { | ||
| 208 | bus_unregister(&coreboot_bus_type); | ||
| 209 | return ret; | ||
| 210 | } | ||
| 211 | |||
| 212 | return 0; | ||
| 213 | } | ||
| 214 | |||
| 215 | static void __exit coreboot_table_driver_exit(void) | ||
| 216 | { | ||
| 217 | platform_driver_unregister(&coreboot_table_driver); | ||
| 218 | bus_unregister(&coreboot_bus_type); | ||
| 219 | } | ||
| 220 | |||
| 221 | module_init(coreboot_table_driver_init); | ||
| 222 | module_exit(coreboot_table_driver_exit); | ||
| 223 | |||
| 203 | MODULE_AUTHOR("Google, Inc."); | 224 | MODULE_AUTHOR("Google, Inc."); |
| 204 | MODULE_LICENSE("GPL"); | 225 | MODULE_LICENSE("GPL"); |
| @@ -1293,6 +1293,7 @@ void amdgpu_device_pcie_port_wreg(struct amdgpu_device *adev, · 1292 unmodified lines | |||
| 1293 | u32 reg, u32 v); | 1293 | u32 reg, u32 v); |
| 1294 | struct dma_fence *amdgpu_device_switch_gang(struct amdgpu_device *adev, | 1294 | struct dma_fence *amdgpu_device_switch_gang(struct amdgpu_device *adev, |
| 1295 | struct dma_fence *gang); | 1295 | struct dma_fence *gang); |
| 1296 | bool amdgpu_device_has_display_hardware(struct amdgpu_device *adev); | ||
| 1296 | 1297 | ||
| 1297 | /* atpx handler */ | 1298 | /* atpx handler */ |
| 1298 | #if defined(CONFIG_VGA_SWITCHEROO) | 1299 | #if defined(CONFIG_VGA_SWITCHEROO) |
| @@ -171,9 +171,7 @@ int amdgpu_amdkfd_reserve_mem_limit(struct amdgpu_device *adev, · 170 unmodified lines | |||
| 171 | (kfd_mem_limit.ttm_mem_used + ttm_mem_needed > | 171 | (kfd_mem_limit.ttm_mem_used + ttm_mem_needed > |
| 172 | kfd_mem_limit.max_ttm_mem_limit) || | 172 | kfd_mem_limit.max_ttm_mem_limit) || |
| 173 | (adev && adev->kfd.vram_used + vram_needed > | 173 | (adev && adev->kfd.vram_used + vram_needed > |
| 174 | adev->gmc.real_vram_size - | 174 | adev->gmc.real_vram_size - reserved_for_pt)) { |
| 175 | atomic64_read(&adev->vram_pin_size) - | ||
| 176 | reserved_for_pt)) { | ||
| 177 | ret = -ENOMEM; | 175 | ret = -ENOMEM; |
| 178 | goto release; | 176 | goto release; |
| 179 | } | 177 | } |
| @@ -109,6 +109,7 @@ static int amdgpu_cs_p1_ib(struct amdgpu_cs_parser *p, · 108 unmodified lines | |||
| 109 | return r; | 109 | return r; |
| 110 | 110 | ||
| 111 | ++(num_ibs[r]); | 111 | ++(num_ibs[r]); |
| 112 | p->gang_leader_idx = r; | ||
| 112 | return 0; | 113 | return 0; |
| 113 | } | 114 | } |
| 114 | 115 | ||
| @@ -287,8 +288,10 @@ static int amdgpu_cs_pass1(struct amdgpu_cs_parser *p, · 172 unmodified lines | |||
| 287 | } | 288 | } |
| 288 | } | 289 | } |
| 289 | 290 | ||
| 290 | if (!p->gang_size) | 291 | if (!p->gang_size) { |
| 291 | return -EINVAL; | 292 | ret = -EINVAL; |
| 293 | goto free_partial_kdata; | ||
| 294 | } | ||
| 292 | 295 | ||
| 293 | for (i = 0; i < p->gang_size; ++i) { | 296 | for (i = 0; i < p->gang_size; ++i) { |
| 294 | ret = amdgpu_job_alloc(p->adev, num_ibs[i], &p->jobs[i], vm); | 297 | ret = amdgpu_job_alloc(p->adev, num_ibs[i], &p->jobs[i], vm); |
| @@ -300,7 +303,7 @@ static int amdgpu_cs_pass1(struct amdgpu_cs_parser *p, · 5 unmodified lines | |||
| 300 | if (ret) | 303 | if (ret) |
| 301 | goto free_all_kdata; | 304 | goto free_all_kdata; |
| 302 | } | 305 | } |
| 303 | p->gang_leader = p->jobs[p->gang_size - 1]; | 306 | p->gang_leader = p->jobs[p->gang_leader_idx]; |
| 304 | 307 | ||
| 305 | if (p->ctx->vram_lost_counter != p->gang_leader->vram_lost_counter) { | 308 | if (p->ctx->vram_lost_counter != p->gang_leader->vram_lost_counter) { |
| 306 | ret = -ECANCELED; | 309 | ret = -ECANCELED; |
| @@ -1195,16 +1198,18 @@ static int amdgpu_cs_sync_rings(struct amdgpu_cs_parser *p) · 888 unmodified lines | |||
| 1195 | return r; | 1198 | return r; |
| 1196 | } | 1199 | } |
| 1197 | 1200 | ||
| 1198 | for (i = 0; i < p->gang_size - 1; ++i) { | 1201 | for (i = 0; i < p->gang_size; ++i) { |
| 1202 | if (p->jobs[i] == leader) | ||
| 1203 | continue; | ||
| 1204 | |||
| 1199 | r = amdgpu_sync_clone(&leader->sync, &p->jobs[i]->sync); | 1205 | r = amdgpu_sync_clone(&leader->sync, &p->jobs[i]->sync); |
| 1200 | if (r) | 1206 | if (r) |
| 1201 | return r; | 1207 | return r; |
| 1202 | } | 1208 | } |
| 1203 | 1209 | ||
| 1204 | r = amdgpu_ctx_wait_prev_fence(p->ctx, p->entities[p->gang_size - 1]); | 1210 | r = amdgpu_ctx_wait_prev_fence(p->ctx, p->entities[p->gang_leader_idx]); |
| 1205 | if (r && r != -ERESTARTSYS) | 1211 | if (r && r != -ERESTARTSYS) |
| 1206 | DRM_ERROR("amdgpu_ctx_wait_prev_fence failed.\n"); | 1212 | DRM_ERROR("amdgpu_ctx_wait_prev_fence failed.\n"); |
| 1207 | |||
| 1208 | return r; | 1213 | return r; |
| 1209 | } | 1214 | } |
| 1210 | 1215 | ||
| @@ -1238,9 +1243,12 @@ static int amdgpu_cs_submit(struct amdgpu_cs_parser *p, · 27 unmodified lines | |||
| 1238 | for (i = 0; i < p->gang_size; ++i) | 1243 | for (i = 0; i < p->gang_size; ++i) |
| 1239 | drm_sched_job_arm(&p->jobs[i]->base); | 1244 | drm_sched_job_arm(&p->jobs[i]->base); |
| 1240 | 1245 | ||
| 1241 | for (i = 0; i < (p->gang_size - 1); ++i) { | 1246 | for (i = 0; i < p->gang_size; ++i) { |
| 1242 | struct dma_fence *fence; | 1247 | struct dma_fence *fence; |
| 1243 | 1248 | ||
| 1249 | if (p->jobs[i] == leader) | ||
| 1250 | continue; | ||
| 1251 | |||
| 1244 | fence = &p->jobs[i]->base.s_fence->scheduled; | 1252 | fence = &p->jobs[i]->base.s_fence->scheduled; |
| 1245 | r = amdgpu_sync_fence(&leader->sync, fence); | 1253 | r = amdgpu_sync_fence(&leader->sync, fence); |
| 1246 | if (r) | 1254 | if (r) |
| @@ -1276,7 +1284,10 @@ static int amdgpu_cs_submit(struct amdgpu_cs_parser *p, · 29 unmodified lines | |||
| 1276 | list_for_each_entry(e, &p->validated, tv.head) { | 1284 | list_for_each_entry(e, &p->validated, tv.head) { |
| 1277 | 1285 | ||
| 1278 | /* Everybody except for the gang leader uses READ */ | 1286 | /* Everybody except for the gang leader uses READ */ |
| 1279 | for (i = 0; i < (p->gang_size - 1); ++i) { | 1287 | for (i = 0; i < p->gang_size; ++i) { |
| 1288 | if (p->jobs[i] == leader) | ||
| 1289 | continue; | ||
| 1290 | |||
| 1280 | dma_resv_add_fence(e->tv.bo->base.resv, | 1291 | dma_resv_add_fence(e->tv.bo->base.resv, |
| 1281 | &p->jobs[i]->base.s_fence->finished, | 1292 | &p->jobs[i]->base.s_fence->finished, |
| 1282 | DMA_RESV_USAGE_READ); | 1293 | DMA_RESV_USAGE_READ); |
| @@ -1286,7 +1297,7 @@ static int amdgpu_cs_submit(struct amdgpu_cs_parser *p, · 3 unmodified lines | |||
| 1286 | e->tv.num_shared = 0; | 1297 | e->tv.num_shared = 0; |
| 1287 | } | 1298 | } |
| 1288 | 1299 | ||
| 1289 | seq = amdgpu_ctx_add_fence(p->ctx, p->entities[p->gang_size - 1], | 1300 | seq = amdgpu_ctx_add_fence(p->ctx, p->entities[p->gang_leader_idx], |
| 1290 | p->fence); | 1301 | p->fence); |
| 1291 | amdgpu_cs_post_dependencies(p); | 1302 | amdgpu_cs_post_dependencies(p); |
| 1292 | 1303 | ||
| @@ -54,6 +54,7 @@ struct amdgpu_cs_parser { · 53 unmodified lines | |||
| 54 | 54 | ||
| 55 | /* scheduler job objects */ | 55 | /* scheduler job objects */ |
| 56 | unsigned int gang_size; | 56 | unsigned int gang_size; |
| 57 | unsigned int gang_leader_idx; | ||
| 57 | struct drm_sched_entity *entities[AMDGPU_CS_GANG_SIZE]; | 58 | struct drm_sched_entity *entities[AMDGPU_CS_GANG_SIZE]; |
| 58 | struct amdgpu_job *jobs[AMDGPU_CS_GANG_SIZE]; | 59 | struct amdgpu_job *jobs[AMDGPU_CS_GANG_SIZE]; |
| 59 | struct amdgpu_job *gang_leader; | 60 | struct amdgpu_job *gang_leader; |
| @@ -6044,3 +6044,44 @@ struct dma_fence *amdgpu_device_switch_gang(struct amdgpu_device *adev, · 6043 unmodified lines | |||
| 6044 | dma_fence_put(old); | 6044 | dma_fence_put(old); |
| 6045 | return NULL; | 6045 | return NULL; |
| 6046 | } | 6046 | } |
| 6047 | |||
| 6048 | bool amdgpu_device_has_display_hardware(struct amdgpu_device *adev) | ||
| 6049 | { | ||
| 6050 | switch (adev->asic_type) { | ||
| 6051 | #ifdef CONFIG_DRM_AMDGPU_SI | ||
| 6052 | case CHIP_HAINAN: | ||
| 6053 | #endif | ||
| 6054 | case CHIP_TOPAZ: | ||
| 6055 | /* chips with no display hardware */ | ||
| 6056 | return false; | ||
| 6057 | #ifdef CONFIG_DRM_AMDGPU_SI | ||
| 6058 | case CHIP_TAHITI: | ||
| 6059 | case CHIP_PITCAIRN: | ||
| 6060 | case CHIP_VERDE: | ||
| 6061 | case CHIP_OLAND: | ||
| 6062 | #endif | ||
| 6063 | #ifdef CONFIG_DRM_AMDGPU_CIK | ||
| 6064 | case CHIP_BONAIRE: | ||
| 6065 | case CHIP_HAWAII: | ||
| 6066 | case CHIP_KAVERI: | ||
| 6067 | case CHIP_KABINI: | ||
| 6068 | case CHIP_MULLINS: | ||
| 6069 | #endif | ||
| 6070 | case CHIP_TONGA: | ||
| 6071 | case CHIP_FIJI: | ||
| 6072 | case CHIP_POLARIS10: | ||
| 6073 | case CHIP_POLARIS11: | ||
| 6074 | case CHIP_POLARIS12: | ||
| 6075 | case CHIP_VEGAM: | ||
| 6076 | case CHIP_CARRIZO: | ||
| 6077 | case CHIP_STONEY: | ||
| 6078 | /* chips with display hardware */ | ||
| 6079 | return true; | ||
| 6080 | default: | ||
| 6081 | /* IP discovery */ | ||
| 6082 | if (!adev->ip_versions[DCE_HWIP][0] || | ||
| 6083 | (adev->harvest_ip_mask & AMD_HARVEST_IP_DMU_MASK)) | ||
| 6084 | return false; | ||
| 6085 | return true; | ||
| 6086 | } | ||
| 6087 | } | ||
| @@ -656,7 +656,7 @@ void amdgpu_gmc_get_vbios_allocations(struct amdgpu_device *adev) · 655 unmodified lines | |||
| 656 | } | 656 | } |
| 657 | 657 | ||
| 658 | if (amdgpu_sriov_vf(adev) || | 658 | if (amdgpu_sriov_vf(adev) || |
| 659 | !amdgpu_device_ip_get_ip_block(adev, AMD_IP_BLOCK_TYPE_DCE)) { | 659 | !amdgpu_device_has_display_hardware(adev)) { |
| 660 | size = 0; | 660 | size = 0; |
| 661 | } else { | 661 | } else { |
| 662 | size = amdgpu_gmc_get_vbios_fb_size(adev); | 662 | size = amdgpu_gmc_get_vbios_fb_size(adev); |
| @@ -45,6 +45,7 @@ MODULE_FIRMWARE("amdgpu/psp_13_0_0_ta.bin"); · 44 unmodified lines | |||
| 45 | MODULE_FIRMWARE("amdgpu/psp_13_0_7_sos.bin"); | 45 | MODULE_FIRMWARE("amdgpu/psp_13_0_7_sos.bin"); |
| 46 | MODULE_FIRMWARE("amdgpu/psp_13_0_7_ta.bin"); | 46 | MODULE_FIRMWARE("amdgpu/psp_13_0_7_ta.bin"); |
| 47 | MODULE_FIRMWARE("amdgpu/psp_13_0_10_sos.bin"); | 47 | MODULE_FIRMWARE("amdgpu/psp_13_0_10_sos.bin"); |
| 48 | MODULE_FIRMWARE("amdgpu/psp_13_0_10_ta.bin"); | ||
| 48 | 49 | ||
| 49 | /* For large FW files the time to complete can be very long */ | 50 | /* For large FW files the time to complete can be very long */ |
| 50 | #define USBC_PD_POLLING_LIMIT_S 240 | 51 | #define USBC_PD_POLLING_LIMIT_S 240 |
| @@ -147,6 +147,14 @@ MODULE_FIRMWARE(FIRMWARE_NAVI12_DMCU); · 146 unmodified lines | |||
| 147 | /* Number of bytes in PSP footer for firmware. */ | 147 | /* Number of bytes in PSP footer for firmware. */ |
| 148 | #define PSP_FOOTER_BYTES 0x100 | 148 | #define PSP_FOOTER_BYTES 0x100 |
| 149 | 149 | ||
| 150 | /* | ||
| 151 | * DMUB Async to Sync Mechanism Status | ||
| 152 | */ | ||
| 153 | #define DMUB_ASYNC_TO_SYNC_ACCESS_FAIL 1 | ||
| 154 | #define DMUB_ASYNC_TO_SYNC_ACCESS_TIMEOUT 2 | ||
| 155 | #define DMUB_ASYNC_TO_SYNC_ACCESS_SUCCESS 3 | ||
| 156 | #define DMUB_ASYNC_TO_SYNC_ACCESS_INVALID 4 | ||
| 157 | |||
| 150 | /** | 158 | /** |
| 151 | * DOC: overview | 159 | * DOC: overview |
| 152 | * | 160 | * |
| @@ -1637,12 +1645,6 @@ static int amdgpu_dm_init(struct amdgpu_device *adev) · 1484 unmodified lines | |||
| 1637 | } | 1645 | } |
| 1638 | } | 1646 | } |
| 1639 | 1647 | ||
| 1640 | if (amdgpu_dm_initialize_drm_device(adev)) { | ||
| 1641 | DRM_ERROR( | ||
| 1642 | "amdgpu: failed to initialize sw for display support.\n"); | ||
| 1643 | goto error; | ||
| 1644 | } | ||
| 1645 | |||
| 1646 | /* Enable outbox notification only after IRQ handlers are registered and DMUB is alive. | 1648 | /* Enable outbox notification only after IRQ handlers are registered and DMUB is alive. |
| 1647 | * It is expected that DMUB will resend any pending notifications at this point, for | 1649 | * It is expected that DMUB will resend any pending notifications at this point, for |
| 1648 | * example HPD from DPIA. | 1650 | * example HPD from DPIA. |
| @@ -1650,6 +1652,12 @@ static int amdgpu_dm_init(struct amdgpu_device *adev) · 1 unmodified line | |||
| 1650 | if (dc_is_dmub_outbox_supported(adev->dm.dc)) | 1652 | if (dc_is_dmub_outbox_supported(adev->dm.dc)) |
| 1651 | dc_enable_dmub_outbox(adev->dm.dc); | 1653 | dc_enable_dmub_outbox(adev->dm.dc); |
| 1652 | 1654 | ||
| 1655 | if (amdgpu_dm_initialize_drm_device(adev)) { | ||
| 1656 | DRM_ERROR( | ||
| 1657 | "amdgpu: failed to initialize sw for display support.\n"); | ||
| 1658 | goto error; | ||
| 1659 | } | ||
| 1660 | |||
| 1653 | /* create fake encoders for MST */ | 1661 | /* create fake encoders for MST */ |
| 1654 | dm_dp_create_fake_mst_encoders(adev); | 1662 | dm_dp_create_fake_mst_encoders(adev); |
| 1655 | 1663 | ||
| @@ -10109,6 +10117,8 @@ static int amdgpu_dm_set_dmub_async_sync_status(bool is_cmd_aux, · 8453 unmodified lines | |||
| 10109 | *operation_result = AUX_RET_ERROR_TIMEOUT; | 10117 | *operation_result = AUX_RET_ERROR_TIMEOUT; |
| 10110 | } else if (status_type == DMUB_ASYNC_TO_SYNC_ACCESS_FAIL) { | 10118 | } else if (status_type == DMUB_ASYNC_TO_SYNC_ACCESS_FAIL) { |
| 10111 | *operation_result = AUX_RET_ERROR_ENGINE_ACQUIRE; | 10119 | *operation_result = AUX_RET_ERROR_ENGINE_ACQUIRE; |
| 10120 | } else if (status_type == DMUB_ASYNC_TO_SYNC_ACCESS_INVALID) { | ||
| 10121 | *operation_result = AUX_RET_ERROR_INVALID_REPLY; | ||
| 10112 | } else { | 10122 | } else { |
| 10113 | *operation_result = AUX_RET_ERROR_UNKNOWN; | 10123 | *operation_result = AUX_RET_ERROR_UNKNOWN; |
| 10114 | } | 10124 | } |
| @@ -10156,6 +10166,16 @@ int amdgpu_dm_process_dmub_aux_transfer_sync(bool is_cmd_aux, struct dc_context · 41 unmodified lines | |||
| 10156 | payload->reply[0] = adev->dm.dmub_notify->aux_reply.command; | 10166 | payload->reply[0] = adev->dm.dmub_notify->aux_reply.command; |
| 10157 | if (!payload->write && adev->dm.dmub_notify->aux_reply.length && | 10167 | if (!payload->write && adev->dm.dmub_notify->aux_reply.length && |
| 10158 | payload->reply[0] == AUX_TRANSACTION_REPLY_AUX_ACK) { | 10168 | payload->reply[0] == AUX_TRANSACTION_REPLY_AUX_ACK) { |
| 10169 | |||
| 10170 | if (payload->length != adev->dm.dmub_notify->aux_reply.length) { | ||
| 10171 | DRM_WARN("invalid read from DPIA AUX %x(%d) got length %d!\n", | ||
| 10172 | payload->address, payload->length, | ||
| 10173 | adev->dm.dmub_notify->aux_reply.length); | ||
| 10174 | return amdgpu_dm_set_dmub_async_sync_status(is_cmd_aux, ctx, | ||
| 10175 | DMUB_ASYNC_TO_SYNC_ACCESS_INVALID, | ||
| 10176 | (uint32_t *)operation_result); | ||
| 10177 | } | ||
| 10178 | |||
| 10159 | memcpy(payload->data, adev->dm.dmub_notify->aux_reply.data, | 10179 | memcpy(payload->data, adev->dm.dmub_notify->aux_reply.data, |
| 10160 | adev->dm.dmub_notify->aux_reply.length); | 10180 | adev->dm.dmub_notify->aux_reply.length); |
| 10161 | } | 10181 | } |
| @@ -50,12 +50,6 @@ · 49 unmodified lines | |||
| 50 | 50 | ||
| 51 | #define AMDGPU_DMUB_NOTIFICATION_MAX 5 | 51 | #define AMDGPU_DMUB_NOTIFICATION_MAX 5 |
| 52 | 52 | ||
| 53 | /* | ||
| 54 | * DMUB Async to Sync Mechanism Status | ||
| 55 | */ | ||
| 56 | #define DMUB_ASYNC_TO_SYNC_ACCESS_FAIL 1 | ||
| 57 | #define DMUB_ASYNC_TO_SYNC_ACCESS_TIMEOUT 2 | ||
| 58 | #define DMUB_ASYNC_TO_SYNC_ACCESS_SUCCESS 3 | ||
| 59 | /* | 53 | /* |
| 60 | #include "include/amdgpu_dal_power_if.h" | 54 | #include "include/amdgpu_dal_power_if.h" |
| 61 | #include "amdgpu_dm_irq.h" | 55 | #include "amdgpu_dm_irq.h" |
| @@ -412,7 +412,7 @@ int amdgpu_dm_crtc_init(struct amdgpu_display_manager *dm, · 411 unmodified lines | |||
| 412 | { | 412 | { |
| 413 | struct amdgpu_crtc *acrtc = NULL; | 413 | struct amdgpu_crtc *acrtc = NULL; |
| 414 | struct drm_plane *cursor_plane; | 414 | struct drm_plane *cursor_plane; |
| 415 | 415 | bool is_dcn; | |
| 416 | int res = -ENOMEM; | 416 | int res = -ENOMEM; |
| 417 | 417 | ||
| 418 | cursor_plane = kzalloc(sizeof(*cursor_plane), GFP_KERNEL); | 418 | cursor_plane = kzalloc(sizeof(*cursor_plane), GFP_KERNEL); |
| @@ -450,8 +450,14 @@ int amdgpu_dm_crtc_init(struct amdgpu_display_manager *dm, · 31 unmodified lines | |||
| 450 | acrtc->otg_inst = -1; | 450 | acrtc->otg_inst = -1; |
| 451 | 451 | ||
| 452 | dm->adev->mode_info.crtcs[crtc_index] = acrtc; | 452 | dm->adev->mode_info.crtcs[crtc_index] = acrtc; |
| 453 | drm_crtc_enable_color_mgmt(&acrtc->base, MAX_COLOR_LUT_ENTRIES, | 453 | |
| 454 | /* Don't enable DRM CRTC degamma property for DCE since it doesn't | ||
| 455 | * support programmable degamma anywhere. | ||
| 456 | */ | ||
| 457 | is_dcn = dm->adev->dm.dc->caps.color.dpp.dcn_arch; | ||
| 458 | drm_crtc_enable_color_mgmt(&acrtc->base, is_dcn ? MAX_COLOR_LUT_ENTRIES : 0, | ||
| 454 | true, MAX_COLOR_LUT_ENTRIES); | 459 | true, MAX_COLOR_LUT_ENTRIES); |
| 460 | |||
| 455 | drm_mode_crtc_set_gamma_size(&acrtc->base, MAX_COLOR_LEGACY_LUT_ENTRIES); | 461 | drm_mode_crtc_set_gamma_size(&acrtc->base, MAX_COLOR_LEGACY_LUT_ENTRIES); |
| 456 | 462 | ||
| 457 | return 0; | 463 | return 0; |
| @@ -2393,6 +2393,26 @@ static enum bp_result get_vram_info_v25( · 2392 unmodified lines | |||
| 2393 | return result; | 2393 | return result; |
| 2394 | } | 2394 | } |
| 2395 | 2395 | ||
| 2396 | static enum bp_result get_vram_info_v30( | ||
| 2397 | struct bios_parser *bp, | ||
| 2398 | struct dc_vram_info *info) | ||
| 2399 | { | ||
| 2400 | struct atom_vram_info_header_v3_0 *info_v30; | ||
| 2401 | enum bp_result result = BP_RESULT_OK; | ||
| 2402 | |||
| 2403 | info_v30 = GET_IMAGE(struct atom_vram_info_header_v3_0, | ||
| 2404 | DATA_TABLES(vram_info)); | ||
| 2405 | |||
| 2406 | if (info_v30 == NULL) | ||
| 2407 | return BP_RESULT_BADBIOSTABLE; | ||
| 2408 | |||
| 2409 | info->num_chans = info_v30->channel_num; | ||
| 2410 | info->dram_channel_width_bytes = (1 << info_v30->channel_width) / 8; | ||
| 2411 | |||
| 2412 | return result; | ||
| 2413 | } | ||
| 2414 | |||
| 2415 | |||
| 2396 | /* | 2416 | /* |
| 2397 | * get_integrated_info_v11 | 2417 | * get_integrated_info_v11 |
| 2398 | * | 2418 | * |
| @@ -3060,6 +3080,16 @@ static enum bp_result bios_parser_get_vram_info( · 661 unmodified lines | |||
| 3060 | } | 3080 | } |
| 3061 | break; | 3081 | break; |
| 3062 | 3082 | ||
| 3083 | case 3: | ||
| 3084 | switch (revision.minor) { | ||
| 3085 | case 0: | ||
| 3086 | result = get_vram_info_v30(bp, info); | ||
| 3087 | break; | ||
| 3088 | default: | ||
| 3089 | break; | ||
| 3090 | } | ||
| 3091 | break; | ||
| 3092 | |||
| 3063 | default: | 3093 | default: |
| 3064 | return result; | 3094 | return result; |
| 3065 | } | 3095 | } |
| @@ -87,6 +87,7 @@ static struct hubp_funcs dcn31_hubp_funcs = { · 86 unmodified lines | |||
| 87 | .hubp_init = hubp3_init, | 87 | .hubp_init = hubp3_init, |
| 88 | .set_unbounded_requesting = hubp31_set_unbounded_requesting, | 88 | .set_unbounded_requesting = hubp31_set_unbounded_requesting, |
| 89 | .hubp_soft_reset = hubp31_soft_reset, | 89 | .hubp_soft_reset = hubp31_soft_reset, |
| 90 | .hubp_set_flip_int = hubp1_set_flip_int, | ||
| 90 | .hubp_in_blank = hubp1_in_blank, | 91 | .hubp_in_blank = hubp1_in_blank, |
| 91 | .program_extended_blank = hubp31_program_extended_blank, | 92 | .program_extended_blank = hubp31_program_extended_blank, |
| 92 | }; | 93 | }; |
| @@ -237,7 +237,7 @@ static struct timing_generator_funcs dcn314_tg_funcs = { · 236 unmodified lines | |||
| 237 | .clear_optc_underflow = optc1_clear_optc_underflow, | 237 | .clear_optc_underflow = optc1_clear_optc_underflow, |
| 238 | .setup_global_swap_lock = NULL, | 238 | .setup_global_swap_lock = NULL, |
| 239 | .get_crc = optc1_get_crc, | 239 | .get_crc = optc1_get_crc, |
| 240 | .configure_crc = optc2_configure_crc, | 240 | .configure_crc = optc1_configure_crc, |
| 241 | .set_dsc_config = optc3_set_dsc_config, | 241 | .set_dsc_config = optc3_set_dsc_config, |
| 242 | .get_dsc_status = optc2_get_dsc_status, | 242 | .get_dsc_status = optc2_get_dsc_status, |
| 243 | .set_dwb_source = NULL, | 243 | .set_dwb_source = NULL, |
| @@ -283,8 +283,7 @@ static uint32_t dcn32_calculate_cab_allocation(struct dc *dc, struct dc_state *c · 282 unmodified lines | |||
| 283 | using the max for calculation */ | 283 | using the max for calculation */ |
| 284 | 284 | ||
| 285 | if (hubp->curs_attr.width > 0) { | 285 | if (hubp->curs_attr.width > 0) { |
| 286 | // Round cursor width to next multiple of 64 | 286 | cursor_size = hubp->curs_attr.pitch * hubp->curs_attr.height; |
| 287 | cursor_size = (((hubp->curs_attr.width + 63) / 64) * 64) * hubp->curs_attr.height; | ||
| 288 | 287 | ||
| 289 | switch (pipe->stream->cursor_attributes.color_format) { | 288 | switch (pipe->stream->cursor_attributes.color_format) { |
| 290 | case CURSOR_MODE_MONO: | 289 | case CURSOR_MODE_MONO: |
| @@ -309,9 +308,9 @@ static uint32_t dcn32_calculate_cab_allocation(struct dc *dc, struct dc_state *c · 18 unmodified lines | |||
| 309 | cursor_size > 16384) { | 308 | cursor_size > 16384) { |
| 310 | /* cursor_num_mblk = CEILING(num_cursors*cursor_width*cursor_width*cursor_Bpe/mblk_bytes, 1) | 309 | /* cursor_num_mblk = CEILING(num_cursors*cursor_width*cursor_width*cursor_Bpe/mblk_bytes, 1) |
| 311 | */ | 310 | */ |
| 312 | cache_lines_used += (((hubp->curs_attr.width * hubp->curs_attr.height * cursor_bpp + | 311 | cache_lines_used += (((cursor_size + DCN3_2_MALL_MBLK_SIZE_BYTES - 1) / |
| 313 | DCN3_2_MALL_MBLK_SIZE_BYTES - 1) / DCN3_2_MALL_MBLK_SIZE_BYTES) * | 312 | DCN3_2_MALL_MBLK_SIZE_BYTES) * DCN3_2_MALL_MBLK_SIZE_BYTES) / |
| 314 | DCN3_2_MALL_MBLK_SIZE_BYTES) / dc->caps.cache_line_size + 2; | 313 | dc->caps.cache_line_size + 2; |
| 315 | } | 314 | } |
| 316 | break; | 315 | break; |
| 317 | } | 316 | } |
| @@ -727,10 +726,7 @@ void dcn32_update_mall_sel(struct dc *dc, struct dc_state *context) · 409 unmodified lines | |||
| 727 | struct hubp *hubp = pipe->plane_res.hubp; | 726 | struct hubp *hubp = pipe->plane_res.hubp; |
| 728 | 727 | ||
| 729 | if (pipe->stream && pipe->plane_state && hubp && hubp->funcs->hubp_update_mall_sel) { | 728 | if (pipe->stream && pipe->plane_state && hubp && hubp->funcs->hubp_update_mall_sel) { |
| 730 | //Round cursor width up to next multiple of 64 | 729 | int cursor_size = hubp->curs_attr.pitch * hubp->curs_attr.height; |
| 731 | int cursor_width = ((hubp->curs_attr.width + 63) / 64) * 64; | ||
| 732 | int cursor_height = hubp->curs_attr.height; | ||
| 733 | int cursor_size = cursor_width * cursor_height; | ||
| 734 | 730 | ||
| 735 | switch (hubp->curs_attr.color_format) { | 731 | switch (hubp->curs_attr.color_format) { |
| 736 | case CURSOR_MODE_MONO: | 732 | case CURSOR_MODE_MONO: |
| @@ -1803,6 +1803,12 @@ void dcn32_calculate_wm_and_dlg_fpu(struct dc *dc, struct dc_state *context, · 1802 unmodified lines | |||
| 1803 | */ | 1803 | */ |
| 1804 | context->bw_ctx.dml.soc.dram_clock_change_latency_us = | 1804 | context->bw_ctx.dml.soc.dram_clock_change_latency_us = |
| 1805 | dc->clk_mgr->bw_params->wm_table.nv_entries[WM_A].dml_input.pstate_latency_us; | 1805 | dc->clk_mgr->bw_params->wm_table.nv_entries[WM_A].dml_input.pstate_latency_us; |
| 1806 | /* For DCN32/321 need to validate with fclk pstate change latency equal to dummy so | ||
| 1807 | * prefetch is scheduled correctly to account for dummy pstate. | ||
| 1808 | */ | ||
| 1809 | if (dummy_latency_index == 0) | ||
| 1810 | context->bw_ctx.dml.soc.fclk_change_latency_us = | ||
| 1811 | dc->clk_mgr->bw_params->dummy_pstate_table[dummy_latency_index].dummy_pstate_latency_us; | ||
| 1806 | dcn32_internal_validate_bw(dc, context, pipes, &pipe_cnt, &vlevel, false); | 1812 | dcn32_internal_validate_bw(dc, context, pipes, &pipe_cnt, &vlevel, false); |
| 1807 | maxMpcComb = context->bw_ctx.dml.vba.maxMpcComb; | 1813 | maxMpcComb = context->bw_ctx.dml.vba.maxMpcComb; |
| 1808 | dcfclk_from_fw_based_mclk_switching = context->bw_ctx.dml.vba.DCFCLKState[vlevel][context->bw_ctx.dml.vba.maxMpcComb]; | 1814 | dcfclk_from_fw_based_mclk_switching = context->bw_ctx.dml.vba.DCFCLKState[vlevel][context->bw_ctx.dml.vba.maxMpcComb]; |
| @@ -1990,6 +1996,10 @@ void dcn32_calculate_wm_and_dlg_fpu(struct dc *dc, struct dc_state *context, · 181 unmodified lines | |||
| 1990 | 1996 | ||
| 1991 | context->perf_params.stutter_period_us = context->bw_ctx.dml.vba.StutterPeriod; | 1997 | context->perf_params.stutter_period_us = context->bw_ctx.dml.vba.StutterPeriod; |
| 1992 | 1998 | ||
| 1999 | if (context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching && dummy_latency_index == 0) | ||
| 2000 | context->bw_ctx.dml.soc.fclk_change_latency_us = | ||
| 2001 | dc->clk_mgr->bw_params->dummy_pstate_table[dummy_latency_index].dummy_pstate_latency_us; | ||
| 2002 | |||
| 1993 | dcn32_calculate_dlg_params(dc, context, pipes, pipe_cnt, vlevel); | 2003 | dcn32_calculate_dlg_params(dc, context, pipes, pipe_cnt, vlevel); |
| 1994 | 2004 | ||
| 1995 | if (!pstate_en) | 2005 | if (!pstate_en) |
| @@ -1997,8 +2007,12 @@ void dcn32_calculate_wm_and_dlg_fpu(struct dc *dc, struct dc_state *context, · 1 unmodified line | |||
| 1997 | context->bw_ctx.dml.soc.dram_clock_change_latency_us = | 2007 | context->bw_ctx.dml.soc.dram_clock_change_latency_us = |
| 1998 | dc->clk_mgr->bw_params->wm_table.nv_entries[WM_A].dml_input.pstate_latency_us; | 2008 | dc->clk_mgr->bw_params->wm_table.nv_entries[WM_A].dml_input.pstate_latency_us; |
| 1999 | 2009 | ||
| 2000 | if (context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching) | 2010 | if (context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching) { |
| 2001 | dcn30_setup_mclk_switch_using_fw_based_vblank_stretch(dc, context); | 2011 | dcn30_setup_mclk_switch_using_fw_based_vblank_stretch(dc, context); |
| 2012 | if (dummy_latency_index == 0) | ||
| 2013 | context->bw_ctx.dml.soc.fclk_change_latency_us = | ||
| 2014 | dc->clk_mgr->bw_params->wm_table.nv_entries[WM_A].dml_input.fclk_change_latency_us; | ||
| 2015 | } | ||
| 2002 | } | 2016 | } |
| 2003 | 2017 | ||
| 2004 | static void dcn32_get_optimal_dcfclk_fclk_for_uclk(unsigned int uclk_mts, | 2018 | static void dcn32_get_optimal_dcfclk_fclk_for_uclk(unsigned int uclk_mts, |
| @@ -718,6 +718,8 @@ static void DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerforman · 717 unmodified lines | |||
| 718 | 718 | ||
| 719 | do { | 719 | do { |
| 720 | MaxTotalRDBandwidth = 0; | 720 | MaxTotalRDBandwidth = 0; |
| 721 | DestinationLineTimesForPrefetchLessThan2 = false; | ||
| 722 | VRatioPrefetchMoreThanMax = false; | ||
| 721 | #ifdef __DML_VBA_DEBUG__ | 723 | #ifdef __DML_VBA_DEBUG__ |
| 722 | dml_print("DML::%s: Start loop: VStartup = %d\n", __func__, mode_lib->vba.VStartupLines); | 724 | dml_print("DML::%s: Start loop: VStartup = %d\n", __func__, mode_lib->vba.VStartupLines); |
| 723 | #endif | 725 | #endif |
| @@ -46,6 +46,8 @@ · 45 unmodified lines | |||
| 46 | // Prefetch schedule max vratio | 46 | // Prefetch schedule max vratio |
| 47 | #define __DML_MAX_VRATIO_PRE__ 4.0 | 47 | #define __DML_MAX_VRATIO_PRE__ 4.0 |
| 48 | 48 | ||
| 49 | #define __DML_VBA_MAX_DST_Y_PRE__ 63.75 | ||
| 50 | |||
| 49 | #define BPP_INVALID 0 | 51 | #define BPP_INVALID 0 |
| 50 | #define BPP_BLENDED_PIPE 0xffffffff | 52 | #define BPP_BLENDED_PIPE 0xffffffff |
| 51 | 53 | ||
| @@ -3475,7 +3475,6 @@ bool dml32_CalculatePrefetchSchedule( · 3474 unmodified lines | |||
| 3475 | double min_Lsw; | 3475 | double min_Lsw; |
| 3476 | double Tsw_est1 = 0; | 3476 | double Tsw_est1 = 0; |
| 3477 | double Tsw_est3 = 0; | 3477 | double Tsw_est3 = 0; |
| 3478 | double TPreMargin = 0; | ||
| 3479 | 3478 | ||
| 3480 | if (v->GPUVMEnable == true && v->HostVMEnable == true) | 3479 | if (v->GPUVMEnable == true && v->HostVMEnable == true) |
| 3481 | HostVMDynamicLevelsTrips = v->HostVMMaxNonCachedPageTableLevels; | 3480 | HostVMDynamicLevelsTrips = v->HostVMMaxNonCachedPageTableLevels; |
| @@ -3669,6 +3668,7 @@ bool dml32_CalculatePrefetchSchedule( · 187 unmodified lines | |||
| 3669 | dst_y_prefetch_equ = VStartup - (*TSetup + dml_max(TWait + TCalc, *Tdmdl)) / LineTime - | 3668 | dst_y_prefetch_equ = VStartup - (*TSetup + dml_max(TWait + TCalc, *Tdmdl)) / LineTime - |
| 3670 | (*DSTYAfterScaler + (double) *DSTXAfterScaler / (double) myPipe->HTotal); | 3669 | (*DSTYAfterScaler + (double) *DSTXAfterScaler / (double) myPipe->HTotal); |
| 3671 | 3670 | ||
| 3671 | dst_y_prefetch_equ = dml_min(dst_y_prefetch_equ, __DML_VBA_MAX_DST_Y_PRE__); | ||
| 3672 | #ifdef __DML_VBA_DEBUG__ | 3672 | #ifdef __DML_VBA_DEBUG__ |
| 3673 | dml_print("DML::%s: HTotal = %d\n", __func__, myPipe->HTotal); | 3673 | dml_print("DML::%s: HTotal = %d\n", __func__, myPipe->HTotal); |
| 3674 | dml_print("DML::%s: min_Lsw = %f\n", __func__, min_Lsw); | 3674 | dml_print("DML::%s: min_Lsw = %f\n", __func__, min_Lsw); |
| @@ -3701,8 +3701,6 @@ bool dml32_CalculatePrefetchSchedule( · 26 unmodified lines | |||
| 3701 | 3701 | ||
| 3702 | dst_y_prefetch_equ = dml_floor(4.0 * (dst_y_prefetch_equ + 0.125), 1) / 4.0; | 3702 | dst_y_prefetch_equ = dml_floor(4.0 * (dst_y_prefetch_equ + 0.125), 1) / 4.0; |
| 3703 | Tpre_rounded = dst_y_prefetch_equ * LineTime; | 3703 | Tpre_rounded = dst_y_prefetch_equ * LineTime; |
| 3704 | |||
| 3705 | TPreMargin = Tpre_rounded - TPreReq; | ||
| 3706 | #ifdef __DML_VBA_DEBUG__ | 3704 | #ifdef __DML_VBA_DEBUG__ |
| 3707 | dml_print("DML::%s: dst_y_prefetch_equ: %f (after round)\n", __func__, dst_y_prefetch_equ); | 3705 | dml_print("DML::%s: dst_y_prefetch_equ: %f (after round)\n", __func__, dst_y_prefetch_equ); |
| 3708 | dml_print("DML::%s: LineTime: %f\n", __func__, LineTime); | 3706 | dml_print("DML::%s: LineTime: %f\n", __func__, LineTime); |
| @@ -3730,7 +3728,8 @@ bool dml32_CalculatePrefetchSchedule( · 21 unmodified lines | |||
| 3730 | *VRatioPrefetchY = 0; | 3728 | *VRatioPrefetchY = 0; |
| 3731 | *VRatioPrefetchC = 0; | 3729 | *VRatioPrefetchC = 0; |
| 3732 | *RequiredPrefetchPixDataBWLuma = 0; | 3730 | *RequiredPrefetchPixDataBWLuma = 0; |
| 3733 | if (dst_y_prefetch_equ > 1 && TPreMargin > 0.0) { | 3731 | if (dst_y_prefetch_equ > 1 && |
| 3732 | (Tpre_rounded >= TPreReq || dst_y_prefetch_equ == __DML_VBA_MAX_DST_Y_PRE__)) { | ||
| 3734 | double PrefetchBandwidth1; | 3733 | double PrefetchBandwidth1; |
| 3735 | double PrefetchBandwidth2; | 3734 | double PrefetchBandwidth2; |
| 3736 | double PrefetchBandwidth3; | 3735 | double PrefetchBandwidth3; |
| @@ -1156,22 +1156,21 @@ static int smu_smc_hw_setup(struct smu_context *smu) · 1155 unmodified lines | |||
| 1156 | uint64_t features_supported; | 1156 | uint64_t features_supported; |
| 1157 | int ret = 0; | 1157 | int ret = 0; |
| 1158 | 1158 | ||
| 1159 | if (adev->in_suspend && smu_is_dpm_running(smu)) { | 1159 | switch (adev->ip_versions[MP1_HWIP][0]) { |
| 1160 | dev_info(adev->dev, "dpm has been enabled\n"); | 1160 | case IP_VERSION(11, 0, 7): |
| 1161 | /* this is needed specifically */ | 1161 | case IP_VERSION(11, 0, 11): |
| 1162 | switch (adev->ip_versions[MP1_HWIP][0]) { | 1162 | case IP_VERSION(11, 5, 0): |
| 1163 | case IP_VERSION(11, 0, 7): | 1163 | case IP_VERSION(11, 0, 12): |
| 1164 | case IP_VERSION(11, 0, 11): | 1164 | if (adev->in_suspend && smu_is_dpm_running(smu)) { |
| 1165 | case IP_VERSION(11, 5, 0): | 1165 | dev_info(adev->dev, "dpm has been enabled\n"); |
| 1166 | case IP_VERSION(11, 0, 12): | ||
| 1167 | ret = smu_system_features_control(smu, true); | 1166 | ret = smu_system_features_control(smu, true); |
| 1168 | if (ret) | 1167 | if (ret) |
| 1169 | dev_err(adev->dev, "Failed system features control!\n"); | 1168 | dev_err(adev->dev, "Failed system features control!\n"); |
| 1170 | break; | 1169 | return ret; |
| 1171 | default: | ||
| 1172 | break; | ||
| 1173 | } | 1170 | } |
| 1174 | return ret; | 1171 | break; |
| 1172 | default: | ||
| 1173 | break; | ||
| 1175 | } | 1174 | } |
| 1176 | 1175 | ||
| 1177 | ret = smu_init_display_count(smu, 0); | 1176 | ret = smu_init_display_count(smu, 0); |
| @@ -1388,6 +1388,14 @@ enum smu_cmn2asic_mapping_type { · 1387 unmodified lines | |||
| 1388 | CMN2ASIC_MAPPING_WORKLOAD, | 1388 | CMN2ASIC_MAPPING_WORKLOAD, |
| 1389 | }; | 1389 | }; |
| 1390 | 1390 | ||
| 1391 | enum smu_baco_seq { | ||
| 1392 | BACO_SEQ_BACO = 0, | ||
| 1393 | BACO_SEQ_MSR, | ||
| 1394 | BACO_SEQ_BAMACO, | ||
| 1395 | BACO_SEQ_ULPS, | ||
| 1396 | BACO_SEQ_COUNT, | ||
| 1397 | }; | ||
| 1398 | |||
| 1391 | #define MSG_MAP(msg, index, valid_in_vf) \ | 1399 | #define MSG_MAP(msg, index, valid_in_vf) \ |
| 1392 | [SMU_MSG_##msg] = {1, (index), (valid_in_vf)} | 1400 | [SMU_MSG_##msg] = {1, (index), (valid_in_vf)} |
| 1393 | 1401 | ||
| @@ -147,14 +147,6 @@ struct smu_11_5_power_context { · 146 unmodified lines | |||
| 147 | uint32_t max_fast_ppt_limit; | 147 | uint32_t max_fast_ppt_limit; |
| 148 | }; | 148 | }; |
| 149 | 149 | ||
| 150 | enum smu_v11_0_baco_seq { | ||
| 151 | BACO_SEQ_BACO = 0, | ||
| 152 | BACO_SEQ_MSR, | ||
| 153 | BACO_SEQ_BAMACO, | ||
| 154 | BACO_SEQ_ULPS, | ||
| 155 | BACO_SEQ_COUNT, | ||
| 156 | }; | ||
| 157 | |||
| 158 | #if defined(SWSMU_CODE_LAYER_L2) || defined(SWSMU_CODE_LAYER_L3) | 150 | #if defined(SWSMU_CODE_LAYER_L2) || defined(SWSMU_CODE_LAYER_L3) |
| 159 | 151 | ||
| 160 | int smu_v11_0_init_microcode(struct smu_context *smu); | 152 | int smu_v11_0_init_microcode(struct smu_context *smu); |
| @@ -257,7 +249,7 @@ int smu_v11_0_baco_enter(struct smu_context *smu); · 96 unmodified lines | |||
| 257 | int smu_v11_0_baco_exit(struct smu_context *smu); | 249 | int smu_v11_0_baco_exit(struct smu_context *smu); |
| 258 | 250 | ||
| 259 | int smu_v11_0_baco_set_armd3_sequence(struct smu_context *smu, | 251 | int smu_v11_0_baco_set_armd3_sequence(struct smu_context *smu, |
| 260 | enum smu_v11_0_baco_seq baco_seq); | 252 | enum smu_baco_seq baco_seq); |
| 261 | 253 | ||
| 262 | int smu_v11_0_mode1_reset(struct smu_context *smu); | 254 | int smu_v11_0_mode1_reset(struct smu_context *smu); |
| 263 | 255 | ||
| @@ -124,14 +124,6 @@ struct smu_13_0_power_context { · 123 unmodified lines | |||
| 124 | enum smu_13_0_power_state power_state; | 124 | enum smu_13_0_power_state power_state; |
| 125 | }; | 125 | }; |
| 126 | 126 | ||
| 127 | enum smu_v13_0_baco_seq { | ||
| 128 | BACO_SEQ_BACO = 0, | ||
| 129 | BACO_SEQ_MSR, | ||
| 130 | BACO_SEQ_BAMACO, | ||
| 131 | BACO_SEQ_ULPS, | ||
| 132 | BACO_SEQ_COUNT, | ||
| 133 | }; | ||
| 134 | |||
| 135 | #if defined(SWSMU_CODE_LAYER_L2) || defined(SWSMU_CODE_LAYER_L3) | 127 | #if defined(SWSMU_CODE_LAYER_L2) || defined(SWSMU_CODE_LAYER_L3) |
| 136 | 128 | ||
| 137 | int smu_v13_0_init_microcode(struct smu_context *smu); | 129 | int smu_v13_0_init_microcode(struct smu_context *smu); |
| @@ -218,6 +210,9 @@ int smu_v13_0_set_azalia_d3_pme(struct smu_context *smu); · 80 unmodified lines | |||
| 218 | int smu_v13_0_get_max_sustainable_clocks_by_dc(struct smu_context *smu, | 210 | int smu_v13_0_get_max_sustainable_clocks_by_dc(struct smu_context *smu, |
| 219 | struct pp_smu_nv_clock_table *max_clocks); | 211 | struct pp_smu_nv_clock_table *max_clocks); |
| 220 | 212 | ||
| 213 | int smu_v13_0_baco_set_armd3_sequence(struct smu_context *smu, | ||
| 214 | enum smu_baco_seq baco_seq); | ||
| 215 | |||
| 221 | bool smu_v13_0_baco_is_support(struct smu_context *smu); | 216 | bool smu_v13_0_baco_is_support(struct smu_context *smu); |
| 222 | 217 | ||
| 223 | enum smu_baco_state smu_v13_0_baco_get_state(struct smu_context *smu); | 218 | enum smu_baco_state smu_v13_0_baco_get_state(struct smu_context *smu); |
| @@ -379,6 +379,10 @@ static void sienna_cichlid_check_bxco_support(struct smu_context *smu) · 378 unmodified lines | |||
| 379 | ((adev->pdev->device == 0x73BF) && | 379 | ((adev->pdev->device == 0x73BF) && |
| 380 | (adev->pdev->revision == 0xCF)) || | 380 | (adev->pdev->revision == 0xCF)) || |
| 381 | ((adev->pdev->device == 0x7422) && | 381 | ((adev->pdev->device == 0x7422) && |
| 382 | (adev->pdev->revision == 0x00)) || | ||
| 383 | ((adev->pdev->device == 0x73A3) && | ||
| 384 | (adev->pdev->revision == 0x00)) || | ||
| 385 | ((adev->pdev->device == 0x73E3) && | ||
| 382 | (adev->pdev->revision == 0x00))) | 386 | (adev->pdev->revision == 0x00))) |
| 383 | smu_baco->platform_support = false; | 387 | smu_baco->platform_support = false; |
| 384 | 388 | ||
| @@ -1576,7 +1576,7 @@ int smu_v11_0_set_azalia_d3_pme(struct smu_context *smu) · 1575 unmodified lines | |||
| 1576 | } | 1576 | } |
| 1577 | 1577 | ||
| 1578 | int smu_v11_0_baco_set_armd3_sequence(struct smu_context *smu, | 1578 | int smu_v11_0_baco_set_armd3_sequence(struct smu_context *smu, |
| 1579 | enum smu_v11_0_baco_seq baco_seq) | 1579 | enum smu_baco_seq baco_seq) |
| 1580 | { | 1580 | { |
| 1581 | return smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_ArmD3, baco_seq, NULL); | 1581 | return smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_ArmD3, baco_seq, NULL); |
| 1582 | } | 1582 | } |
| @@ -2230,6 +2230,15 @@ int smu_v13_0_gfx_ulv_control(struct smu_context *smu, · 2229 unmodified lines | |||
| 2230 | return ret; | 2230 | return ret; |
| 2231 | } | 2231 | } |
| 2232 | 2232 | ||
| 2233 | int smu_v13_0_baco_set_armd3_sequence(struct smu_context *smu, | ||
| 2234 | enum smu_baco_seq baco_seq) | ||
| 2235 | { | ||
| 2236 | return smu_cmn_send_smc_msg_with_param(smu, | ||
| 2237 | SMU_MSG_ArmD3, | ||
| 2238 | baco_seq, | ||
| 2239 | NULL); | ||
| 2240 | } | ||
| 2241 | |||
| 2233 | bool smu_v13_0_baco_is_support(struct smu_context *smu) | 2242 | bool smu_v13_0_baco_is_support(struct smu_context *smu) |
| 2234 | { | 2243 | { |
| 2235 | struct smu_baco_context *smu_baco = &smu->smu_baco; | 2244 | struct smu_baco_context *smu_baco = &smu->smu_baco; |
| @@ -120,6 +120,7 @@ static struct cmn2asic_msg_mapping smu_v13_0_0_message_map[SMU_MSG_MAX_COUNT] = · 119 unmodified lines | |||
| 120 | MSG_MAP(Mode1Reset, PPSMC_MSG_Mode1Reset, 0), | 120 | MSG_MAP(Mode1Reset, PPSMC_MSG_Mode1Reset, 0), |
| 121 | MSG_MAP(PrepareMp1ForUnload, PPSMC_MSG_PrepareMp1ForUnload, 0), | 121 | MSG_MAP(PrepareMp1ForUnload, PPSMC_MSG_PrepareMp1ForUnload, 0), |
| 122 | MSG_MAP(DFCstateControl, PPSMC_MSG_SetExternalClientDfCstateAllow, 0), | 122 | MSG_MAP(DFCstateControl, PPSMC_MSG_SetExternalClientDfCstateAllow, 0), |
| 123 | MSG_MAP(ArmD3, PPSMC_MSG_ArmD3, 0), | ||
| 123 | }; | 124 | }; |
| 124 | 125 | ||
| 125 | static struct cmn2asic_mapping smu_v13_0_0_clk_map[SMU_CLK_COUNT] = { | 126 | static struct cmn2asic_mapping smu_v13_0_0_clk_map[SMU_CLK_COUNT] = { |
| @@ -1566,6 +1567,31 @@ static int smu_v13_0_0_set_power_profile_mode(struct smu_context *smu, · 1440 unmodified lines | |||
| 1566 | NULL); | 1567 | NULL); |
| 1567 | } | 1568 | } |
| 1568 | 1569 | ||
| 1570 | static int smu_v13_0_0_baco_enter(struct smu_context *smu) | ||
| 1571 | { | ||
| 1572 | struct smu_baco_context *smu_baco = &smu->smu_baco; | ||
| 1573 | struct amdgpu_device *adev = smu->adev; | ||
| 1574 | |||
| 1575 | if (adev->in_runpm && smu_cmn_is_audio_func_enabled(adev)) | ||
| 1576 | return smu_v13_0_baco_set_armd3_sequence(smu, | ||
| 1577 | smu_baco->maco_support ? BACO_SEQ_BAMACO : BACO_SEQ_BACO); | ||
| 1578 | else | ||
| 1579 | return smu_v13_0_baco_enter(smu); | ||
| 1580 | } | ||
| 1581 | |||
| 1582 | static int smu_v13_0_0_baco_exit(struct smu_context *smu) | ||
| 1583 | { | ||
| 1584 | struct amdgpu_device *adev = smu->adev; | ||
| 1585 | |||
| 1586 | if (adev->in_runpm && smu_cmn_is_audio_func_enabled(adev)) { | ||
| 1587 | /* Wait for PMFW handling for the Dstate change */ | ||
| 1588 | usleep_range(10000, 11000); | ||
| 1589 | return smu_v13_0_baco_set_armd3_sequence(smu, BACO_SEQ_ULPS); | ||
| 1590 | } else { | ||
| 1591 | return smu_v13_0_baco_exit(smu); | ||
| 1592 | } | ||
| 1593 | } | ||
| 1594 | |||
| 1569 | static bool smu_v13_0_0_is_mode1_reset_supported(struct smu_context *smu) | 1595 | static bool smu_v13_0_0_is_mode1_reset_supported(struct smu_context *smu) |
| 1570 | { | 1596 | { |
| 1571 | struct amdgpu_device *adev = smu->adev; | 1597 | struct amdgpu_device *adev = smu->adev; |
| @@ -1827,8 +1853,8 @@ static const struct pptable_funcs smu_v13_0_0_ppt_funcs = { · 255 unmodified lines | |||
| 1827 | .baco_is_support = smu_v13_0_baco_is_support, | 1853 | .baco_is_support = smu_v13_0_baco_is_support, |
| 1828 | .baco_get_state = smu_v13_0_baco_get_state, | 1854 | .baco_get_state = smu_v13_0_baco_get_state, |
| 1829 | .baco_set_state = smu_v13_0_baco_set_state, | 1855 | .baco_set_state = smu_v13_0_baco_set_state, |
| 1830 | .baco_enter = smu_v13_0_baco_enter, | 1856 | .baco_enter = smu_v13_0_0_baco_enter, |
| 1831 | .baco_exit = smu_v13_0_baco_exit, | 1857 | .baco_exit = smu_v13_0_0_baco_exit, |
| 1832 | .mode1_reset_is_support = smu_v13_0_0_is_mode1_reset_supported, | 1858 | .mode1_reset_is_support = smu_v13_0_0_is_mode1_reset_supported, |
| 1833 | .mode1_reset = smu_v13_0_mode1_reset, | 1859 | .mode1_reset = smu_v13_0_mode1_reset, |
| 1834 | .set_mp1_state = smu_v13_0_0_set_mp1_state, | 1860 | .set_mp1_state = smu_v13_0_0_set_mp1_state, |
| @@ -122,6 +122,7 @@ static struct cmn2asic_msg_mapping smu_v13_0_7_message_map[SMU_MSG_MAX_COUNT] = · 121 unmodified lines | |||
| 122 | MSG_MAP(PrepareMp1ForUnload, PPSMC_MSG_PrepareMp1ForUnload, 0), | 122 | MSG_MAP(PrepareMp1ForUnload, PPSMC_MSG_PrepareMp1ForUnload, 0), |
| 123 | MSG_MAP(SetMGpuFanBoostLimitRpm, PPSMC_MSG_SetMGpuFanBoostLimitRpm, 0), | 123 | MSG_MAP(SetMGpuFanBoostLimitRpm, PPSMC_MSG_SetMGpuFanBoostLimitRpm, 0), |
| 124 | MSG_MAP(DFCstateControl, PPSMC_MSG_SetExternalClientDfCstateAllow, 0), | 124 | MSG_MAP(DFCstateControl, PPSMC_MSG_SetExternalClientDfCstateAllow, 0), |
| 125 | MSG_MAP(ArmD3, PPSMC_MSG_ArmD3, 0), | ||
| 125 | }; | 126 | }; |
| 126 | 127 | ||
| 127 | static struct cmn2asic_mapping smu_v13_0_7_clk_map[SMU_CLK_COUNT] = { | 128 | static struct cmn2asic_mapping smu_v13_0_7_clk_map[SMU_CLK_COUNT] = { |
| @@ -1578,6 +1579,31 @@ static int smu_v13_0_7_set_mp1_state(struct smu_context *smu, · 1450 unmodified lines | |||
| 1578 | return ret; | 1579 | return ret; |
| 1579 | } | 1580 | } |
| 1580 | 1581 | ||
| 1582 | static int smu_v13_0_7_baco_enter(struct smu_context *smu) | ||
| 1583 | { | ||
| 1584 | struct smu_baco_context *smu_baco = &smu->smu_baco; | ||
| 1585 | struct amdgpu_device *adev = smu->adev; | ||
| 1586 | |||
| 1587 | if (adev->in_runpm && smu_cmn_is_audio_func_enabled(adev)) | ||
| 1588 | return smu_v13_0_baco_set_armd3_sequence(smu, | ||
| 1589 | smu_baco->maco_support ? BACO_SEQ_BAMACO : BACO_SEQ_BACO); | ||
| 1590 | else | ||
| 1591 | return smu_v13_0_baco_enter(smu); | ||
| 1592 | } | ||
| 1593 | |||
| 1594 | static int smu_v13_0_7_baco_exit(struct smu_context *smu) | ||
| 1595 | { | ||
| 1596 | struct amdgpu_device *adev = smu->adev; | ||
| 1597 | |||
| 1598 | if (adev->in_runpm && smu_cmn_is_audio_func_enabled(adev)) { | ||
| 1599 | /* Wait for PMFW handling for the Dstate change */ | ||
| 1600 | usleep_range(10000, 11000); | ||
| 1601 | return smu_v13_0_baco_set_armd3_sequence(smu, BACO_SEQ_ULPS); | ||
| 1602 | } else { | ||
| 1603 | return smu_v13_0_baco_exit(smu); | ||
| 1604 | } | ||
| 1605 | } | ||
| 1606 | |||
| 1581 | static bool smu_v13_0_7_is_mode1_reset_supported(struct smu_context *smu) | 1607 | static bool smu_v13_0_7_is_mode1_reset_supported(struct smu_context *smu) |
| 1582 | { | 1608 | { |
| 1583 | struct amdgpu_device *adev = smu->adev; | 1609 | struct amdgpu_device *adev = smu->adev; |
| @@ -1655,8 +1681,8 @@ static const struct pptable_funcs smu_v13_0_7_ppt_funcs = { · 71 unmodified lines | |||
| 1655 | .baco_is_support = smu_v13_0_baco_is_support, | 1681 | .baco_is_support = smu_v13_0_baco_is_support, |
| 1656 | .baco_get_state = smu_v13_0_baco_get_state, | 1682 | .baco_get_state = smu_v13_0_baco_get_state, |
| 1657 | .baco_set_state = smu_v13_0_baco_set_state, | 1683 | .baco_set_state = smu_v13_0_baco_set_state, |
| 1658 | .baco_enter = smu_v13_0_baco_enter, | 1684 | .baco_enter = smu_v13_0_7_baco_enter, |
| 1659 | .baco_exit = smu_v13_0_baco_exit, | 1685 | .baco_exit = smu_v13_0_7_baco_exit, |
| 1660 | .mode1_reset_is_support = smu_v13_0_7_is_mode1_reset_supported, | 1686 | .mode1_reset_is_support = smu_v13_0_7_is_mode1_reset_supported, |
| 1661 | .mode1_reset = smu_v13_0_mode1_reset, | 1687 | .mode1_reset = smu_v13_0_mode1_reset, |
| 1662 | .set_mp1_state = smu_v13_0_7_set_mp1_state, | 1688 | .set_mp1_state = smu_v13_0_7_set_mp1_state, |
| @@ -63,23 +63,45 @@ · 62 unmodified lines | |||
| 63 | ssize_t drm_dp_dual_mode_read(struct i2c_adapter *adapter, | 63 | ssize_t drm_dp_dual_mode_read(struct i2c_adapter *adapter, |
| 64 | u8 offset, void *buffer, size_t size) | 64 | u8 offset, void *buffer, size_t size) |
| 65 | { | 65 | { |
| 66 | u8 zero = 0; | ||
| 67 | char *tmpbuf = NULL; | ||
| 68 | /* | ||
| 69 | * As sub-addressing is not supported by all adaptors, | ||
| 70 | * always explicitly read from the start and discard | ||
| 71 | * any bytes that come before the requested offset. | ||
| 72 | * This way, no matter whether the adaptor supports it | ||
| 73 | * or not, we'll end up reading the proper data. | ||
| 74 | */ | ||
| 66 | struct i2c_msg msgs[] = { | 75 | struct i2c_msg msgs[] = { |
| 67 | { | 76 | { |
| 68 | .addr = DP_DUAL_MODE_SLAVE_ADDRESS, | 77 | .addr = DP_DUAL_MODE_SLAVE_ADDRESS, |
| 69 | .flags = 0, | 78 | .flags = 0, |
| 70 | .len = 1, | 79 | .len = 1, |
| 71 | .buf = &offset, | 80 | .buf = &zero, |
| 72 | }, | 81 | }, |
| 73 | { | 82 | { |
| 74 | .addr = DP_DUAL_MODE_SLAVE_ADDRESS, | 83 | .addr = DP_DUAL_MODE_SLAVE_ADDRESS, |
| 75 | .flags = I2C_M_RD, | 84 | .flags = I2C_M_RD, |
| 76 | .len = size, | 85 | .len = size + offset, |
| 77 | .buf = buffer, | 86 | .buf = buffer, |
| 78 | }, | 87 | }, |
| 79 | }; | 88 | }; |
| 80 | int ret; | 89 | int ret; |
| 81 | 90 | ||
| 91 | if (offset) { | ||
| 92 | tmpbuf = kmalloc(size + offset, GFP_KERNEL); | ||
| 93 | if (!tmpbuf) | ||
| 94 | return -ENOMEM; | ||
| 95 | |||
| 96 | msgs[1].buf = tmpbuf; | ||
| 97 | } | ||
| 98 | |||
| 82 | ret = i2c_transfer(adapter, msgs, ARRAY_SIZE(msgs)); | 99 | ret = i2c_transfer(adapter, msgs, ARRAY_SIZE(msgs)); |
| 100 | if (tmpbuf) | ||
| 101 | memcpy(buffer, tmpbuf + offset, size); | ||
| 102 | |||
| 103 | kfree(tmpbuf); | ||
| 104 | |||
| 83 | if (ret < 0) | 105 | if (ret < 0) |
| 84 | return ret; | 106 | return ret; |
| 85 | if (ret != ARRAY_SIZE(msgs)) | 107 | if (ret != ARRAY_SIZE(msgs)) |
| @@ -208,18 +230,6 @@ enum drm_dp_dual_mode_type drm_dp_dual_mode_detect(const struct drm_device *dev, · 122 unmodified lines | |||
| 208 | if (ret) | 230 | if (ret) |
| 209 | return DRM_DP_DUAL_MODE_UNKNOWN; | 231 | return DRM_DP_DUAL_MODE_UNKNOWN; |
| 210 | 232 | ||
| 211 | /* | ||
| 212 | * Sigh. Some (maybe all?) type 1 adaptors are broken and ack | ||
| 213 | * the offset but ignore it, and instead they just always return | ||
| 214 | * data from the start of the HDMI ID buffer. So for a broken | ||
| 215 | * type 1 HDMI adaptor a single byte read will always give us | ||
| 216 | * 0x44, and for a type 1 DVI adaptor it should give 0x00 | ||
| 217 | * (assuming it implements any registers). Fortunately neither | ||
| 218 | * of those values will match the type 2 signature of the | ||
| 219 | * DP_DUAL_MODE_ADAPTOR_ID register so we can proceed with | ||
| 220 | * the type 2 adaptor detection safely even in the presence | ||
| 221 | * of broken type 1 adaptors. | ||
| 222 | */ | ||
| 223 | ret = drm_dp_dual_mode_read(adapter, DP_DUAL_MODE_ADAPTOR_ID, | 233 | ret = drm_dp_dual_mode_read(adapter, DP_DUAL_MODE_ADAPTOR_ID, |
| 224 | &adaptor_id, sizeof(adaptor_id)); | 234 | &adaptor_id, sizeof(adaptor_id)); |
| 225 | drm_dbg_kms(dev, "DP dual mode adaptor ID: %02x (err %zd)\n", adaptor_id, ret); | 235 | drm_dbg_kms(dev, "DP dual mode adaptor ID: %02x (err %zd)\n", adaptor_id, ret); |
| @@ -233,11 +243,10 @@ enum drm_dp_dual_mode_type drm_dp_dual_mode_detect(const struct drm_device *dev, · 7 unmodified lines | |||
| 233 | return DRM_DP_DUAL_MODE_TYPE2_DVI; | 243 | return DRM_DP_DUAL_MODE_TYPE2_DVI; |
| 234 | } | 244 | } |
| 235 | /* | 245 | /* |
| 236 | * If neither a proper type 1 ID nor a broken type 1 adaptor | 246 | * If not a proper type 1 ID, still assume type 1, but let |
| 237 | * as described above, assume type 1, but let the user know | 247 | * the user know that we may have misdetected the type. |
| 238 | * that we may have misdetected the type. | ||
| 239 | */ | 248 | */ |
| 240 | if (!is_type1_adaptor(adaptor_id) && adaptor_id != hdmi_id[0]) | 249 | if (!is_type1_adaptor(adaptor_id)) |
| 241 | drm_err(dev, "Unexpected DP dual mode adaptor ID %02x\n", adaptor_id); | 250 | drm_err(dev, "Unexpected DP dual mode adaptor ID %02x\n", adaptor_id); |
| 242 | 251 | ||
| 243 | } | 252 | } |
| @@ -343,10 +352,8 @@ EXPORT_SYMBOL(drm_dp_dual_mode_get_tmds_output); · 99 unmodified lines | |||
| 343 | * @enable: enable (as opposed to disable) the TMDS output buffers | 352 | * @enable: enable (as opposed to disable) the TMDS output buffers |
| 344 | * | 353 | * |
| 345 | * Set the state of the TMDS output buffers in the adaptor. For | 354 | * Set the state of the TMDS output buffers in the adaptor. For |
| 346 | * type2 this is set via the DP_DUAL_MODE_TMDS_OEN register. As | 355 | * type2 this is set via the DP_DUAL_MODE_TMDS_OEN register. |
| 347 | * some type 1 adaptors have problems with registers (see comments | 356 | * Type1 adaptors do not support any register writes. |
| 348 | * in drm_dp_dual_mode_detect()) we avoid touching the register, | ||
| 349 | * making this function a no-op on type 1 adaptors. | ||
| 350 | * | 357 | * |
| 351 | * Returns: | 358 | * Returns: |
| 352 | * 0 on success, negative error code on failure | 359 | * 0 on success, negative error code on failure |
| @@ -615,7 +615,7 @@ static int drm_dev_init(struct drm_device *dev, · 614 unmodified lines | |||
| 615 | mutex_init(&dev->clientlist_mutex); | 615 | mutex_init(&dev->clientlist_mutex); |
| 616 | mutex_init(&dev->master_mutex); | 616 | mutex_init(&dev->master_mutex); |
| 617 | 617 | ||
| 618 | ret = drmm_add_action(dev, drm_dev_init_release, NULL); | 618 | ret = drmm_add_action_or_reset(dev, drm_dev_init_release, NULL); |
| 619 | if (ret) | 619 | if (ret) |
| 620 | return ret; | 620 | return ret; |
| 621 | 621 | ||
| @@ -104,7 +104,8 @@ static inline void drm_vblank_flush_worker(struct drm_vblank_crtc *vblank) · 103 unmodified lines | |||
| 104 | 104 | ||
| 105 | static inline void drm_vblank_destroy_worker(struct drm_vblank_crtc *vblank) | 105 | static inline void drm_vblank_destroy_worker(struct drm_vblank_crtc *vblank) |
| 106 | { | 106 | { |
| 107 | kthread_destroy_worker(vblank->worker); | 107 | if (vblank->worker) |
| 108 | kthread_destroy_worker(vblank->worker); | ||
| 108 | } | 109 | } |
| 109 | 110 | ||
| 110 | int drm_vblank_worker_init(struct drm_vblank_crtc *vblank); | 111 | int drm_vblank_worker_init(struct drm_vblank_crtc *vblank); |
| @@ -151,9 +151,6 @@ int drm_mode_getresources(struct drm_device *dev, void *data, · 150 unmodified lines | |||
| 151 | count = 0; | 151 | count = 0; |
| 152 | connector_id = u64_to_user_ptr(card_res->connector_id_ptr); | 152 | connector_id = u64_to_user_ptr(card_res->connector_id_ptr); |
| 153 | drm_for_each_connector_iter(connector, &conn_iter) { | 153 | drm_for_each_connector_iter(connector, &conn_iter) { |
| 154 | if (connector->registration_state != DRM_CONNECTOR_REGISTERED) | ||
| 155 | continue; | ||
| 156 | |||
| 157 | /* only expose writeback connectors if userspace understands them */ | 154 | /* only expose writeback connectors if userspace understands them */ |
| 158 | if (!file_priv->writeback_connectors && | 155 | if (!file_priv->writeback_connectors && |
| 159 | (connector->connector_type == DRM_MODE_CONNECTOR_WRITEBACK)) | 156 | (connector->connector_type == DRM_MODE_CONNECTOR_WRITEBACK)) |
| @@ -1174,6 +1174,8 @@ static int tda998x_audio_codec_init(struct tda998x_priv *priv, · 1173 unmodified lines | |||
| 1174 | struct hdmi_codec_pdata codec_data = { | 1174 | struct hdmi_codec_pdata codec_data = { |
| 1175 | .ops = &audio_codec_ops, | 1175 | .ops = &audio_codec_ops, |
| 1176 | .max_i2s_channels = 2, | 1176 | .max_i2s_channels = 2, |
| 1177 | .no_i2s_capture = 1, | ||
| 1178 | .no_spdif_capture = 1, | ||
| 1177 | }; | 1179 | }; |
| 1178 | 1180 | ||
| 1179 | if (priv->audio_port_enable[AUDIO_ROUTE_I2S]) | 1181 | if (priv->audio_port_enable[AUDIO_ROUTE_I2S]) |
| @@ -1013,9 +1013,6 @@ static vm_fault_t vm_fault_ttm(struct vm_fault *vmf) · 1012 unmodified lines | |||
| 1013 | return VM_FAULT_SIGBUS; | 1013 | return VM_FAULT_SIGBUS; |
| 1014 | } | 1014 | } |
| 1015 | 1015 | ||
| 1016 | if (i915_ttm_cpu_maps_iomem(bo->resource)) | ||
| 1017 | wakeref = intel_runtime_pm_get(&to_i915(obj->base.dev)->runtime_pm); | ||
| 1018 | |||
| 1019 | if (!i915_ttm_resource_mappable(bo->resource)) { | 1016 | if (!i915_ttm_resource_mappable(bo->resource)) { |
| 1020 | int err = -ENODEV; | 1017 | int err = -ENODEV; |
| 1021 | int i; | 1018 | int i; |
| @@ -1042,6 +1039,9 @@ static vm_fault_t vm_fault_ttm(struct vm_fault *vmf) · 20 unmodified lines | |||
| 1042 | } | 1039 | } |
| 1043 | } | 1040 | } |
| 1044 | 1041 | ||
| 1042 | if (i915_ttm_cpu_maps_iomem(bo->resource)) | ||
| 1043 | wakeref = intel_runtime_pm_get(&to_i915(obj->base.dev)->runtime_pm); | ||
| 1044 | |||
| 1045 | if (drm_dev_enter(dev, &idx)) { | 1045 | if (drm_dev_enter(dev, &idx)) { |
| 1046 | ret = ttm_bo_vm_fault_reserved(vmf, vmf->vma->vm_page_prot, | 1046 | ret = ttm_bo_vm_fault_reserved(vmf, vmf->vma->vm_page_prot, |
| 1047 | TTM_BO_VM_NUM_PREFAULT); | 1047 | TTM_BO_VM_NUM_PREFAULT); |
| @@ -112,11 +112,6 @@ int lima_devfreq_init(struct lima_device *ldev) · 111 unmodified lines | |||
| 112 | unsigned long cur_freq; | 112 | unsigned long cur_freq; |
| 113 | int ret; | 113 | int ret; |
| 114 | const char *regulator_names[] = { "mali", NULL }; | 114 | const char *regulator_names[] = { "mali", NULL }; |
| 115 | const char *clk_names[] = { "core", NULL }; | ||
| 116 | struct dev_pm_opp_config config = { | ||
| 117 | .regulator_names = regulator_names, | ||
| 118 | .clk_names = clk_names, | ||
| 119 | }; | ||
| 120 | 115 | ||
| 121 | if (!device_property_present(dev, "operating-points-v2")) | 116 | if (!device_property_present(dev, "operating-points-v2")) |
| 122 | /* Optional, continue without devfreq */ | 117 | /* Optional, continue without devfreq */ |
| @@ -124,7 +119,15 @@ int lima_devfreq_init(struct lima_device *ldev) · 1 unmodified line | |||
| 124 | 119 | ||
| 125 | spin_lock_init(&ldevfreq->lock); | 120 | spin_lock_init(&ldevfreq->lock); |
| 126 | 121 | ||
| 127 | ret = devm_pm_opp_set_config(dev, &config); | 122 | /* |
| 123 | * clkname is set separately so it is not affected by the optional | ||
| 124 | * regulator setting which may return error. | ||
| 125 | */ | ||
| 126 | ret = devm_pm_opp_set_clkname(dev, "core"); | ||
| 127 | if (ret) | ||
| 128 | return ret; | ||
| 129 | |||
| 130 | ret = devm_pm_opp_set_regulators(dev, regulator_names); | ||
| 128 | if (ret) { | 131 | if (ret) { |
| 129 | /* Continue if the optional regulator is missing */ | 132 | /* Continue if the optional regulator is missing */ |
| 130 | if (ret != -ENODEV) | 133 | if (ret != -ENODEV) |
| @@ -2500,6 +2500,7 @@ static const struct display_timing logictechno_lt161010_2nh_timing = { · 2499 unmodified lines | |||
| 2500 | static const struct panel_desc logictechno_lt161010_2nh = { | 2500 | static const struct panel_desc logictechno_lt161010_2nh = { |
| 2501 | .timings = &logictechno_lt161010_2nh_timing, | 2501 | .timings = &logictechno_lt161010_2nh_timing, |
| 2502 | .num_timings = 1, | 2502 | .num_timings = 1, |
| 2503 | .bpc = 6, | ||
| 2503 | .size = { | 2504 | .size = { |
| 2504 | .width = 154, | 2505 | .width = 154, |
| 2505 | .height = 86, | 2506 | .height = 86, |
| @@ -2529,6 +2530,7 @@ static const struct display_timing logictechno_lt170410_2whc_timing = { · 23 unmodified lines | |||
| 2529 | static const struct panel_desc logictechno_lt170410_2whc = { | 2530 | static const struct panel_desc logictechno_lt170410_2whc = { |
| 2530 | .timings = &logictechno_lt170410_2whc_timing, | 2531 | .timings = &logictechno_lt170410_2whc_timing, |
| 2531 | .num_timings = 1, | 2532 | .num_timings = 1, |
| 2533 | .bpc = 8, | ||
| 2532 | .size = { | 2534 | .size = { |
| 2533 | .width = 217, | 2535 | .width = 217, |
| 2534 | .height = 136, | 2536 | .height = 136, |
| @@ -1093,6 +1093,10 @@ static bool host1x_drm_wants_iommu(struct host1x_device *dev) · 1092 unmodified lines | |||
| 1093 | struct host1x *host1x = dev_get_drvdata(dev->dev.parent); | 1093 | struct host1x *host1x = dev_get_drvdata(dev->dev.parent); |
| 1094 | struct iommu_domain *domain; | 1094 | struct iommu_domain *domain; |
| 1095 | 1095 | ||
| 1096 | /* Our IOMMU usage policy doesn't currently play well with GART */ | ||
| 1097 | if (of_machine_is_compatible("nvidia,tegra20")) | ||
| 1098 | return false; | ||
| 1099 | |||
| 1096 | /* | 1100 | /* |
| 1097 | * If the Tegra DRM clients are backed by an IOMMU, push buffers are | 1101 | * If the Tegra DRM clients are backed by an IOMMU, push buffers are |
| 1098 | * likely to be allocated beyond the 32-bit boundary if sufficient | 1102 | * likely to be allocated beyond the 32-bit boundary if sufficient |
| @@ -197,8 +197,8 @@ vc4_hvs_get_new_global_state(struct drm_atomic_state *state) · 196 unmodified lines | |||
| 197 | struct drm_private_state *priv_state; | 197 | struct drm_private_state *priv_state; |
| 198 | 198 | ||
| 199 | priv_state = drm_atomic_get_new_private_obj_state(state, &vc4->hvs_channels); | 199 | priv_state = drm_atomic_get_new_private_obj_state(state, &vc4->hvs_channels); |
| 200 | if (IS_ERR(priv_state)) | 200 | if (!priv_state) |
| 201 | return ERR_CAST(priv_state); | 201 | return ERR_PTR(-EINVAL); |
| 202 | 202 | ||
| 203 | return to_vc4_hvs_state(priv_state); | 203 | return to_vc4_hvs_state(priv_state); |
| 204 | } | 204 | } |
| @@ -210,8 +210,8 @@ vc4_hvs_get_old_global_state(struct drm_atomic_state *state) · 5 unmodified lines | |||
| 210 | struct drm_private_state *priv_state; | 210 | struct drm_private_state *priv_state; |
| 211 | 211 | ||
| 212 | priv_state = drm_atomic_get_old_private_obj_state(state, &vc4->hvs_channels); | 212 | priv_state = drm_atomic_get_old_private_obj_state(state, &vc4->hvs_channels); |
| 213 | if (IS_ERR(priv_state)) | 213 | if (!priv_state) |
| 214 | return ERR_CAST(priv_state); | 214 | return ERR_PTR(-EINVAL); |
| 215 | 215 | ||
| 216 | return to_vc4_hvs_state(priv_state); | 216 | return to_vc4_hvs_state(priv_state); |
| 217 | } | 217 | } |
| @@ -292,6 +292,10 @@ static void host1x_setup_virtualization_tables(struct host1x *host) · 291 unmodified lines | |||
| 292 | 292 | ||
| 293 | static bool host1x_wants_iommu(struct host1x *host1x) | 293 | static bool host1x_wants_iommu(struct host1x *host1x) |
| 294 | { | 294 | { |
| 295 | /* Our IOMMU usage policy doesn't currently play well with GART */ | ||
| 296 | if (of_machine_is_compatible("nvidia,tegra20")) | ||
| 297 | return false; | ||
| 298 | |||
| 295 | /* | 299 | /* |
| 296 | * If we support addressing a maximum of 32 bits of physical memory | 300 | * If we support addressing a maximum of 32 bits of physical memory |
| 297 | * and if the host1x firewall is enabled, there's no need to enable | 301 | * and if the host1x firewall is enabled, there's no need to enable |
| @@ -869,18 +869,6 @@ static int bma400_init(struct bma400_data *data) · 868 unmodified lines | |||
| 869 | unsigned int val; | 869 | unsigned int val; |
| 870 | int ret; | 870 | int ret; |
| 871 | 871 | ||
| 872 | /* Try to read chip_id register. It must return 0x90. */ | ||
| 873 | ret = regmap_read(data->regmap, BMA400_CHIP_ID_REG, &val); | ||
| 874 | if (ret) { | ||
| 875 | dev_err(data->dev, "Failed to read chip id register\n"); | ||
| 876 | return ret; | ||
| 877 | } | ||
| 878 | |||
| 879 | if (val != BMA400_ID_REG_VAL) { | ||
| 880 | dev_err(data->dev, "Chip ID mismatch\n"); | ||
| 881 | return -ENODEV; | ||
| 882 | } | ||
| 883 | |||
| 884 | data->regulators[BMA400_VDD_REGULATOR].supply = "vdd"; | 872 | data->regulators[BMA400_VDD_REGULATOR].supply = "vdd"; |
| 885 | data->regulators[BMA400_VDDIO_REGULATOR].supply = "vddio"; | 873 | data->regulators[BMA400_VDDIO_REGULATOR].supply = "vddio"; |
| 886 | ret = devm_regulator_bulk_get(data->dev, | 874 | ret = devm_regulator_bulk_get(data->dev, |
| @@ -906,6 +894,18 @@ static int bma400_init(struct bma400_data *data) · 19 unmodified lines | |||
| 906 | if (ret) | 894 | if (ret) |
| 907 | return ret; | 895 | return ret; |
| 908 | 896 | ||
| 897 | /* Try to read chip_id register. It must return 0x90. */ | ||
| 898 | ret = regmap_read(data->regmap, BMA400_CHIP_ID_REG, &val); | ||
| 899 | if (ret) { | ||
| 900 | dev_err(data->dev, "Failed to read chip id register\n"); | ||
| 901 | return ret; | ||
| 902 | } | ||
| 903 | |||
| 904 | if (val != BMA400_ID_REG_VAL) { | ||
| 905 | dev_err(data->dev, "Chip ID mismatch\n"); | ||
| 906 | return -ENODEV; | ||
| 907 | } | ||
| 908 | |||
| 909 | ret = bma400_get_power_mode(data); | 909 | ret = bma400_get_power_mode(data); |
| 910 | if (ret) { | 910 | if (ret) { |
| 911 | dev_err(data->dev, "Failed to get the initial power-mode\n"); | 911 | dev_err(data->dev, "Failed to get the initial power-mode\n"); |
| @@ -2307,11 +2307,9 @@ static int at91_adc_temp_sensor_init(struct at91_adc_state *st, · 2306 unmodified lines | |||
| 2307 | clb->p6 = buf[AT91_ADC_TS_CLB_IDX_P6]; | 2307 | clb->p6 = buf[AT91_ADC_TS_CLB_IDX_P6]; |
| 2308 | 2308 | ||
| 2309 | /* | 2309 | /* |
| 2310 | * We prepare here the conversion to milli and also add constant | 2310 | * We prepare here the conversion to milli to avoid doing it on hotpath. |
| 2311 | * factor (5 degrees Celsius) to p1 here to avoid doing it on | ||
| 2312 | * hotpath. | ||
| 2313 | */ | 2311 | */ |
| 2314 | clb->p1 = clb->p1 * 1000 + 5000; | 2312 | clb->p1 = clb->p1 * 1000; |
| 2315 | 2313 | ||
| 2316 | free_buf: | 2314 | free_buf: |
| 2317 | kfree(buf); | 2315 | kfree(buf); |
| @@ -634,8 +634,10 @@ static struct iio_trigger *at91_adc_allocate_trigger(struct iio_dev *idev, · 633 unmodified lines | |||
| 634 | trig->ops = &at91_adc_trigger_ops; | 634 | trig->ops = &at91_adc_trigger_ops; |
| 635 | 635 | ||
| 636 | ret = iio_trigger_register(trig); | 636 | ret = iio_trigger_register(trig); |
| 637 | if (ret) | 637 | if (ret) { |
| 638 | iio_trigger_free(trig); | ||
| 638 | return NULL; | 639 | return NULL; |
| 640 | } | ||
| 639 | 641 | ||
| 640 | return trig; | 642 | return trig; |
| 641 | } | 643 | } |
| @@ -57,7 +57,8 @@ static struct iio_map mp2629_adc_maps[] = { · 56 unmodified lines | |||
| 57 | MP2629_MAP(SYSTEM_VOLT, "system-volt"), | 57 | MP2629_MAP(SYSTEM_VOLT, "system-volt"), |
| 58 | MP2629_MAP(INPUT_VOLT, "input-volt"), | 58 | MP2629_MAP(INPUT_VOLT, "input-volt"), |
| 59 | MP2629_MAP(BATT_CURRENT, "batt-current"), | 59 | MP2629_MAP(BATT_CURRENT, "batt-current"), |
| 60 | MP2629_MAP(INPUT_CURRENT, "input-current") | 60 | MP2629_MAP(INPUT_CURRENT, "input-current"), |
| 61 | { } | ||
| 61 | }; | 62 | }; |
| 62 | 63 | ||
| 63 | static int mp2629_read_raw(struct iio_dev *indio_dev, | 64 | static int mp2629_read_raw(struct iio_dev *indio_dev, |
| @@ -74,7 +75,7 @@ static int mp2629_read_raw(struct iio_dev *indio_dev, · 10 unmodified lines | |||
| 74 | if (ret) | 75 | if (ret) |
| 75 | return ret; | 76 | return ret; |
| 76 | 77 | ||
| 77 | if (chan->address == MP2629_INPUT_VOLT) | 78 | if (chan->channel == MP2629_INPUT_VOLT) |
| 78 | rval &= GENMASK(6, 0); | 79 | rval &= GENMASK(6, 0); |
| 79 | *val = rval; | 80 | *val = rval; |
| 80 | return IIO_VAL_INT; | 81 | return IIO_VAL_INT; |
| @@ -632,7 +632,7 @@ static int bno055_set_regmask(struct bno055_priv *priv, int val, int val2, · 631 unmodified lines | |||
| 632 | return -EINVAL; | 632 | return -EINVAL; |
| 633 | } | 633 | } |
| 634 | delta = abs(tbl_val - req_val); | 634 | delta = abs(tbl_val - req_val); |
| 635 | if (delta < best_delta || first) { | 635 | if (first || delta < best_delta) { |
| 636 | best_delta = delta; | 636 | best_delta = delta; |
| 637 | hwval = i; | 637 | hwval = i; |
| 638 | first = false; | 638 | first = false; |
| @@ -25,13 +25,6 @@ enum { · 24 unmodified lines | |||
| 25 | MS5607, | 25 | MS5607, |
| 26 | }; | 26 | }; |
| 27 | 27 | ||
| 28 | struct ms5611_chip_info { | ||
| 29 | u16 prom[MS5611_PROM_WORDS_NB]; | ||
| 30 | |||
| 31 | int (*temp_and_pressure_compensate)(struct ms5611_chip_info *chip_info, | ||
| 32 | s32 *temp, s32 *pressure); | ||
| 33 | }; | ||
| 34 | |||
| 35 | /* | 28 | /* |
| 36 | * OverSampling Rate descriptor. | 29 | * OverSampling Rate descriptor. |
| 37 | * Warning: cmd MUST be kept aligned on a word boundary (see | 30 | * Warning: cmd MUST be kept aligned on a word boundary (see |
| @@ -50,12 +43,15 @@ struct ms5611_state { · 12 unmodified lines | |||
| 50 | const struct ms5611_osr *pressure_osr; | 43 | const struct ms5611_osr *pressure_osr; |
| 51 | const struct ms5611_osr *temp_osr; | 44 | const struct ms5611_osr *temp_osr; |
| 52 | 45 | ||
| 46 | u16 prom[MS5611_PROM_WORDS_NB]; | ||
| 47 | |||
| 53 | int (*reset)(struct ms5611_state *st); | 48 | int (*reset)(struct ms5611_state *st); |
| 54 | int (*read_prom_word)(struct ms5611_state *st, int index, u16 *word); | 49 | int (*read_prom_word)(struct ms5611_state *st, int index, u16 *word); |
| 55 | int (*read_adc_temp_and_pressure)(struct ms5611_state *st, | 50 | int (*read_adc_temp_and_pressure)(struct ms5611_state *st, |
| 56 | s32 *temp, s32 *pressure); | 51 | s32 *temp, s32 *pressure); |
| 57 | 52 | ||
| 58 | struct ms5611_chip_info *chip_info; | 53 | int (*compensate_temp_and_pressure)(struct ms5611_state *st, s32 *temp, |
| 54 | s32 *pressure); | ||
| 59 | struct regulator *vdd; | 55 | struct regulator *vdd; |
| 60 | }; | 56 | }; |
| 61 | 57 | ||
| @@ -85,7 +85,7 @@ static int ms5611_read_prom(struct iio_dev *indio_dev) · 84 unmodified lines | |||
| 85 | struct ms5611_state *st = iio_priv(indio_dev); | 85 | struct ms5611_state *st = iio_priv(indio_dev); |
| 86 | 86 | ||
| 87 | for (i = 0; i < MS5611_PROM_WORDS_NB; i++) { | 87 | for (i = 0; i < MS5611_PROM_WORDS_NB; i++) { |
| 88 | ret = st->read_prom_word(st, i, &st->chip_info->prom[i]); | 88 | ret = st->read_prom_word(st, i, &st->prom[i]); |
| 89 | if (ret < 0) { | 89 | if (ret < 0) { |
| 90 | dev_err(&indio_dev->dev, | 90 | dev_err(&indio_dev->dev, |
| 91 | "failed to read prom at %d\n", i); | 91 | "failed to read prom at %d\n", i); |
| @@ -93,7 +93,7 @@ static int ms5611_read_prom(struct iio_dev *indio_dev) · 1 unmodified line | |||
| 93 | } | 93 | } |
| 94 | } | 94 | } |
| 95 | 95 | ||
| 96 | if (!ms5611_prom_is_valid(st->chip_info->prom, MS5611_PROM_WORDS_NB)) { | 96 | if (!ms5611_prom_is_valid(st->prom, MS5611_PROM_WORDS_NB)) { |
| 97 | dev_err(&indio_dev->dev, "PROM integrity check failed\n"); | 97 | dev_err(&indio_dev->dev, "PROM integrity check failed\n"); |
| 98 | return -ENODEV; | 98 | return -ENODEV; |
| 99 | } | 99 | } |
| @@ -114,21 +114,20 @@ static int ms5611_read_temp_and_pressure(struct iio_dev *indio_dev, · 14 unmodified lines | |||
| 114 | return ret; | 114 | return ret; |
| 115 | } | 115 | } |
| 116 | 116 | ||
| 117 | return st->chip_info->temp_and_pressure_compensate(st->chip_info, | 117 | return st->compensate_temp_and_pressure(st, temp, pressure); |
| 118 | temp, pressure); | ||
| 119 | } | 118 | } |
| 120 | 119 | ||
| 121 | static int ms5611_temp_and_pressure_compensate(struct ms5611_chip_info *chip_info, | 120 | static int ms5611_temp_and_pressure_compensate(struct ms5611_state *st, |
| 122 | s32 *temp, s32 *pressure) | 121 | s32 *temp, s32 *pressure) |
| 123 | { | 122 | { |
| 124 | s32 t = *temp, p = *pressure; | 123 | s32 t = *temp, p = *pressure; |
| 125 | s64 off, sens, dt; | 124 | s64 off, sens, dt; |
| 126 | 125 | ||
| 127 | dt = t - (chip_info->prom[5] << 8); | 126 | dt = t - (st->prom[5] << 8); |
| 128 | off = ((s64)chip_info->prom[2] << 16) + ((chip_info->prom[4] * dt) >> 7); | 127 | off = ((s64)st->prom[2] << 16) + ((st->prom[4] * dt) >> 7); |
| 129 | sens = ((s64)chip_info->prom[1] << 15) + ((chip_info->prom[3] * dt) >> 8); | 128 | sens = ((s64)st->prom[1] << 15) + ((st->prom[3] * dt) >> 8); |
| 130 | 129 | ||
| 131 | t = 2000 + ((chip_info->prom[6] * dt) >> 23); | 130 | t = 2000 + ((st->prom[6] * dt) >> 23); |
| 132 | if (t < 2000) { | 131 | if (t < 2000) { |
| 133 | s64 off2, sens2, t2; | 132 | s64 off2, sens2, t2; |
| 134 | 133 | ||
| @@ -154,17 +153,17 @@ static int ms5611_temp_and_pressure_compensate(struct ms5611_chip_info *chip_inf · 19 unmodified lines | |||
| 154 | return 0; | 153 | return 0; |
| 155 | } | 154 | } |
| 156 | 155 | ||
| 157 | static int ms5607_temp_and_pressure_compensate(struct ms5611_chip_info *chip_info, | 156 | static int ms5607_temp_and_pressure_compensate(struct ms5611_state *st, |
| 158 | s32 *temp, s32 *pressure) | 157 | s32 *temp, s32 *pressure) |
| 159 | { | 158 | { |
| 160 | s32 t = *temp, p = *pressure; | 159 | s32 t = *temp, p = *pressure; |
| 161 | s64 off, sens, dt; | 160 | s64 off, sens, dt; |
| 162 | 161 | ||
| 163 | dt = t - (chip_info->prom[5] << 8); | 162 | dt = t - (st->prom[5] << 8); |
| 164 | off = ((s64)chip_info->prom[2] << 17) + ((chip_info->prom[4] * dt) >> 6); | 163 | off = ((s64)st->prom[2] << 17) + ((st->prom[4] * dt) >> 6); |
| 165 | sens = ((s64)chip_info->prom[1] << 16) + ((chip_info->prom[3] * dt) >> 7); | 164 | sens = ((s64)st->prom[1] << 16) + ((st->prom[3] * dt) >> 7); |
| 166 | 165 | ||
| 167 | t = 2000 + ((chip_info->prom[6] * dt) >> 23); | 166 | t = 2000 + ((st->prom[6] * dt) >> 23); |
| 168 | if (t < 2000) { | 167 | if (t < 2000) { |
| 169 | s64 off2, sens2, t2, tmp; | 168 | s64 off2, sens2, t2, tmp; |
| 170 | 169 | ||
| @@ -342,15 +341,6 @@ static int ms5611_write_raw(struct iio_dev *indio_dev, · 171 unmodified lines | |||
| 342 | 341 | ||
| 343 | static const unsigned long ms5611_scan_masks[] = {0x3, 0}; | 342 | static const unsigned long ms5611_scan_masks[] = {0x3, 0}; |
| 344 | 343 | ||
| 345 | static struct ms5611_chip_info chip_info_tbl[] = { | ||
| 346 | [MS5611] = { | ||
| 347 | .temp_and_pressure_compensate = ms5611_temp_and_pressure_compensate, | ||
| 348 | }, | ||
| 349 | [MS5607] = { | ||
| 350 | .temp_and_pressure_compensate = ms5607_temp_and_pressure_compensate, | ||
| 351 | } | ||
| 352 | }; | ||
| 353 | |||
| 354 | static const struct iio_chan_spec ms5611_channels[] = { | 344 | static const struct iio_chan_spec ms5611_channels[] = { |
| 355 | { | 345 | { |
| 356 | .type = IIO_PRESSURE, | 346 | .type = IIO_PRESSURE, |
| @@ -433,7 +423,20 @@ int ms5611_probe(struct iio_dev *indio_dev, struct device *dev, · 76 unmodified lines | |||
| 433 | struct ms5611_state *st = iio_priv(indio_dev); | 423 | struct ms5611_state *st = iio_priv(indio_dev); |
| 434 | 424 | ||
| 435 | mutex_init(&st->lock); | 425 | mutex_init(&st->lock); |
| 436 | st->chip_info = &chip_info_tbl[type]; | 426 | |
| 427 | switch (type) { | ||
| 428 | case MS5611: | ||
| 429 | st->compensate_temp_and_pressure = | ||
| 430 | ms5611_temp_and_pressure_compensate; | ||
| 431 | break; | ||
| 432 | case MS5607: | ||
| 433 | st->compensate_temp_and_pressure = | ||
| 434 | ms5607_temp_and_pressure_compensate; | ||
| 435 | break; | ||
| 436 | default: | ||
| 437 | return -EINVAL; | ||
| 438 | } | ||
| 439 | |||
| 437 | st->temp_osr = | 440 | st->temp_osr = |
| 438 | &ms5611_avail_temp_osr[ARRAY_SIZE(ms5611_avail_temp_osr) - 1]; | 441 | &ms5611_avail_temp_osr[ARRAY_SIZE(ms5611_avail_temp_osr) - 1]; |
| 439 | st->pressure_osr = | 442 | st->pressure_osr = |
| @@ -91,7 +91,7 @@ static int ms5611_spi_probe(struct spi_device *spi) · 90 unmodified lines | |||
| 91 | spi_set_drvdata(spi, indio_dev); | 91 | spi_set_drvdata(spi, indio_dev); |
| 92 | 92 | ||
| 93 | spi->mode = SPI_MODE_0; | 93 | spi->mode = SPI_MODE_0; |
| 94 | spi->max_speed_hz = 20000000; | 94 | spi->max_speed_hz = min(spi->max_speed_hz, 20000000U); |
| 95 | spi->bits_per_word = 8; | 95 | spi->bits_per_word = 8; |
| 96 | ret = spi_setup(spi); | 96 | ret = spi_setup(spi); |
| 97 | if (ret < 0) | 97 | if (ret < 0) |
| @@ -203,9 +203,13 @@ static int iio_sysfs_trigger_remove(int id) · 202 unmodified lines | |||
| 203 | 203 | ||
| 204 | static int __init iio_sysfs_trig_init(void) | 204 | static int __init iio_sysfs_trig_init(void) |
| 205 | { | 205 | { |
| 206 | int ret; | ||
| 206 | device_initialize(&iio_sysfs_trig_dev); | 207 | device_initialize(&iio_sysfs_trig_dev); |
| 207 | dev_set_name(&iio_sysfs_trig_dev, "iio_sysfs_trigger"); | 208 | dev_set_name(&iio_sysfs_trig_dev, "iio_sysfs_trigger"); |
| 208 | return device_add(&iio_sysfs_trig_dev); | 209 | ret = device_add(&iio_sysfs_trig_dev); |
| 210 | if (ret) | ||
| 211 | put_device(&iio_sysfs_trig_dev); | ||
| 212 | return ret; | ||
| 209 | } | 213 | } |
| 210 | module_init(iio_sysfs_trig_init); | 214 | module_init(iio_sysfs_trig_init); |
| 211 | 215 | ||
| @@ -273,22 +273,22 @@ int iforce_init_device(struct device *parent, u16 bustype, · 272 unmodified lines | |||
| 273 | * Get device info. | 273 | * Get device info. |
| 274 | */ | 274 | */ |
| 275 | 275 | ||
| 276 | if (!iforce_get_id_packet(iforce, 'M', buf, &len) || len < 3) | 276 | if (!iforce_get_id_packet(iforce, 'M', buf, &len) && len >= 3) |
| 277 | input_dev->id.vendor = get_unaligned_le16(buf + 1); | 277 | input_dev->id.vendor = get_unaligned_le16(buf + 1); |
| 278 | else | 278 | else |
| 279 | dev_warn(&iforce->dev->dev, "Device does not respond to id packet M\n"); | 279 | dev_warn(&iforce->dev->dev, "Device does not respond to id packet M\n"); |
| 280 | 280 | ||
| 281 | if (!iforce_get_id_packet(iforce, 'P', buf, &len) || len < 3) | 281 | if (!iforce_get_id_packet(iforce, 'P', buf, &len) && len >= 3) |
| 282 | input_dev->id.product = get_unaligned_le16(buf + 1); | 282 | input_dev->id.product = get_unaligned_le16(buf + 1); |
| 283 | else | 283 | else |
| 284 | dev_warn(&iforce->dev->dev, "Device does not respond to id packet P\n"); | 284 | dev_warn(&iforce->dev->dev, "Device does not respond to id packet P\n"); |
| 285 | 285 | ||
| 286 | if (!iforce_get_id_packet(iforce, 'B', buf, &len) || len < 3) | 286 | if (!iforce_get_id_packet(iforce, 'B', buf, &len) && len >= 3) |
| 287 | iforce->device_memory.end = get_unaligned_le16(buf + 1); | 287 | iforce->device_memory.end = get_unaligned_le16(buf + 1); |
| 288 | else | 288 | else |
| 289 | dev_warn(&iforce->dev->dev, "Device does not respond to id packet B\n"); | 289 | dev_warn(&iforce->dev->dev, "Device does not respond to id packet B\n"); |
| 290 | 290 | ||
| 291 | if (!iforce_get_id_packet(iforce, 'N', buf, &len) || len < 2) | 291 | if (!iforce_get_id_packet(iforce, 'N', buf, &len) && len >= 2) |
| 292 | ff_effects = buf[1]; | 292 | ff_effects = buf[1]; |
| 293 | else | 293 | else |
| 294 | dev_warn(&iforce->dev->dev, "Device does not respond to id packet N\n"); | 294 | dev_warn(&iforce->dev->dev, "Device does not respond to id packet N\n"); |
| @@ -18,6 +18,10 @@ · 17 unmodified lines | |||
| 18 | #include <linux/gpio.h> | 18 | #include <linux/gpio.h> |
| 19 | #include <linux/platform_device.h> | 19 | #include <linux/platform_device.h> |
| 20 | 20 | ||
| 21 | static bool use_low_level_irq; | ||
| 22 | module_param(use_low_level_irq, bool, 0444); | ||
| 23 | MODULE_PARM_DESC(use_low_level_irq, "Use low-level triggered IRQ instead of edge triggered"); | ||
| 24 | |||
| 21 | struct soc_button_info { | 25 | struct soc_button_info { |
| 22 | const char *name; | 26 | const char *name; |
| 23 | int acpi_index; | 27 | int acpi_index; |
| @@ -73,6 +77,13 @@ static const struct dmi_system_id dmi_use_low_level_irq[] = { · 49 unmodified lines | |||
| 73 | DMI_MATCH(DMI_PRODUCT_NAME, "Aspire SW5-012"), | 77 | DMI_MATCH(DMI_PRODUCT_NAME, "Aspire SW5-012"), |
| 74 | }, | 78 | }, |
| 75 | }, | 79 | }, |
| 80 | { | ||
| 81 | /* Acer Switch V 10 SW5-017, same issue as Acer Switch 10 SW5-012. */ | ||
| 82 | .matches = { | ||
| 83 | DMI_MATCH(DMI_SYS_VENDOR, "Acer"), | ||
| 84 | DMI_MATCH(DMI_PRODUCT_NAME, "SW5-017"), | ||
| 85 | }, | ||
| 86 | }, | ||
| 76 | { | 87 | { |
| 77 | /* | 88 | /* |
| 78 | * Acer One S1003. _LID method messes with power-button GPIO | 89 | * Acer One S1003. _LID method messes with power-button GPIO |
| @@ -164,7 +175,8 @@ soc_button_device_create(struct platform_device *pdev, · 85 unmodified lines | |||
| 164 | } | 175 | } |
| 165 | 176 | ||
| 166 | /* See dmi_use_low_level_irq[] comment */ | 177 | /* See dmi_use_low_level_irq[] comment */ |
| 167 | if (!autorepeat && dmi_check_system(dmi_use_low_level_irq)) { | 178 | if (!autorepeat && (use_low_level_irq || |
| 179 | dmi_check_system(dmi_use_low_level_irq))) { | ||
| 168 | irq_set_irq_type(irq, IRQ_TYPE_LEVEL_LOW); | 180 | irq_set_irq_type(irq, IRQ_TYPE_LEVEL_LOW); |
| 169 | gpio_keys[n_buttons].irq = irq; | 181 | gpio_keys[n_buttons].irq = irq; |
| 170 | gpio_keys[n_buttons].gpio = -ENOENT; | 182 | gpio_keys[n_buttons].gpio = -ENOENT; |
| @@ -192,6 +192,7 @@ static const char * const smbus_pnp_ids[] = { · 191 unmodified lines | |||
| 192 | "SYN3221", /* HP 15-ay000 */ | 192 | "SYN3221", /* HP 15-ay000 */ |
| 193 | "SYN323d", /* HP Spectre X360 13-w013dx */ | 193 | "SYN323d", /* HP Spectre X360 13-w013dx */ |
| 194 | "SYN3257", /* HP Envy 13-ad105ng */ | 194 | "SYN3257", /* HP Envy 13-ad105ng */ |
| 195 | "SYN3286", /* HP Laptop 15-da3001TU */ | ||
| 195 | NULL | 196 | NULL |
| 196 | }; | 197 | }; |
| 197 | 198 | ||
| @@ -115,18 +115,18 @@ static const struct dmi_system_id i8042_dmi_quirk_table[] __initconst = { · 114 unmodified lines | |||
| 115 | .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_NEVER) | 115 | .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_NEVER) |
| 116 | }, | 116 | }, |
| 117 | { | 117 | { |
| 118 | /* ASUS ZenBook UX425UA */ | 118 | /* ASUS ZenBook UX425UA/QA */ |
| 119 | .matches = { | 119 | .matches = { |
| 120 | DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), | 120 | DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), |
| 121 | DMI_MATCH(DMI_PRODUCT_NAME, "ZenBook UX425UA"), | 121 | DMI_MATCH(DMI_PRODUCT_NAME, "ZenBook UX425"), |
| 122 | }, | 122 | }, |
| 123 | .driver_data = (void *)(SERIO_QUIRK_PROBE_DEFER | SERIO_QUIRK_RESET_NEVER) | 123 | .driver_data = (void *)(SERIO_QUIRK_PROBE_DEFER | SERIO_QUIRK_RESET_NEVER) |
| 124 | }, | 124 | }, |
| 125 | { | 125 | { |
| 126 | /* ASUS ZenBook UM325UA */ | 126 | /* ASUS ZenBook UM325UA/QA */ |
| 127 | .matches = { | 127 | .matches = { |
| 128 | DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), | 128 | DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), |
| 129 | DMI_MATCH(DMI_PRODUCT_NAME, "ZenBook UX325UA_UM325UA"), | 129 | DMI_MATCH(DMI_PRODUCT_NAME, "ZenBook UX325"), |
| 130 | }, | 130 | }, |
| 131 | .driver_data = (void *)(SERIO_QUIRK_PROBE_DEFER | SERIO_QUIRK_RESET_NEVER) | 131 | .driver_data = (void *)(SERIO_QUIRK_PROBE_DEFER | SERIO_QUIRK_RESET_NEVER) |
| 132 | }, | 132 | }, |
| @@ -1543,8 +1543,6 @@ static int i8042_probe(struct platform_device *dev) · 1542 unmodified lines | |||
| 1543 | { | 1543 | { |
| 1544 | int error; | 1544 | int error; |
| 1545 | 1545 | ||
| 1546 | i8042_platform_device = dev; | ||
| 1547 | |||
| 1548 | if (i8042_reset == I8042_RESET_ALWAYS) { | 1546 | if (i8042_reset == I8042_RESET_ALWAYS) { |
| 1549 | error = i8042_controller_selftest(); | 1547 | error = i8042_controller_selftest(); |
| 1550 | if (error) | 1548 | if (error) |
| @@ -1582,7 +1580,6 @@ static int i8042_probe(struct platform_device *dev) · 31 unmodified lines | |||
| 1582 | i8042_free_aux_ports(); /* in case KBD failed but AUX not */ | 1580 | i8042_free_aux_ports(); /* in case KBD failed but AUX not */ |
| 1583 | i8042_free_irqs(); | 1581 | i8042_free_irqs(); |
| 1584 | i8042_controller_reset(false); | 1582 | i8042_controller_reset(false); |
| 1585 | i8042_platform_device = NULL; | ||
| 1586 | 1583 | ||
| 1587 | return error; | 1584 | return error; |
| 1588 | } | 1585 | } |
| @@ -1592,7 +1589,6 @@ static int i8042_remove(struct platform_device *dev) · 3 unmodified lines | |||
| 1592 | i8042_unregister_ports(); | 1589 | i8042_unregister_ports(); |
| 1593 | i8042_free_irqs(); | 1590 | i8042_free_irqs(); |
| 1594 | i8042_controller_reset(false); | 1591 | i8042_controller_reset(false); |
| 1595 | i8042_platform_device = NULL; | ||
| 1596 | 1592 | ||
| 1597 | return 0; | 1593 | return 0; |
| 1598 | } | 1594 | } |
| @@ -1158,6 +1158,7 @@ static int goodix_configure_dev(struct goodix_ts_data *ts) · 1157 unmodified lines | |||
| 1158 | input_set_abs_params(ts->input_dev, ABS_MT_WIDTH_MAJOR, 0, 255, 0, 0); | 1158 | input_set_abs_params(ts->input_dev, ABS_MT_WIDTH_MAJOR, 0, 255, 0, 0); |
| 1159 | input_set_abs_params(ts->input_dev, ABS_MT_TOUCH_MAJOR, 0, 255, 0, 0); | 1159 | input_set_abs_params(ts->input_dev, ABS_MT_TOUCH_MAJOR, 0, 255, 0, 0); |
| 1160 | 1160 | ||
| 1161 | retry_read_config: | ||
| 1161 | /* Read configuration and apply touchscreen parameters */ | 1162 | /* Read configuration and apply touchscreen parameters */ |
| 1162 | goodix_read_config(ts); | 1163 | goodix_read_config(ts); |
| 1163 | 1164 | ||
| @@ -1165,6 +1166,16 @@ static int goodix_configure_dev(struct goodix_ts_data *ts) · 1 unmodified line | |||
| 1165 | touchscreen_parse_properties(ts->input_dev, true, &ts->prop); | 1166 | touchscreen_parse_properties(ts->input_dev, true, &ts->prop); |
| 1166 | 1167 | ||
| 1167 | if (!ts->prop.max_x || !ts->prop.max_y || !ts->max_touch_num) { | 1168 | if (!ts->prop.max_x || !ts->prop.max_y || !ts->max_touch_num) { |
| 1169 | if (!ts->reset_controller_at_probe && | ||
| 1170 | ts->irq_pin_access_method != IRQ_PIN_ACCESS_NONE) { | ||
| 1171 | dev_info(&ts->client->dev, "Config not set, resetting controller\n"); | ||
| 1172 | /* Retry after a controller reset */ | ||
| 1173 | ts->reset_controller_at_probe = true; | ||
| 1174 | error = goodix_reset(ts); | ||
| 1175 | if (error) | ||
| 1176 | return error; | ||
| 1177 | goto retry_read_config; | ||
| 1178 | } | ||
| 1168 | dev_err(&ts->client->dev, | 1179 | dev_err(&ts->client->dev, |
| 1169 | "Invalid config (%d, %d, %d), using defaults\n", | 1180 | "Invalid config (%d, %d, %d), using defaults\n", |
| 1170 | ts->prop.max_x, ts->prop.max_y, ts->max_touch_num); | 1181 | ts->prop.max_x, ts->prop.max_y, ts->max_touch_num); |
| @@ -959,11 +959,9 @@ static struct dma_pte *pfn_to_dma_pte(struct dmar_domain *domain, · 958 unmodified lines | |||
| 959 | 959 | ||
| 960 | domain_flush_cache(domain, tmp_page, VTD_PAGE_SIZE); | 960 | domain_flush_cache(domain, tmp_page, VTD_PAGE_SIZE); |
| 961 | pteval = ((uint64_t)virt_to_dma_pfn(tmp_page) << VTD_PAGE_SHIFT) | DMA_PTE_READ | DMA_PTE_WRITE; | 961 | pteval = ((uint64_t)virt_to_dma_pfn(tmp_page) << VTD_PAGE_SHIFT) | DMA_PTE_READ | DMA_PTE_WRITE; |
| 962 | if (domain_use_first_level(domain)) { | 962 | if (domain_use_first_level(domain)) |
| 963 | pteval |= DMA_FL_PTE_XD | DMA_FL_PTE_US; | 963 | pteval |= DMA_FL_PTE_XD | DMA_FL_PTE_US | DMA_FL_PTE_ACCESS; |
| 964 | if (iommu_is_dma_domain(&domain->domain)) | 964 | |
| 965 | pteval |= DMA_FL_PTE_ACCESS; | ||
| 966 | } | ||
| 967 | if (cmpxchg64(&pte->val, 0ULL, pteval)) | 965 | if (cmpxchg64(&pte->val, 0ULL, pteval)) |
| 968 | /* Someone else set it while we were thinking; use theirs. */ | 966 | /* Someone else set it while we were thinking; use theirs. */ |
| 969 | free_pgtable_page(tmp_page); | 967 | free_pgtable_page(tmp_page); |
| @@ -642,7 +642,7 @@ int intel_pasid_setup_second_level(struct intel_iommu *iommu, · 641 unmodified lines | |||
| 642 | * Since it is a second level only translation setup, we should | 642 | * Since it is a second level only translation setup, we should |
| 643 | * set SRE bit as well (addresses are expected to be GPAs). | 643 | * set SRE bit as well (addresses are expected to be GPAs). |
| 644 | */ | 644 | */ |
| 645 | if (pasid != PASID_RID2PASID) | 645 | if (pasid != PASID_RID2PASID && ecap_srs(iommu->ecap)) |
| 646 | pasid_set_sre(pte); | 646 | pasid_set_sre(pte); |
| 647 | pasid_set_present(pte); | 647 | pasid_set_present(pte); |
| 648 | spin_unlock(&iommu->lock); | 648 | spin_unlock(&iommu->lock); |
| @@ -685,7 +685,8 @@ int intel_pasid_setup_pass_through(struct intel_iommu *iommu, · 36 unmodified lines | |||
| 685 | * We should set SRE bit as well since the addresses are expected | 685 | * We should set SRE bit as well since the addresses are expected |
| 686 | * to be GPAs. | 686 | * to be GPAs. |
| 687 | */ | 687 | */ |
| 688 | pasid_set_sre(pte); | 688 | if (ecap_srs(iommu->ecap)) |
| 689 | pasid_set_sre(pte); | ||
| 689 | pasid_set_present(pte); | 690 | pasid_set_present(pte); |
| 690 | spin_unlock(&iommu->lock); | 691 | spin_unlock(&iommu->lock); |
| 691 | 692 | ||
| @@ -222,7 +222,7 @@ mISDN_register_device(struct mISDNdevice *dev, · 221 unmodified lines | |||
| 222 | 222 | ||
| 223 | err = get_free_devid(); | 223 | err = get_free_devid(); |
| 224 | if (err < 0) | 224 | if (err < 0) |
| 225 | goto error1; | 225 | return err; |
| 226 | dev->id = err; | 226 | dev->id = err; |
| 227 | 227 | ||
| 228 | device_initialize(&dev->dev); | 228 | device_initialize(&dev->dev); |
| @@ -77,6 +77,7 @@ int mISDN_dsp_element_register(struct mISDN_dsp_element *elem) · 76 unmodified lines | |||
| 77 | if (!entry) | 77 | if (!entry) |
| 78 | return -ENOMEM; | 78 | return -ENOMEM; |
| 79 | 79 | ||
| 80 | INIT_LIST_HEAD(&entry->list); | ||
| 80 | entry->elem = elem; | 81 | entry->elem = elem; |
| 81 | 82 | ||
| 82 | entry->dev.class = elements_class; | 83 | entry->dev.class = elements_class; |
| @@ -107,7 +108,7 @@ err2: · 24 unmodified lines | |||
| 107 | device_unregister(&entry->dev); | 108 | device_unregister(&entry->dev); |
| 108 | return ret; | 109 | return ret; |
| 109 | err1: | 110 | err1: |
| 110 | kfree(entry); | 111 | put_device(&entry->dev); |
| 111 | return ret; | 112 | return ret; |
| 112 | } | 113 | } |
| 113 | EXPORT_SYMBOL(mISDN_dsp_element_register); | 114 | EXPORT_SYMBOL(mISDN_dsp_element_register); |
| @@ -1858,6 +1858,8 @@ bad: · 1857 unmodified lines | |||
| 1858 | dm_io_client_destroy(c->dm_io); | 1858 | dm_io_client_destroy(c->dm_io); |
| 1859 | bad_dm_io: | 1859 | bad_dm_io: |
| 1860 | mutex_destroy(&c->lock); | 1860 | mutex_destroy(&c->lock); |
| 1861 | if (c->no_sleep) | ||
| 1862 | static_branch_dec(&no_sleep_enabled); | ||
| 1861 | kfree(c); | 1863 | kfree(c); |
| 1862 | bad_client: | 1864 | bad_client: |
| 1863 | return ERR_PTR(r); | 1865 | return ERR_PTR(r); |
| @@ -3630,6 +3630,7 @@ static void crypt_io_hints(struct dm_target *ti, struct queue_limits *limits) · 3629 unmodified lines | |||
| 3630 | limits->physical_block_size = | 3630 | limits->physical_block_size = |
| 3631 | max_t(unsigned, limits->physical_block_size, cc->sector_size); | 3631 | max_t(unsigned, limits->physical_block_size, cc->sector_size); |
| 3632 | limits->io_min = max_t(unsigned, limits->io_min, cc->sector_size); | 3632 | limits->io_min = max_t(unsigned, limits->io_min, cc->sector_size); |
| 3633 | limits->dma_alignment = limits->logical_block_size - 1; | ||
| 3633 | } | 3634 | } |
| 3634 | 3635 | ||
| 3635 | static struct target_type crypt_target = { | 3636 | static struct target_type crypt_target = { |
| @@ -263,6 +263,7 @@ struct dm_integrity_c { · 262 unmodified lines | |||
| 263 | 263 | ||
| 264 | struct completion crypto_backoff; | 264 | struct completion crypto_backoff; |
| 265 | 265 | ||
| 266 | bool wrote_to_journal; | ||
| 266 | bool journal_uptodate; | 267 | bool journal_uptodate; |
| 267 | bool just_formatted; | 268 | bool just_formatted; |
| 268 | bool recalculate_flag; | 269 | bool recalculate_flag; |
| @@ -2375,6 +2376,8 @@ static void integrity_commit(struct work_struct *w) · 2106 unmodified lines | |||
| 2375 | if (!commit_sections) | 2376 | if (!commit_sections) |
| 2376 | goto release_flush_bios; | 2377 | goto release_flush_bios; |
| 2377 | 2378 | ||
| 2379 | ic->wrote_to_journal = true; | ||
| 2380 | |||
| 2378 | i = commit_start; | 2381 | i = commit_start; |
| 2379 | for (n = 0; n < commit_sections; n++) { | 2382 | for (n = 0; n < commit_sections; n++) { |
| 2380 | for (j = 0; j < ic->journal_section_entries; j++) { | 2383 | for (j = 0; j < ic->journal_section_entries; j++) { |
| @@ -2591,10 +2594,6 @@ static void integrity_writer(struct work_struct *w) · 210 unmodified lines | |||
| 2591 | 2594 | ||
| 2592 | unsigned prev_free_sectors; | 2595 | unsigned prev_free_sectors; |
| 2593 | 2596 | ||
| 2594 | /* the following test is not needed, but it tests the replay code */ | ||
| 2595 | if (unlikely(dm_post_suspending(ic->ti)) && !ic->meta_dev) | ||
| 2596 | return; | ||
| 2597 | |||
| 2598 | spin_lock_irq(&ic->endio_wait.lock); | 2597 | spin_lock_irq(&ic->endio_wait.lock); |
| 2599 | write_start = ic->committed_section; | 2598 | write_start = ic->committed_section; |
| 2600 | write_sections = ic->n_committed_sections; | 2599 | write_sections = ic->n_committed_sections; |
| @@ -3101,10 +3100,17 @@ static void dm_integrity_postsuspend(struct dm_target *ti) · 500 unmodified lines | |||
| 3101 | drain_workqueue(ic->commit_wq); | 3100 | drain_workqueue(ic->commit_wq); |
| 3102 | 3101 | ||
| 3103 | if (ic->mode == 'J') { | 3102 | if (ic->mode == 'J') { |
| 3104 | if (ic->meta_dev) | 3103 | queue_work(ic->writer_wq, &ic->writer_work); |
| 3105 | queue_work(ic->writer_wq, &ic->writer_work); | ||
| 3106 | drain_workqueue(ic->writer_wq); | 3104 | drain_workqueue(ic->writer_wq); |
| 3107 | dm_integrity_flush_buffers(ic, true); | 3105 | dm_integrity_flush_buffers(ic, true); |
| 3106 | if (ic->wrote_to_journal) { | ||
| 3107 | init_journal(ic, ic->free_section, | ||
| 3108 | ic->journal_sections - ic->free_section, ic->commit_seq); | ||
| 3109 | if (ic->free_section) { | ||
| 3110 | init_journal(ic, 0, ic->free_section, | ||
| 3111 | next_commit_seq(ic->commit_seq)); | ||
| 3112 | } | ||
| 3113 | } | ||
| 3108 | } | 3114 | } |
| 3109 | 3115 | ||
| 3110 | if (ic->mode == 'B') { | 3116 | if (ic->mode == 'B') { |
| @@ -3132,6 +3138,8 @@ static void dm_integrity_resume(struct dm_target *ti) · 21 unmodified lines | |||
| 3132 | 3138 | ||
| 3133 | DEBUG_print("resume\n"); | 3139 | DEBUG_print("resume\n"); |
| 3134 | 3140 | ||
| 3141 | ic->wrote_to_journal = false; | ||
| 3142 | |||
| 3135 | if (ic->provided_data_sectors != old_provided_data_sectors) { | 3143 | if (ic->provided_data_sectors != old_provided_data_sectors) { |
| 3136 | if (ic->provided_data_sectors > old_provided_data_sectors && | 3144 | if (ic->provided_data_sectors > old_provided_data_sectors && |
| 3137 | ic->mode == 'B' && | 3145 | ic->mode == 'B' && |
| @@ -3370,6 +3378,7 @@ static void dm_integrity_io_hints(struct dm_target *ti, struct queue_limits *lim · 232 unmodified lines | |||
| 3370 | limits->logical_block_size = ic->sectors_per_block << SECTOR_SHIFT; | 3378 | limits->logical_block_size = ic->sectors_per_block << SECTOR_SHIFT; |
| 3371 | limits->physical_block_size = ic->sectors_per_block << SECTOR_SHIFT; | 3379 | limits->physical_block_size = ic->sectors_per_block << SECTOR_SHIFT; |
| 3372 | blk_limits_io_min(limits, ic->sectors_per_block << SECTOR_SHIFT); | 3380 | blk_limits_io_min(limits, ic->sectors_per_block << SECTOR_SHIFT); |
| 3381 | limits->dma_alignment = limits->logical_block_size - 1; | ||
| 3373 | } | 3382 | } |
| 3374 | } | 3383 | } |
| 3375 | 3384 | ||
| @@ -655,7 +655,7 @@ static void list_version_get_needed(struct target_type *tt, void *needed_param) · 654 unmodified lines | |||
| 655 | size_t *needed = needed_param; | 655 | size_t *needed = needed_param; |
| 656 | 656 | ||
| 657 | *needed += sizeof(struct dm_target_versions); | 657 | *needed += sizeof(struct dm_target_versions); |
| 658 | *needed += strlen(tt->name); | 658 | *needed += strlen(tt->name) + 1; |
| 659 | *needed += ALIGN_MASK; | 659 | *needed += ALIGN_MASK; |
| 660 | } | 660 | } |
| 661 | 661 | ||
| @@ -720,7 +720,7 @@ static int __list_versions(struct dm_ioctl *param, size_t param_size, const char · 58 unmodified lines | |||
| 720 | iter_info.old_vers = NULL; | 720 | iter_info.old_vers = NULL; |
| 721 | iter_info.vers = vers; | 721 | iter_info.vers = vers; |
| 722 | iter_info.flags = 0; | 722 | iter_info.flags = 0; |
| 723 | iter_info.end = (char *)vers+len; | 723 | iter_info.end = (char *)vers + needed; |
| 724 | 724 | ||
| 725 | /* | 725 | /* |
| 726 | * Now loop through filling out the names & versions. | 726 | * Now loop through filling out the names & versions. |
| @@ -875,6 +875,7 @@ static void log_writes_io_hints(struct dm_target *ti, struct queue_limits *limit · 874 unmodified lines | |||
| 875 | limits->logical_block_size = bdev_logical_block_size(lc->dev->bdev); | 875 | limits->logical_block_size = bdev_logical_block_size(lc->dev->bdev); |
| 876 | limits->physical_block_size = bdev_physical_block_size(lc->dev->bdev); | 876 | limits->physical_block_size = bdev_physical_block_size(lc->dev->bdev); |
| 877 | limits->io_min = limits->physical_block_size; | 877 | limits->io_min = limits->physical_block_size; |
| 878 | limits->dma_alignment = limits->logical_block_size - 1; | ||
| 878 | } | 879 | } |
| 879 | 880 | ||
| 880 | #if IS_ENABLED(CONFIG_FS_DAX) | 881 | #if IS_ENABLED(CONFIG_FS_DAX) |
| @@ -854,6 +854,7 @@ static int qp_notify_peer_local(bool attach, struct vmci_handle handle) · 853 unmodified lines | |||
| 854 | u32 context_id = vmci_get_context_id(); | 854 | u32 context_id = vmci_get_context_id(); |
| 855 | struct vmci_event_qp ev; | 855 | struct vmci_event_qp ev; |
| 856 | 856 | ||
| 857 | memset(&ev, 0, sizeof(ev)); | ||
| 857 | ev.msg.hdr.dst = vmci_make_handle(context_id, VMCI_EVENT_HANDLER); | 858 | ev.msg.hdr.dst = vmci_make_handle(context_id, VMCI_EVENT_HANDLER); |
| 858 | ev.msg.hdr.src = vmci_make_handle(VMCI_HYPERVISOR_CONTEXT_ID, | 859 | ev.msg.hdr.src = vmci_make_handle(VMCI_HYPERVISOR_CONTEXT_ID, |
| 859 | VMCI_CONTEXT_RESOURCE_ID); | 860 | VMCI_CONTEXT_RESOURCE_ID); |
| @@ -1467,6 +1468,7 @@ static int qp_notify_peer(bool attach, · 607 unmodified lines | |||
| 1467 | * kernel. | 1468 | * kernel. |
| 1468 | */ | 1469 | */ |
| 1469 | 1470 | ||
| 1471 | memset(&ev, 0, sizeof(ev)); | ||
| 1470 | ev.msg.hdr.dst = vmci_make_handle(peer_id, VMCI_EVENT_HANDLER); | 1472 | ev.msg.hdr.dst = vmci_make_handle(peer_id, VMCI_EVENT_HANDLER); |
| 1471 | ev.msg.hdr.src = vmci_make_handle(VMCI_HYPERVISOR_CONTEXT_ID, | 1473 | ev.msg.hdr.src = vmci_make_handle(VMCI_HYPERVISOR_CONTEXT_ID, |
| 1472 | VMCI_CONTEXT_RESOURCE_ID); | 1474 | VMCI_CONTEXT_RESOURCE_ID); |
| @@ -1134,7 +1134,13 @@ u32 mmc_select_voltage(struct mmc_host *host, u32 ocr) · 1133 unmodified lines | |||
| 1134 | mmc_power_cycle(host, ocr); | 1134 | mmc_power_cycle(host, ocr); |
| 1135 | } else { | 1135 | } else { |
| 1136 | bit = fls(ocr) - 1; | 1136 | bit = fls(ocr) - 1; |
| 1137 | ocr &= 3 << bit; | 1137 | /* |
| 1138 | * The bit variable represents the highest voltage bit set in | ||
| 1139 | * the OCR register. | ||
| 1140 | * To keep a range of 2 values (e.g. 3.2V/3.3V and 3.3V/3.4V), | ||
| 1141 | * we must shift the mask '3' with (bit - 1). | ||
| 1142 | */ | ||
| 1143 | ocr &= 3 << (bit - 1); | ||
| 1138 | if (bit != host->ios.vdd) | 1144 | if (bit != host->ios.vdd) |
| 1139 | dev_warn(mmc_dev(host), "exceeding card's volts\n"); | 1145 | dev_warn(mmc_dev(host), "exceeding card's volts\n"); |
| 1140 | } | 1146 | } |
| @@ -1749,6 +1749,8 @@ static int amd_probe(struct sdhci_pci_chip *chip) · 1748 unmodified lines | |||
| 1749 | } | 1749 | } |
| 1750 | } | 1750 | } |
| 1751 | 1751 | ||
| 1752 | pci_dev_put(smbus_dev); | ||
| 1753 | |||
| 1752 | if (gen == AMD_CHIPSET_BEFORE_ML || gen == AMD_CHIPSET_CZ) | 1754 | if (gen == AMD_CHIPSET_BEFORE_ML || gen == AMD_CHIPSET_CZ) |
| 1753 | chip->quirks2 |= SDHCI_QUIRK2_CLEAR_TRANSFERMODE_REG_BEFORE_CMD; | 1755 | chip->quirks2 |= SDHCI_QUIRK2_CLEAR_TRANSFERMODE_REG_BEFORE_CMD; |
| 1754 | 1756 | ||
| @@ -32,6 +32,7 @@ · 31 unmodified lines | |||
| 32 | #define O2_SD_CAPS 0xE0 | 32 | #define O2_SD_CAPS 0xE0 |
| 33 | #define O2_SD_ADMA1 0xE2 | 33 | #define O2_SD_ADMA1 0xE2 |
| 34 | #define O2_SD_ADMA2 0xE7 | 34 | #define O2_SD_ADMA2 0xE7 |
| 35 | #define O2_SD_MISC_CTRL2 0xF0 | ||
| 35 | #define O2_SD_INF_MOD 0xF1 | 36 | #define O2_SD_INF_MOD 0xF1 |
| 36 | #define O2_SD_MISC_CTRL4 0xFC | 37 | #define O2_SD_MISC_CTRL4 0xFC |
| 37 | #define O2_SD_MISC_CTRL 0x1C0 | 38 | #define O2_SD_MISC_CTRL 0x1C0 |
| @@ -877,6 +878,12 @@ static int sdhci_pci_o2_probe(struct sdhci_pci_chip *chip) · 839 unmodified lines | |||
| 877 | /* Set Tuning Windows to 5 */ | 878 | /* Set Tuning Windows to 5 */ |
| 878 | pci_write_config_byte(chip->pdev, | 879 | pci_write_config_byte(chip->pdev, |
| 879 | O2_SD_TUNING_CTRL, 0x55); | 880 | O2_SD_TUNING_CTRL, 0x55); |
| 881 | //Adjust 1st and 2nd CD debounce time | ||
| 882 | pci_read_config_dword(chip->pdev, O2_SD_MISC_CTRL2, &scratch_32); | ||
| 883 | scratch_32 &= 0xFFE7FFFF; | ||
| 884 | scratch_32 |= 0x00180000; | ||
| 885 | pci_write_config_dword(chip->pdev, O2_SD_MISC_CTRL2, scratch_32); | ||
| 886 | pci_write_config_dword(chip->pdev, O2_SD_DETECT_SETTING, 1); | ||
| 880 | /* Lock WP */ | 887 | /* Lock WP */ |
| 881 | ret = pci_read_config_byte(chip->pdev, | 888 | ret = pci_read_config_byte(chip->pdev, |
| 882 | O2_SD_LOCK_WP, &scratch); | 889 | O2_SD_LOCK_WP, &scratch); |
| @@ -26,6 +26,7 @@ config MTD_ONENAND_OMAP2 · 25 unmodified lines | |||
| 26 | tristate "OneNAND on OMAP2/OMAP3 support" | 26 | tristate "OneNAND on OMAP2/OMAP3 support" |
| 27 | depends on ARCH_OMAP2 || ARCH_OMAP3 || (COMPILE_TEST && ARM) | 27 | depends on ARCH_OMAP2 || ARCH_OMAP3 || (COMPILE_TEST && ARM) |
| 28 | depends on OF || COMPILE_TEST | 28 | depends on OF || COMPILE_TEST |
| 29 | depends on OMAP_GPMC | ||
| 29 | help | 30 | help |
| 30 | Support for a OneNAND flash device connected to an OMAP2/OMAP3 SoC | 31 | Support for a OneNAND flash device connected to an OMAP2/OMAP3 SoC |
| 31 | via the GPMC memory controller. | 32 | via the GPMC memory controller. |
| @@ -5834,7 +5834,7 @@ nand_match_ecc_req(struct nand_chip *chip, · 5833 unmodified lines | |||
| 5834 | int req_step = requirements->step_size; | 5834 | int req_step = requirements->step_size; |
| 5835 | int req_strength = requirements->strength; | 5835 | int req_strength = requirements->strength; |
| 5836 | int req_corr, step_size, strength, nsteps, ecc_bytes, ecc_bytes_total; | 5836 | int req_corr, step_size, strength, nsteps, ecc_bytes, ecc_bytes_total; |
| 5837 | int best_step, best_strength, best_ecc_bytes; | 5837 | int best_step = 0, best_strength = 0, best_ecc_bytes = 0; |
| 5838 | int best_ecc_bytes_total = INT_MAX; | 5838 | int best_ecc_bytes_total = INT_MAX; |
| 5839 | int i, j; | 5839 | int i, j; |
| 5840 | 5840 | ||
| @@ -5915,7 +5915,7 @@ nand_maximize_ecc(struct nand_chip *chip, · 74 unmodified lines | |||
| 5915 | int step_size, strength, nsteps, ecc_bytes, corr; | 5915 | int step_size, strength, nsteps, ecc_bytes, corr; |
| 5916 | int best_corr = 0; | 5916 | int best_corr = 0; |
| 5917 | int best_step = 0; | 5917 | int best_step = 0; |
| 5918 | int best_strength, best_ecc_bytes; | 5918 | int best_strength = 0, best_ecc_bytes = 0; |
| 5919 | int i, j; | 5919 | int i, j; |
| 5920 | 5920 | ||
| 5921 | for (i = 0; i < caps->nstepinfos; i++) { | 5921 | for (i = 0; i < caps->nstepinfos; i++) { |
| @@ -3167,16 +3167,18 @@ static int qcom_nand_host_init_and_register(struct qcom_nand_controller *nandc, · 3166 unmodified lines | |||
| 3167 | 3167 | ||
| 3168 | ret = mtd_device_parse_register(mtd, probes, NULL, NULL, 0); | 3168 | ret = mtd_device_parse_register(mtd, probes, NULL, NULL, 0); |
| 3169 | if (ret) | 3169 | if (ret) |
| 3170 | nand_cleanup(chip); | 3170 | goto err; |
| 3171 | 3171 | ||
| 3172 | if (nandc->props->use_codeword_fixup) { | 3172 | if (nandc->props->use_codeword_fixup) { |
| 3173 | ret = qcom_nand_host_parse_boot_partitions(nandc, host, dn); | 3173 | ret = qcom_nand_host_parse_boot_partitions(nandc, host, dn); |
| 3174 | if (ret) { | 3174 | if (ret) |
| 3175 | nand_cleanup(chip); | 3175 | goto err; |
| 3176 | return ret; | ||
| 3177 | } | ||
| 3178 | } | 3176 | } |
| 3179 | 3177 | ||
| 3178 | return 0; | ||
| 3179 | |||
| 3180 | err: | ||
| 3181 | nand_cleanup(chip); | ||
| 3180 | return ret; | 3182 | return ret; |
| 3181 | } | 3183 | } |
| 3182 | 3184 | ||
| @@ -4543,13 +4543,19 @@ static struct pci_driver ena_pci_driver = { · 4542 unmodified lines | |||
| 4543 | 4543 | ||
| 4544 | static int __init ena_init(void) | 4544 | static int __init ena_init(void) |
| 4545 | { | 4545 | { |
| 4546 | int ret; | ||
| 4547 | |||
| 4546 | ena_wq = create_singlethread_workqueue(DRV_MODULE_NAME); | 4548 | ena_wq = create_singlethread_workqueue(DRV_MODULE_NAME); |
| 4547 | if (!ena_wq) { | 4549 | if (!ena_wq) { |
| 4548 | pr_err("Failed to create workqueue\n"); | 4550 | pr_err("Failed to create workqueue\n"); |
| 4549 | return -ENOMEM; | 4551 | return -ENOMEM; |
| 4550 | } | 4552 | } |
| 4551 | 4553 | ||
| 4552 | return pci_register_driver(&ena_pci_driver); | 4554 | ret = pci_register_driver(&ena_pci_driver); |
| 4555 | if (ret) | ||
| 4556 | destroy_workqueue(ena_wq); | ||
| 4557 | |||
| 4558 | return ret; | ||
| 4553 | } | 4559 | } |
| 4554 | 4560 | ||
| 4555 | static void __exit ena_cleanup(void) | 4561 | static void __exit ena_cleanup(void) |
| @@ -1427,7 +1427,7 @@ static int ag71xx_open(struct net_device *ndev) · 1426 unmodified lines | |||
| 1427 | if (ret) { | 1427 | if (ret) { |
| 1428 | netif_err(ag, link, ndev, "phylink_of_phy_connect filed with err: %i\n", | 1428 | netif_err(ag, link, ndev, "phylink_of_phy_connect filed with err: %i\n", |
| 1429 | ret); | 1429 | ret); |
| 1430 | goto err; | 1430 | return ret; |
| 1431 | } | 1431 | } |
| 1432 | 1432 | ||
| 1433 | max_frame_len = ag71xx_max_frame_len(ndev->mtu); | 1433 | max_frame_len = ag71xx_max_frame_len(ndev->mtu); |
| @@ -1448,6 +1448,7 @@ static int ag71xx_open(struct net_device *ndev) · 14 unmodified lines | |||
| 1448 | 1448 | ||
| 1449 | err: | 1449 | err: |
| 1450 | ag71xx_rings_cleanup(ag); | 1450 | ag71xx_rings_cleanup(ag); |
| 1451 | phylink_disconnect_phy(ag->phylink); | ||
| 1451 | return ret; | 1452 | return ret; |
| 1452 | } | 1453 | } |
| 1453 | 1454 | ||
| @@ -1568,7 +1568,6 @@ void bgmac_enet_remove(struct bgmac *bgmac) · 1567 unmodified lines | |||
| 1568 | phy_disconnect(bgmac->net_dev->phydev); | 1568 | phy_disconnect(bgmac->net_dev->phydev); |
| 1569 | netif_napi_del(&bgmac->napi); | 1569 | netif_napi_del(&bgmac->napi); |
| 1570 | bgmac_dma_free(bgmac); | 1570 | bgmac_dma_free(bgmac); |
| 1571 | free_netdev(bgmac->net_dev); | ||
| 1572 | } | 1571 | } |
| 1573 | EXPORT_SYMBOL_GPL(bgmac_enet_remove); | 1572 | EXPORT_SYMBOL_GPL(bgmac_enet_remove); |
| 1574 | 1573 | ||
| @@ -14037,8 +14037,16 @@ static struct pci_driver bnxt_pci_driver = { · 14036 unmodified lines | |||
| 14037 | 14037 | ||
| 14038 | static int __init bnxt_init(void) | 14038 | static int __init bnxt_init(void) |
| 14039 | { | 14039 | { |
| 14040 | int err; | ||
| 14041 | |||
| 14040 | bnxt_debug_init(); | 14042 | bnxt_debug_init(); |
| 14041 | return pci_register_driver(&bnxt_pci_driver); | 14043 | err = pci_register_driver(&bnxt_pci_driver); |
| 14044 | if (err) { | ||
| 14045 | bnxt_debug_exit(); | ||
| 14046 | return err; | ||
| 14047 | } | ||
| 14048 | |||
| 14049 | return 0; | ||
| 14042 | } | 14050 | } |
| 14043 | 14051 | ||
| 14044 | static void __exit bnxt_exit(void) | 14052 | static void __exit bnxt_exit(void) |
| @@ -1794,13 +1794,10 @@ static int liquidio_open(struct net_device *netdev) · 1793 unmodified lines | |||
| 1794 | 1794 | ||
| 1795 | ifstate_set(lio, LIO_IFSTATE_RUNNING); | 1795 | ifstate_set(lio, LIO_IFSTATE_RUNNING); |
| 1796 | 1796 | ||
| 1797 | if (OCTEON_CN23XX_PF(oct)) { | 1797 | if (!OCTEON_CN23XX_PF(oct) || (OCTEON_CN23XX_PF(oct) && !oct->msix_on)) { |
| 1798 | if (!oct->msix_on) | 1798 | ret = setup_tx_poll_fn(netdev); |
| 1799 | if (setup_tx_poll_fn(netdev)) | 1799 | if (ret) |
| 1800 | return -1; | 1800 | goto err_poll; |
| 1801 | } else { | ||
| 1802 | if (setup_tx_poll_fn(netdev)) | ||
| 1803 | return -1; | ||
| 1804 | } | 1801 | } |
| 1805 | 1802 | ||
| 1806 | netif_tx_start_all_queues(netdev); | 1803 | netif_tx_start_all_queues(netdev); |
| @@ -1813,7 +1810,7 @@ static int liquidio_open(struct net_device *netdev) · 6 unmodified lines | |||
| 1813 | /* tell Octeon to start forwarding packets to host */ | 1810 | /* tell Octeon to start forwarding packets to host */ |
| 1814 | ret = send_rx_ctrl_cmd(lio, 1); | 1811 | ret = send_rx_ctrl_cmd(lio, 1); |
| 1815 | if (ret) | 1812 | if (ret) |
| 1816 | return ret; | 1813 | goto err_rx_ctrl; |
| 1817 | 1814 | ||
| 1818 | /* start periodical statistics fetch */ | 1815 | /* start periodical statistics fetch */ |
| 1819 | INIT_DELAYED_WORK(&lio->stats_wk.work, lio_fetch_stats); | 1816 | INIT_DELAYED_WORK(&lio->stats_wk.work, lio_fetch_stats); |
| @@ -1824,6 +1821,27 @@ static int liquidio_open(struct net_device *netdev) · 4 unmodified lines | |||
| 1824 | dev_info(&oct->pci_dev->dev, "%s interface is opened\n", | 1821 | dev_info(&oct->pci_dev->dev, "%s interface is opened\n", |
| 1825 | netdev->name); | 1822 | netdev->name); |
| 1826 | 1823 | ||
| 1824 | return 0; | ||
| 1825 | |||
| 1826 | err_rx_ctrl: | ||
| 1827 | if (!OCTEON_CN23XX_PF(oct) || (OCTEON_CN23XX_PF(oct) && !oct->msix_on)) | ||
| 1828 | cleanup_tx_poll_fn(netdev); | ||
| 1829 | err_poll: | ||
| 1830 | if (lio->ptp_clock) { | ||
| 1831 | ptp_clock_unregister(lio->ptp_clock); | ||
| 1832 | lio->ptp_clock = NULL; | ||
| 1833 | } | ||
| 1834 | |||
| 1835 | if (oct->props[lio->ifidx].napi_enabled == 1) { | ||
| 1836 | list_for_each_entry_safe(napi, n, &netdev->napi_list, dev_list) | ||
| 1837 | napi_disable(napi); | ||
| 1838 | |||
| 1839 | oct->props[lio->ifidx].napi_enabled = 0; | ||
| 1840 | |||
| 1841 | if (OCTEON_CN23XX_PF(oct)) | ||
| 1842 | oct->droq[0]->ops.poll_mode = 0; | ||
| 1843 | } | ||
| 1844 | |||
| 1827 | return ret; | 1845 | return ret; |
| 1828 | } | 1846 | } |
| 1829 | 1847 | ||
| @@ -819,7 +819,6 @@ struct hnae3_knic_private_info { · 818 unmodified lines | |||
| 819 | const struct hnae3_dcb_ops *dcb_ops; | 819 | const struct hnae3_dcb_ops *dcb_ops; |
| 820 | 820 | ||
| 821 | u16 int_rl_setting; | 821 | u16 int_rl_setting; |
| 822 | enum pkt_hash_types rss_type; | ||
| 823 | void __iomem *io_base; | 822 | void __iomem *io_base; |
| 824 | }; | 823 | }; |
| 825 | 824 | ||
| @@ -191,23 +191,6 @@ u32 hclge_comm_get_rss_key_size(struct hnae3_handle *handle) · 190 unmodified lines | |||
| 191 | return HCLGE_COMM_RSS_KEY_SIZE; | 191 | return HCLGE_COMM_RSS_KEY_SIZE; |
| 192 | } | 192 | } |
| 193 | 193 | ||
| 194 | void hclge_comm_get_rss_type(struct hnae3_handle *nic, | ||
| 195 | struct hclge_comm_rss_tuple_cfg *rss_tuple_sets) | ||
| 196 | { | ||
| 197 | if (rss_tuple_sets->ipv4_tcp_en || | ||
| 198 | rss_tuple_sets->ipv4_udp_en || | ||
| 199 | rss_tuple_sets->ipv4_sctp_en || | ||
| 200 | rss_tuple_sets->ipv6_tcp_en || | ||
| 201 | rss_tuple_sets->ipv6_udp_en || | ||
| 202 | rss_tuple_sets->ipv6_sctp_en) | ||
| 203 | nic->kinfo.rss_type = PKT_HASH_TYPE_L4; | ||
| 204 | else if (rss_tuple_sets->ipv4_fragment_en || | ||
| 205 | rss_tuple_sets->ipv6_fragment_en) | ||
| 206 | nic->kinfo.rss_type = PKT_HASH_TYPE_L3; | ||
| 207 | else | ||
| 208 | nic->kinfo.rss_type = PKT_HASH_TYPE_NONE; | ||
| 209 | } | ||
| 210 | |||
| 211 | int hclge_comm_parse_rss_hfunc(struct hclge_comm_rss_cfg *rss_cfg, | 194 | int hclge_comm_parse_rss_hfunc(struct hclge_comm_rss_cfg *rss_cfg, |
| 212 | const u8 hfunc, u8 *hash_algo) | 195 | const u8 hfunc, u8 *hash_algo) |
| 213 | { | 196 | { |
| @@ -344,9 +327,6 @@ int hclge_comm_set_rss_input_tuple(struct hnae3_handle *nic, · 130 unmodified lines | |||
| 344 | req->ipv6_sctp_en = rss_cfg->rss_tuple_sets.ipv6_sctp_en; | 327 | req->ipv6_sctp_en = rss_cfg->rss_tuple_sets.ipv6_sctp_en; |
| 345 | req->ipv6_fragment_en = rss_cfg->rss_tuple_sets.ipv6_fragment_en; | 328 | req->ipv6_fragment_en = rss_cfg->rss_tuple_sets.ipv6_fragment_en; |
| 346 | 329 | ||
| 347 | if (is_pf) | ||
| 348 | hclge_comm_get_rss_type(nic, &rss_cfg->rss_tuple_sets); | ||
| 349 | |||
| 350 | ret = hclge_comm_cmd_send(hw, &desc, 1); | 330 | ret = hclge_comm_cmd_send(hw, &desc, 1); |
| 351 | if (ret) | 331 | if (ret) |
| 352 | dev_err(&hw->cmq.csq.pdev->dev, | 332 | dev_err(&hw->cmq.csq.pdev->dev, |
| @@ -95,8 +95,6 @@ struct hclge_comm_rss_tc_mode_cmd { · 94 unmodified lines | |||
| 95 | }; | 95 | }; |
| 96 | 96 | ||
| 97 | u32 hclge_comm_get_rss_key_size(struct hnae3_handle *handle); | 97 | u32 hclge_comm_get_rss_key_size(struct hnae3_handle *handle); |
| 98 | void hclge_comm_get_rss_type(struct hnae3_handle *nic, | ||
| 99 | struct hclge_comm_rss_tuple_cfg *rss_tuple_sets); | ||
| 100 | void hclge_comm_rss_indir_init_cfg(struct hnae3_ae_dev *ae_dev, | 98 | void hclge_comm_rss_indir_init_cfg(struct hnae3_ae_dev *ae_dev, |
| 101 | struct hclge_comm_rss_cfg *rss_cfg); | 99 | struct hclge_comm_rss_cfg *rss_cfg); |
| 102 | int hclge_comm_get_rss_tuple(struct hclge_comm_rss_cfg *rss_cfg, int flow_type, | 100 | int hclge_comm_get_rss_tuple(struct hclge_comm_rss_cfg *rss_cfg, int flow_type, |
| @@ -105,26 +105,28 @@ static const struct pci_device_id hns3_pci_tbl[] = { · 104 unmodified lines | |||
| 105 | }; | 105 | }; |
| 106 | MODULE_DEVICE_TABLE(pci, hns3_pci_tbl); | 106 | MODULE_DEVICE_TABLE(pci, hns3_pci_tbl); |
| 107 | 107 | ||
| 108 | #define HNS3_RX_PTYPE_ENTRY(ptype, l, s, t) \ | 108 | #define HNS3_RX_PTYPE_ENTRY(ptype, l, s, t, h) \ |
| 109 | { ptype, \ | 109 | { ptype, \ |
| 110 | l, \ | 110 | l, \ |
| 111 | CHECKSUM_##s, \ | 111 | CHECKSUM_##s, \ |
| 112 | HNS3_L3_TYPE_##t, \ | 112 | HNS3_L3_TYPE_##t, \ |
| 113 | 1 } | 113 | 1, \ |
| 114 | h} | ||
| 114 | 115 | ||
| 115 | #define HNS3_RX_PTYPE_UNUSED_ENTRY(ptype) \ | 116 | #define HNS3_RX_PTYPE_UNUSED_ENTRY(ptype) \ |
| 116 | { ptype, 0, CHECKSUM_NONE, HNS3_L3_TYPE_PARSE_FAIL, 0 } | 117 | { ptype, 0, CHECKSUM_NONE, HNS3_L3_TYPE_PARSE_FAIL, 0, \ |
| 118 | PKT_HASH_TYPE_NONE } | ||
| 117 | 119 | ||
| 118 | static const struct hns3_rx_ptype hns3_rx_ptype_tbl[] = { | 120 | static const struct hns3_rx_ptype hns3_rx_ptype_tbl[] = { |
| 119 | HNS3_RX_PTYPE_UNUSED_ENTRY(0), | 121 | HNS3_RX_PTYPE_UNUSED_ENTRY(0), |
| 120 | HNS3_RX_PTYPE_ENTRY(1, 0, COMPLETE, ARP), | 122 | HNS3_RX_PTYPE_ENTRY(1, 0, COMPLETE, ARP, PKT_HASH_TYPE_NONE), |
| 121 | HNS3_RX_PTYPE_ENTRY(2, 0, COMPLETE, RARP), | 123 | HNS3_RX_PTYPE_ENTRY(2, 0, COMPLETE, RARP, PKT_HASH_TYPE_NONE), |
| 122 | HNS3_RX_PTYPE_ENTRY(3, 0, COMPLETE, LLDP), | 124 | HNS3_RX_PTYPE_ENTRY(3, 0, COMPLETE, LLDP, PKT_HASH_TYPE_NONE), |
| 123 | HNS3_RX_PTYPE_ENTRY(4, 0, COMPLETE, PARSE_FAIL), | 125 | HNS3_RX_PTYPE_ENTRY(4, 0, COMPLETE, PARSE_FAIL, PKT_HASH_TYPE_NONE), |
| 124 | HNS3_RX_PTYPE_ENTRY(5, 0, COMPLETE, PARSE_FAIL), | 126 | HNS3_RX_PTYPE_ENTRY(5, 0, COMPLETE, PARSE_FAIL, PKT_HASH_TYPE_NONE), |
| 125 | HNS3_RX_PTYPE_ENTRY(6, 0, COMPLETE, PARSE_FAIL), | 127 | HNS3_RX_PTYPE_ENTRY(6, 0, COMPLETE, PARSE_FAIL, PKT_HASH_TYPE_NONE), |
| 126 | HNS3_RX_PTYPE_ENTRY(7, 0, COMPLETE, CNM), | 128 | HNS3_RX_PTYPE_ENTRY(7, 0, COMPLETE, CNM, PKT_HASH_TYPE_NONE), |
| 127 | HNS3_RX_PTYPE_ENTRY(8, 0, NONE, PARSE_FAIL), | 129 | HNS3_RX_PTYPE_ENTRY(8, 0, NONE, PARSE_FAIL, PKT_HASH_TYPE_NONE), |
| 128 | HNS3_RX_PTYPE_UNUSED_ENTRY(9), | 130 | HNS3_RX_PTYPE_UNUSED_ENTRY(9), |
| 129 | HNS3_RX_PTYPE_UNUSED_ENTRY(10), | 131 | HNS3_RX_PTYPE_UNUSED_ENTRY(10), |
| 130 | HNS3_RX_PTYPE_UNUSED_ENTRY(11), | 132 | HNS3_RX_PTYPE_UNUSED_ENTRY(11), |
| @@ -132,36 +134,36 @@ static const struct hns3_rx_ptype hns3_rx_ptype_tbl[] = { · 1 unmodified line | |||
| 132 | HNS3_RX_PTYPE_UNUSED_ENTRY(13), | 134 | HNS3_RX_PTYPE_UNUSED_ENTRY(13), |
| 133 | HNS3_RX_PTYPE_UNUSED_ENTRY(14), | 135 | HNS3_RX_PTYPE_UNUSED_ENTRY(14), |
| 134 | HNS3_RX_PTYPE_UNUSED_ENTRY(15), | 136 | HNS3_RX_PTYPE_UNUSED_ENTRY(15), |
| 135 | HNS3_RX_PTYPE_ENTRY(16, 0, COMPLETE, PARSE_FAIL), | 137 | HNS3_RX_PTYPE_ENTRY(16, 0, COMPLETE, PARSE_FAIL, PKT_HASH_TYPE_NONE), |
| 136 | HNS3_RX_PTYPE_ENTRY(17, 0, COMPLETE, IPV4), | 138 | HNS3_RX_PTYPE_ENTRY(17, 0, COMPLETE, IPV4, PKT_HASH_TYPE_NONE), |
| 137 | HNS3_RX_PTYPE_ENTRY(18, 0, COMPLETE, IPV4), | 139 | HNS3_RX_PTYPE_ENTRY(18, 0, COMPLETE, IPV4, PKT_HASH_TYPE_NONE), |
| 138 | HNS3_RX_PTYPE_ENTRY(19, 0, UNNECESSARY, IPV4), | 140 | HNS3_RX_PTYPE_ENTRY(19, 0, UNNECESSARY, IPV4, PKT_HASH_TYPE_L4), |
| 139 | HNS3_RX_PTYPE_ENTRY(20, 0, UNNECESSARY, IPV4), | 141 | HNS3_RX_PTYPE_ENTRY(20, 0, UNNECESSARY, IPV4, PKT_HASH_TYPE_L4), |
| 140 | HNS3_RX_PTYPE_ENTRY(21, 0, NONE, IPV4), | 142 | HNS3_RX_PTYPE_ENTRY(21, 0, NONE, IPV4, PKT_HASH_TYPE_NONE), |
| 141 | HNS3_RX_PTYPE_ENTRY(22, 0, UNNECESSARY, IPV4), | 143 | HNS3_RX_PTYPE_ENTRY(22, 0, UNNECESSARY, IPV4, PKT_HASH_TYPE_L4), |
| 142 | HNS3_RX_PTYPE_ENTRY(23, 0, NONE, IPV4), | 144 | HNS3_RX_PTYPE_ENTRY(23, 0, NONE, IPV4, PKT_HASH_TYPE_L3), |
| 143 | HNS3_RX_PTYPE_ENTRY(24, 0, NONE, IPV4), | 145 | HNS3_RX_PTYPE_ENTRY(24, 0, NONE, IPV4, PKT_HASH_TYPE_L3), |
| 144 | HNS3_RX_PTYPE_ENTRY(25, 0, UNNECESSARY, IPV4), | 146 | HNS3_RX_PTYPE_ENTRY(25, 0, UNNECESSARY, IPV4, PKT_HASH_TYPE_L4), |
| 145 | HNS3_RX_PTYPE_UNUSED_ENTRY(26), | 147 | HNS3_RX_PTYPE_UNUSED_ENTRY(26), |
| 146 | HNS3_RX_PTYPE_UNUSED_ENTRY(27), | 148 | HNS3_RX_PTYPE_UNUSED_ENTRY(27), |
| 147 | HNS3_RX_PTYPE_UNUSED_ENTRY(28), | 149 | HNS3_RX_PTYPE_UNUSED_ENTRY(28), |
| 148 | HNS3_RX_PTYPE_ENTRY(29, 0, COMPLETE, PARSE_FAIL), | 150 | HNS3_RX_PTYPE_ENTRY(29, 0, COMPLETE, PARSE_FAIL, PKT_HASH_TYPE_NONE), |
| 149 | HNS3_RX_PTYPE_ENTRY(30, 0, COMPLETE, PARSE_FAIL), | 151 | HNS3_RX_PTYPE_ENTRY(30, 0, COMPLETE, PARSE_FAIL, PKT_HASH_TYPE_NONE), |
| 150 | HNS3_RX_PTYPE_ENTRY(31, 0, COMPLETE, IPV4), | 152 | HNS3_RX_PTYPE_ENTRY(31, 0, COMPLETE, IPV4, PKT_HASH_TYPE_L3), |
| 151 | HNS3_RX_PTYPE_ENTRY(32, 0, COMPLETE, IPV4), | 153 | HNS3_RX_PTYPE_ENTRY(32, 0, COMPLETE, IPV4, PKT_HASH_TYPE_L3), |
| 152 | HNS3_RX_PTYPE_ENTRY(33, 1, UNNECESSARY, IPV4), | 154 | HNS3_RX_PTYPE_ENTRY(33, 1, UNNECESSARY, IPV4, PKT_HASH_TYPE_L4), |
| 153 | HNS3_RX_PTYPE_ENTRY(34, 1, UNNECESSARY, IPV4), | 155 | HNS3_RX_PTYPE_ENTRY(34, 1, UNNECESSARY, IPV4, PKT_HASH_TYPE_L4), |
| 154 | HNS3_RX_PTYPE_ENTRY(35, 1, UNNECESSARY, IPV4), | 156 | HNS3_RX_PTYPE_ENTRY(35, 1, UNNECESSARY, IPV4, PKT_HASH_TYPE_L4), |
| 155 | HNS3_RX_PTYPE_ENTRY(36, 0, COMPLETE, IPV4), | 157 | HNS3_RX_PTYPE_ENTRY(36, 0, COMPLETE, IPV4, PKT_HASH_TYPE_L3), |
| 156 | HNS3_RX_PTYPE_ENTRY(37, 0, COMPLETE, IPV4), | 158 | HNS3_RX_PTYPE_ENTRY(37, 0, COMPLETE, IPV4, PKT_HASH_TYPE_L3), |
| 157 | HNS3_RX_PTYPE_UNUSED_ENTRY(38), | 159 | HNS3_RX_PTYPE_UNUSED_ENTRY(38), |
| 158 | HNS3_RX_PTYPE_ENTRY(39, 0, COMPLETE, IPV6), | 160 | HNS3_RX_PTYPE_ENTRY(39, 0, COMPLETE, IPV6, PKT_HASH_TYPE_L3), |
| 159 | HNS3_RX_PTYPE_ENTRY(40, 0, COMPLETE, IPV6), | 161 | HNS3_RX_PTYPE_ENTRY(40, 0, COMPLETE, IPV6, PKT_HASH_TYPE_L3), |
| 160 | HNS3_RX_PTYPE_ENTRY(41, 1, UNNECESSARY, IPV6), | 162 | HNS3_RX_PTYPE_ENTRY(41, 1, UNNECESSARY, IPV6, PKT_HASH_TYPE_L4), |
| 161 | HNS3_RX_PTYPE_ENTRY(42, 1, UNNECESSARY, IPV6), | 163 | HNS3_RX_PTYPE_ENTRY(42, 1, UNNECESSARY, IPV6, PKT_HASH_TYPE_L4), |
| 162 | HNS3_RX_PTYPE_ENTRY(43, 1, UNNECESSARY, IPV6), | 164 | HNS3_RX_PTYPE_ENTRY(43, 1, UNNECESSARY, IPV6, PKT_HASH_TYPE_L4), |
| 163 | HNS3_RX_PTYPE_ENTRY(44, 0, COMPLETE, IPV6), | 165 | HNS3_RX_PTYPE_ENTRY(44, 0, COMPLETE, IPV6, PKT_HASH_TYPE_L3), |
| 164 | HNS3_RX_PTYPE_ENTRY(45, 0, COMPLETE, IPV6), | 166 | HNS3_RX_PTYPE_ENTRY(45, 0, COMPLETE, IPV6, PKT_HASH_TYPE_L3), |
| 165 | HNS3_RX_PTYPE_UNUSED_ENTRY(46), | 167 | HNS3_RX_PTYPE_UNUSED_ENTRY(46), |
| 166 | HNS3_RX_PTYPE_UNUSED_ENTRY(47), | 168 | HNS3_RX_PTYPE_UNUSED_ENTRY(47), |
| 167 | HNS3_RX_PTYPE_UNUSED_ENTRY(48), | 169 | HNS3_RX_PTYPE_UNUSED_ENTRY(48), |
| @@ -227,35 +229,35 @@ static const struct hns3_rx_ptype hns3_rx_ptype_tbl[] = { · 59 unmodified lines | |||
| 227 | HNS3_RX_PTYPE_UNUSED_ENTRY(108), | 229 | HNS3_RX_PTYPE_UNUSED_ENTRY(108), |
| 228 | HNS3_RX_PTYPE_UNUSED_ENTRY(109), | 230 | HNS3_RX_PTYPE_UNUSED_ENTRY(109), |
| 229 | HNS3_RX_PTYPE_UNUSED_ENTRY(110), | 231 | HNS3_RX_PTYPE_UNUSED_ENTRY(110), |
| 230 | HNS3_RX_PTYPE_ENTRY(111, 0, COMPLETE, IPV6), | 232 | HNS3_RX_PTYPE_ENTRY(111, 0, COMPLETE, IPV6, PKT_HASH_TYPE_L3), |
| 231 | HNS3_RX_PTYPE_ENTRY(112, 0, COMPLETE, IPV6), | 233 | HNS3_RX_PTYPE_ENTRY(112, 0, COMPLETE, IPV6, PKT_HASH_TYPE_L3), |
| 232 | HNS3_RX_PTYPE_ENTRY(113, 0, UNNECESSARY, IPV6), | 234 | HNS3_RX_PTYPE_ENTRY(113, 0, UNNECESSARY, IPV6, PKT_HASH_TYPE_L4), |
| 233 | HNS3_RX_PTYPE_ENTRY(114, 0, UNNECESSARY, IPV6), | 235 | HNS3_RX_PTYPE_ENTRY(114, 0, UNNECESSARY, IPV6, PKT_HASH_TYPE_L4), |
| 234 | HNS3_RX_PTYPE_ENTRY(115, 0, NONE, IPV6), | 236 | HNS3_RX_PTYPE_ENTRY(115, 0, NONE, IPV6, PKT_HASH_TYPE_L3), |
| 235 | HNS3_RX_PTYPE_ENTRY(116, 0, UNNECESSARY, IPV6), | 237 | HNS3_RX_PTYPE_ENTRY(116, 0, UNNECESSARY, IPV6, PKT_HASH_TYPE_L4), |
| 236 | HNS3_RX_PTYPE_ENTRY(117, 0, NONE, IPV6), | 238 | HNS3_RX_PTYPE_ENTRY(117, 0, NONE, IPV6, PKT_HASH_TYPE_L3), |
| 237 | HNS3_RX_PTYPE_ENTRY(118, 0, NONE, IPV6), | 239 | HNS3_RX_PTYPE_ENTRY(118, 0, NONE, IPV6, PKT_HASH_TYPE_L3), |
| 238 | HNS3_RX_PTYPE_ENTRY(119, 0, UNNECESSARY, IPV6), | 240 | HNS3_RX_PTYPE_ENTRY(119, 0, UNNECESSARY, IPV6, PKT_HASH_TYPE_L4), |
| 239 | HNS3_RX_PTYPE_UNUSED_ENTRY(120), | 241 | HNS3_RX_PTYPE_UNUSED_ENTRY(120), |
| 240 | HNS3_RX_PTYPE_UNUSED_ENTRY(121), | 242 | HNS3_RX_PTYPE_UNUSED_ENTRY(121), |
| 241 | HNS3_RX_PTYPE_UNUSED_ENTRY(122), | 243 | HNS3_RX_PTYPE_UNUSED_ENTRY(122), |
| 242 | HNS3_RX_PTYPE_ENTRY(123, 0, COMPLETE, PARSE_FAIL), | 244 | HNS3_RX_PTYPE_ENTRY(123, 0, COMPLETE, PARSE_FAIL, PKT_HASH_TYPE_NONE), |
| 243 | HNS3_RX_PTYPE_ENTRY(124, 0, COMPLETE, PARSE_FAIL), | 245 | HNS3_RX_PTYPE_ENTRY(124, 0, COMPLETE, PARSE_FAIL, PKT_HASH_TYPE_NONE), |
| 244 | HNS3_RX_PTYPE_ENTRY(125, 0, COMPLETE, IPV4), | 246 | HNS3_RX_PTYPE_ENTRY(125, 0, COMPLETE, IPV4, PKT_HASH_TYPE_L3), |
| 245 | HNS3_RX_PTYPE_ENTRY(126, 0, COMPLETE, IPV4), | 247 | HNS3_RX_PTYPE_ENTRY(126, 0, COMPLETE, IPV4, PKT_HASH_TYPE_L3), |
| 246 | HNS3_RX_PTYPE_ENTRY(127, 1, UNNECESSARY, IPV4), | 248 | HNS3_RX_PTYPE_ENTRY(127, 1, UNNECESSARY, IPV4, PKT_HASH_TYPE_L4), |
| 247 | HNS3_RX_PTYPE_ENTRY(128, 1, UNNECESSARY, IPV4), | 249 | HNS3_RX_PTYPE_ENTRY(128, 1, UNNECESSARY, IPV4, PKT_HASH_TYPE_L4), |
| 248 | HNS3_RX_PTYPE_ENTRY(129, 1, UNNECESSARY, IPV4), | 250 | HNS3_RX_PTYPE_ENTRY(129, 1, UNNECESSARY, IPV4, PKT_HASH_TYPE_L4), |
| 249 | HNS3_RX_PTYPE_ENTRY(130, 0, COMPLETE, IPV4), | 251 | HNS3_RX_PTYPE_ENTRY(130, 0, COMPLETE, IPV4, PKT_HASH_TYPE_L3), |
| 250 | HNS3_RX_PTYPE_ENTRY(131, 0, COMPLETE, IPV4), | 252 | HNS3_RX_PTYPE_ENTRY(131, 0, COMPLETE, IPV4, PKT_HASH_TYPE_L3), |
| 251 | HNS3_RX_PTYPE_UNUSED_ENTRY(132), | 253 | HNS3_RX_PTYPE_UNUSED_ENTRY(132), |
| 252 | HNS3_RX_PTYPE_ENTRY(133, 0, COMPLETE, IPV6), | 254 | HNS3_RX_PTYPE_ENTRY(133, 0, COMPLETE, IPV6, PKT_HASH_TYPE_L3), |
| 253 | HNS3_RX_PTYPE_ENTRY(134, 0, COMPLETE, IPV6), | 255 | HNS3_RX_PTYPE_ENTRY(134, 0, COMPLETE, IPV6, PKT_HASH_TYPE_L3), |
| 254 | HNS3_RX_PTYPE_ENTRY(135, 1, UNNECESSARY, IPV6), | 256 | HNS3_RX_PTYPE_ENTRY(135, 1, UNNECESSARY, IPV6, PKT_HASH_TYPE_L4), |
| 255 | HNS3_RX_PTYPE_ENTRY(136, 1, UNNECESSARY, IPV6), | 257 | HNS3_RX_PTYPE_ENTRY(136, 1, UNNECESSARY, IPV6, PKT_HASH_TYPE_L4), |
| 256 | HNS3_RX_PTYPE_ENTRY(137, 1, UNNECESSARY, IPV6), | 258 | HNS3_RX_PTYPE_ENTRY(137, 1, UNNECESSARY, IPV6, PKT_HASH_TYPE_L4), |
| 257 | HNS3_RX_PTYPE_ENTRY(138, 0, COMPLETE, IPV6), | 259 | HNS3_RX_PTYPE_ENTRY(138, 0, COMPLETE, IPV6, PKT_HASH_TYPE_L3), |
| 258 | HNS3_RX_PTYPE_ENTRY(139, 0, COMPLETE, IPV6), | 260 | HNS3_RX_PTYPE_ENTRY(139, 0, COMPLETE, IPV6, PKT_HASH_TYPE_L3), |
| 259 | HNS3_RX_PTYPE_UNUSED_ENTRY(140), | 261 | HNS3_RX_PTYPE_UNUSED_ENTRY(140), |
| 260 | HNS3_RX_PTYPE_UNUSED_ENTRY(141), | 262 | HNS3_RX_PTYPE_UNUSED_ENTRY(141), |
| 261 | HNS3_RX_PTYPE_UNUSED_ENTRY(142), | 263 | HNS3_RX_PTYPE_UNUSED_ENTRY(142), |
| @@ -3776,8 +3778,8 @@ static void hns3_nic_reuse_page(struct sk_buff *skb, int i, · 3514 unmodified lines | |||
| 3776 | desc_cb->reuse_flag = 1; | 3778 | desc_cb->reuse_flag = 1; |
| 3777 | } else if (frag_size <= ring->rx_copybreak) { | 3779 | } else if (frag_size <= ring->rx_copybreak) { |
| 3778 | ret = hns3_handle_rx_copybreak(skb, i, ring, pull_len, desc_cb); | 3780 | ret = hns3_handle_rx_copybreak(skb, i, ring, pull_len, desc_cb); |
| 3779 | if (ret) | 3781 | if (!ret) |
| 3780 | goto out; | 3782 | return; |
| 3781 | } | 3783 | } |
| 3782 | 3784 | ||
| 3783 | out: | 3785 | out: |
| @@ -4171,15 +4173,35 @@ static int hns3_set_gro_and_checksum(struct hns3_enet_ring *ring, · 387 unmodified lines | |||
| 4171 | } | 4173 | } |
| 4172 | 4174 | ||
| 4173 | static void hns3_set_rx_skb_rss_type(struct hns3_enet_ring *ring, | 4175 | static void hns3_set_rx_skb_rss_type(struct hns3_enet_ring *ring, |
| 4174 | struct sk_buff *skb, u32 rss_hash) | 4176 | struct sk_buff *skb, u32 rss_hash, |
| 4177 | u32 l234info, u32 ol_info) | ||
| 4175 | { | 4178 | { |
| 4176 | struct hnae3_handle *handle = ring->tqp->handle; | 4179 | enum pkt_hash_types rss_type = PKT_HASH_TYPE_NONE; |
| 4177 | enum pkt_hash_types rss_type; | 4180 | struct net_device *netdev = ring_to_netdev(ring); |
| 4181 | struct hns3_nic_priv *priv = netdev_priv(netdev); | ||
| 4178 | 4182 | ||
| 4179 | if (rss_hash) | 4183 | if (test_bit(HNS3_NIC_STATE_RXD_ADV_LAYOUT_ENABLE, &priv->state)) { |
| 4180 | rss_type = handle->kinfo.rss_type; | 4184 | u32 ptype = hnae3_get_field(ol_info, HNS3_RXD_PTYPE_M, |
| 4181 | else | 4185 | HNS3_RXD_PTYPE_S); |
| 4182 | rss_type = PKT_HASH_TYPE_NONE; | 4186 | |
| 4187 | rss_type = hns3_rx_ptype_tbl[ptype].hash_type; | ||
| 4188 | } else { | ||
| 4189 | int l3_type = hnae3_get_field(l234info, HNS3_RXD_L3ID_M, | ||
| 4190 | HNS3_RXD_L3ID_S); | ||
| 4191 | int l4_type = hnae3_get_field(l234info, HNS3_RXD_L4ID_M, | ||
| 4192 | HNS3_RXD_L4ID_S); | ||
| 4193 | |||
| 4194 | if (l3_type == HNS3_L3_TYPE_IPV4 || | ||
| 4195 | l3_type == HNS3_L3_TYPE_IPV6) { | ||
| 4196 | if (l4_type == HNS3_L4_TYPE_UDP || | ||
| 4197 | l4_type == HNS3_L4_TYPE_TCP || | ||
| 4198 | l4_type == HNS3_L4_TYPE_SCTP) | ||
| 4199 | rss_type = PKT_HASH_TYPE_L4; | ||
| 4200 | else if (l4_type == HNS3_L4_TYPE_IGMP || | ||
| 4201 | l4_type == HNS3_L4_TYPE_ICMP) | ||
| 4202 | rss_type = PKT_HASH_TYPE_L3; | ||
| 4203 | } | ||
| 4204 | } | ||
| 4183 | 4205 | ||
| 4184 | skb_set_hash(skb, rss_hash, rss_type); | 4206 | skb_set_hash(skb, rss_hash, rss_type); |
| 4185 | } | 4207 | } |
| @@ -4282,7 +4304,8 @@ static int hns3_handle_bdinfo(struct hns3_enet_ring *ring, struct sk_buff *skb) · 96 unmodified lines | |||
| 4282 | 4304 | ||
| 4283 | ring->tqp_vector->rx_group.total_bytes += len; | 4305 | ring->tqp_vector->rx_group.total_bytes += len; |
| 4284 | 4306 | ||
| 4285 | hns3_set_rx_skb_rss_type(ring, skb, le32_to_cpu(desc->rx.rss_hash)); | 4307 | hns3_set_rx_skb_rss_type(ring, skb, le32_to_cpu(desc->rx.rss_hash), |
| 4308 | l234info, ol_info); | ||
| 4286 | return 0; | 4309 | return 0; |
| 4287 | } | 4310 | } |
| 4288 | 4311 | ||
| @@ -404,6 +404,7 @@ struct hns3_rx_ptype { · 403 unmodified lines | |||
| 404 | u32 ip_summed : 2; | 404 | u32 ip_summed : 2; |
| 405 | u32 l3_type : 4; | 405 | u32 l3_type : 4; |
| 406 | u32 valid : 1; | 406 | u32 valid : 1; |
| 407 | u32 hash_type: 3; | ||
| 407 | }; | 408 | }; |
| 408 | 409 | ||
| 409 | struct ring_stats { | 410 | struct ring_stats { |
| @@ -3443,6 +3443,7 @@ static int hclge_update_tp_port_info(struct hclge_dev *hdev) · 3442 unmodified lines | |||
| 3443 | hdev->hw.mac.autoneg = cmd.base.autoneg; | 3443 | hdev->hw.mac.autoneg = cmd.base.autoneg; |
| 3444 | hdev->hw.mac.speed = cmd.base.speed; | 3444 | hdev->hw.mac.speed = cmd.base.speed; |
| 3445 | hdev->hw.mac.duplex = cmd.base.duplex; | 3445 | hdev->hw.mac.duplex = cmd.base.duplex; |
| 3446 | linkmode_copy(hdev->hw.mac.advertising, cmd.link_modes.advertising); | ||
| 3446 | 3447 | ||
| 3447 | return 0; | 3448 | return 0; |
| 3448 | } | 3449 | } |
| @@ -4859,7 +4860,6 @@ static int hclge_set_rss_tuple(struct hnae3_handle *handle, · 1410 unmodified lines | |||
| 4859 | return ret; | 4860 | return ret; |
| 4860 | } | 4861 | } |
| 4861 | 4862 | ||
| 4862 | hclge_comm_get_rss_type(&vport->nic, &hdev->rss_cfg.rss_tuple_sets); | ||
| 4863 | return 0; | 4863 | return 0; |
| 4864 | } | 4864 | } |
| 4865 | 4865 | ||
| @@ -11587,9 +11587,12 @@ static int hclge_init_ae_dev(struct hnae3_ae_dev *ae_dev) · 6721 unmodified lines | |||
| 11587 | if (ret) | 11587 | if (ret) |
| 11588 | goto err_msi_irq_uninit; | 11588 | goto err_msi_irq_uninit; |
| 11589 | 11589 | ||
| 11590 | if (hdev->hw.mac.media_type == HNAE3_MEDIA_TYPE_COPPER && | 11590 | if (hdev->hw.mac.media_type == HNAE3_MEDIA_TYPE_COPPER) { |
| 11591 | !hnae3_dev_phy_imp_supported(hdev)) { | 11591 | if (hnae3_dev_phy_imp_supported(hdev)) |
| 11592 | ret = hclge_mac_mdio_config(hdev); | 11592 | ret = hclge_update_tp_port_info(hdev); |
| 11593 | else | ||
| 11594 | ret = hclge_mac_mdio_config(hdev); | ||
| 11595 | |||
| 11593 | if (ret) | 11596 | if (ret) |
| 11594 | goto err_msi_irq_uninit; | 11597 | goto err_msi_irq_uninit; |
| 11595 | } | 11598 | } |
| @@ -1474,8 +1474,15 @@ static struct pci_driver hinic_driver = { · 1473 unmodified lines | |||
| 1474 | 1474 | ||
| 1475 | static int __init hinic_module_init(void) | 1475 | static int __init hinic_module_init(void) |
| 1476 | { | 1476 | { |
| 1477 | int ret; | ||
| 1478 | |||
| 1477 | hinic_dbg_register_debugfs(HINIC_DRV_NAME); | 1479 | hinic_dbg_register_debugfs(HINIC_DRV_NAME); |
| 1478 | return pci_register_driver(&hinic_driver); | 1480 | |
| 1481 | ret = pci_register_driver(&hinic_driver); | ||
| 1482 | if (ret) | ||
| 1483 | hinic_dbg_unregister_debugfs(); | ||
| 1484 | |||
| 1485 | return ret; | ||
| 1479 | } | 1486 | } |
| 1480 | 1487 | ||
| 1481 | static void __exit hinic_module_exit(void) | 1488 | static void __exit hinic_module_exit(void) |
| @@ -521,14 +521,12 @@ static int octep_open(struct net_device *netdev) · 520 unmodified lines | |||
| 521 | octep_oq_dbell_init(oct); | 521 | octep_oq_dbell_init(oct); |
| 522 | 522 | ||
| 523 | ret = octep_get_link_status(oct); | 523 | ret = octep_get_link_status(oct); |
| 524 | if (ret) | 524 | if (ret > 0) |
| 525 | octep_link_up(netdev); | 525 | octep_link_up(netdev); |
| 526 | 526 | ||
| 527 | return 0; | 527 | return 0; |
| 528 | 528 | ||
| 529 | set_queues_err: | 529 | set_queues_err: |
| 530 | octep_napi_disable(oct); | ||
| 531 | octep_napi_delete(oct); | ||
| 532 | octep_clean_irqs(oct); | 530 | octep_clean_irqs(oct); |
| 533 | setup_irq_err: | 531 | setup_irq_err: |
| 534 | octep_free_oqs(oct); | 532 | octep_free_oqs(oct); |
| @@ -958,7 +956,7 @@ int octep_device_setup(struct octep_device *oct) · 423 unmodified lines | |||
| 958 | ret = octep_ctrl_mbox_init(ctrl_mbox); | 956 | ret = octep_ctrl_mbox_init(ctrl_mbox); |
| 959 | if (ret) { | 957 | if (ret) { |
| 960 | dev_err(&pdev->dev, "Failed to initialize control mbox\n"); | 958 | dev_err(&pdev->dev, "Failed to initialize control mbox\n"); |
| 961 | return -1; | 959 | goto unsupported_dev; |
| 962 | } | 960 | } |
| 963 | oct->ctrl_mbox_ifstats_offset = OCTEP_CTRL_MBOX_SZ(ctrl_mbox->h2fq.elem_sz, | 961 | oct->ctrl_mbox_ifstats_offset = OCTEP_CTRL_MBOX_SZ(ctrl_mbox->h2fq.elem_sz, |
| 964 | ctrl_mbox->h2fq.elem_cnt, | 962 | ctrl_mbox->h2fq.elem_cnt, |
| @@ -968,6 +966,10 @@ int octep_device_setup(struct octep_device *oct) · 3 unmodified lines | |||
| 968 | return 0; | 966 | return 0; |
| 969 | 967 | ||
| 970 | unsupported_dev: | 968 | unsupported_dev: |
| 969 | for (i = 0; i < OCTEP_MMIO_REGIONS; i++) | ||
| 970 | iounmap(oct->mmio[i].hw_addr); | ||
| 971 | |||
| 972 | kfree(oct->conf); | ||
| 971 | return -1; | 973 | return -1; |
| 972 | } | 974 | } |
| 973 | 975 | ||
| @@ -1070,7 +1072,11 @@ static int octep_probe(struct pci_dev *pdev, const struct pci_device_id *ent) · 96 unmodified lines | |||
| 1070 | netdev->max_mtu = OCTEP_MAX_MTU; | 1072 | netdev->max_mtu = OCTEP_MAX_MTU; |
| 1071 | netdev->mtu = OCTEP_DEFAULT_MTU; | 1073 | netdev->mtu = OCTEP_DEFAULT_MTU; |
| 1072 | 1074 | ||
| 1073 | octep_get_mac_addr(octep_dev, octep_dev->mac_addr); | 1075 | err = octep_get_mac_addr(octep_dev, octep_dev->mac_addr); |
| 1076 | if (err) { | ||
| 1077 | dev_err(&pdev->dev, "Failed to get mac address\n"); | ||
| 1078 | goto register_dev_err; | ||
| 1079 | } | ||
| 1074 | eth_hw_addr_set(netdev, octep_dev->mac_addr); | 1080 | eth_hw_addr_set(netdev, octep_dev->mac_addr); |
| 1075 | 1081 | ||
| 1076 | err = register_netdev(netdev); | 1082 | err = register_netdev(netdev); |
| @@ -3470,6 +3470,8 @@ mlxsw_sp_switchdev_vxlan_fdb_del(struct mlxsw_sp *mlxsw_sp, · 3469 unmodified lines | |||
| 3470 | u16 vid; | 3470 | u16 vid; |
| 3471 | 3471 | ||
| 3472 | vxlan_fdb_info = &switchdev_work->vxlan_fdb_info; | 3472 | vxlan_fdb_info = &switchdev_work->vxlan_fdb_info; |
| 3473 | if (!vxlan_fdb_info->offloaded) | ||
| 3474 | return; | ||
| 3473 | 3475 | ||
| 3474 | bridge_device = mlxsw_sp_bridge_device_find(mlxsw_sp->bridge, br_dev); | 3476 | bridge_device = mlxsw_sp_bridge_device_find(mlxsw_sp->bridge, br_dev); |
| 3475 | if (!bridge_device) | 3477 | if (!bridge_device) |
| @@ -716,6 +716,9 @@ int lan966x_stats_init(struct lan966x *lan966x) · 715 unmodified lines | |||
| 716 | snprintf(queue_name, sizeof(queue_name), "%s-stats", | 716 | snprintf(queue_name, sizeof(queue_name), "%s-stats", |
| 717 | dev_name(lan966x->dev)); | 717 | dev_name(lan966x->dev)); |
| 718 | lan966x->stats_queue = create_singlethread_workqueue(queue_name); | 718 | lan966x->stats_queue = create_singlethread_workqueue(queue_name); |
| 719 | if (!lan966x->stats_queue) | ||
| 720 | return -ENOMEM; | ||
| 721 | |||
| 719 | INIT_DELAYED_WORK(&lan966x->stats_work, lan966x_check_stats_work); | 722 | INIT_DELAYED_WORK(&lan966x->stats_work, lan966x_check_stats_work); |
| 720 | queue_delayed_work(lan966x->stats_queue, &lan966x->stats_work, | 723 | queue_delayed_work(lan966x->stats_queue, &lan966x->stats_work, |
| 721 | LAN966X_STATS_CHECK_DELAY); | 724 | LAN966X_STATS_CHECK_DELAY); |
| @@ -1253,6 +1253,9 @@ int sparx_stats_init(struct sparx5 *sparx5) · 1252 unmodified lines | |||
| 1253 | snprintf(queue_name, sizeof(queue_name), "%s-stats", | 1253 | snprintf(queue_name, sizeof(queue_name), "%s-stats", |
| 1254 | dev_name(sparx5->dev)); | 1254 | dev_name(sparx5->dev)); |
| 1255 | sparx5->stats_queue = create_singlethread_workqueue(queue_name); | 1255 | sparx5->stats_queue = create_singlethread_workqueue(queue_name); |
| 1256 | if (!sparx5->stats_queue) | ||
| 1257 | return -ENOMEM; | ||
| 1258 | |||
| 1256 | INIT_DELAYED_WORK(&sparx5->stats_work, sparx5_check_stats_work); | 1259 | INIT_DELAYED_WORK(&sparx5->stats_work, sparx5_check_stats_work); |
| 1257 | queue_delayed_work(sparx5->stats_queue, &sparx5->stats_work, | 1260 | queue_delayed_work(sparx5->stats_queue, &sparx5->stats_work, |
| 1258 | SPX5_STATS_CHECK_DELAY); | 1261 | SPX5_STATS_CHECK_DELAY); |
| @@ -659,6 +659,9 @@ static int sparx5_start(struct sparx5 *sparx5) · 658 unmodified lines | |||
| 659 | snprintf(queue_name, sizeof(queue_name), "%s-mact", | 659 | snprintf(queue_name, sizeof(queue_name), "%s-mact", |
| 660 | dev_name(sparx5->dev)); | 660 | dev_name(sparx5->dev)); |
| 661 | sparx5->mact_queue = create_singlethread_workqueue(queue_name); | 661 | sparx5->mact_queue = create_singlethread_workqueue(queue_name); |
| 662 | if (!sparx5->mact_queue) | ||
| 663 | return -ENOMEM; | ||
| 664 | |||
| 662 | INIT_DELAYED_WORK(&sparx5->mact_work, sparx5_mact_pull_work); | 665 | INIT_DELAYED_WORK(&sparx5->mact_work, sparx5_mact_pull_work); |
| 663 | queue_delayed_work(sparx5->mact_queue, &sparx5->mact_work, | 666 | queue_delayed_work(sparx5->mact_queue, &sparx5->mact_work, |
| 664 | SPX5_MACT_PULL_DELAY); | 667 | SPX5_MACT_PULL_DELAY); |
| @@ -1477,15 +1477,15 @@ nfp_port_get_module_info(struct net_device *netdev, · 1476 unmodified lines | |||
| 1477 | 1477 | ||
| 1478 | if (data < 0x3) { | 1478 | if (data < 0x3) { |
| 1479 | modinfo->type = ETH_MODULE_SFF_8436; | 1479 | modinfo->type = ETH_MODULE_SFF_8436; |
| 1480 | modinfo->eeprom_len = ETH_MODULE_SFF_8436_LEN; | 1480 | modinfo->eeprom_len = ETH_MODULE_SFF_8436_MAX_LEN; |
| 1481 | } else { | 1481 | } else { |
| 1482 | modinfo->type = ETH_MODULE_SFF_8636; | 1482 | modinfo->type = ETH_MODULE_SFF_8636; |
| 1483 | modinfo->eeprom_len = ETH_MODULE_SFF_8636_LEN; | 1483 | modinfo->eeprom_len = ETH_MODULE_SFF_8636_MAX_LEN; |
| 1484 | } | 1484 | } |
| 1485 | break; | 1485 | break; |
| 1486 | case NFP_INTERFACE_QSFP28: | 1486 | case NFP_INTERFACE_QSFP28: |
| 1487 | modinfo->type = ETH_MODULE_SFF_8636; | 1487 | modinfo->type = ETH_MODULE_SFF_8636; |
| 1488 | modinfo->eeprom_len = ETH_MODULE_SFF_8636_LEN; | 1488 | modinfo->eeprom_len = ETH_MODULE_SFF_8636_MAX_LEN; |
| 1489 | break; | 1489 | break; |
| 1490 | default: | 1490 | default: |
| 1491 | netdev_err(netdev, "Unsupported module 0x%x detected\n", | 1491 | netdev_err(netdev, "Unsupported module 0x%x detected\n", |
| @@ -687,8 +687,14 @@ int ionic_port_reset(struct ionic *ionic) · 686 unmodified lines | |||
| 687 | 687 | ||
| 688 | static int __init ionic_init_module(void) | 688 | static int __init ionic_init_module(void) |
| 689 | { | 689 | { |
| 690 | int ret; | ||
| 691 | |||
| 690 | ionic_debugfs_create(); | 692 | ionic_debugfs_create(); |
| 691 | return ionic_bus_register_driver(); | 693 | ret = ionic_bus_register_driver(); |
| 694 | if (ret) | ||
| 695 | ionic_debugfs_destroy(); | ||
| 696 | |||
| 697 | return ret; | ||
| 692 | } | 698 | } |
| 693 | 699 | ||
| 694 | static void __exit ionic_cleanup_module(void) | 700 | static void __exit ionic_cleanup_module(void) |
| @@ -6548,6 +6548,9 @@ void stmmac_xdp_release(struct net_device *dev) · 6547 unmodified lines | |||
| 6548 | struct stmmac_priv *priv = netdev_priv(dev); | 6548 | struct stmmac_priv *priv = netdev_priv(dev); |
| 6549 | u32 chan; | 6549 | u32 chan; |
| 6550 | 6550 | ||
| 6551 | /* Ensure tx function is not running */ | ||
| 6552 | netif_tx_disable(dev); | ||
| 6553 | |||
| 6551 | /* Disable NAPI process */ | 6554 | /* Disable NAPI process */ |
| 6552 | stmmac_disable_all_queues(priv); | 6555 | stmmac_disable_all_queues(priv); |
| 6553 | 6556 | ||
| @@ -141,7 +141,7 @@ static struct macvlan_source_entry *macvlan_hash_lookup_source( · 140 unmodified lines | |||
| 141 | u32 idx = macvlan_eth_hash(addr); | 141 | u32 idx = macvlan_eth_hash(addr); |
| 142 | struct hlist_head *h = &vlan->port->vlan_source_hash[idx]; | 142 | struct hlist_head *h = &vlan->port->vlan_source_hash[idx]; |
| 143 | 143 | ||
| 144 | hlist_for_each_entry_rcu(entry, h, hlist) { | 144 | hlist_for_each_entry_rcu(entry, h, hlist, lockdep_rtnl_is_held()) { |
| 145 | if (ether_addr_equal_64bits(entry->addr, addr) && | 145 | if (ether_addr_equal_64bits(entry->addr, addr) && |
| 146 | entry->vlan == vlan) | 146 | entry->vlan == vlan) |
| 147 | return entry; | 147 | return entry; |
| @@ -1647,7 +1647,7 @@ static int macvlan_fill_info_macaddr(struct sk_buff *skb, · 1499 unmodified lines | |||
| 1647 | struct hlist_head *h = &vlan->port->vlan_source_hash[i]; | 1647 | struct hlist_head *h = &vlan->port->vlan_source_hash[i]; |
| 1648 | struct macvlan_source_entry *entry; | 1648 | struct macvlan_source_entry *entry; |
| 1649 | 1649 | ||
| 1650 | hlist_for_each_entry_rcu(entry, h, hlist) { | 1650 | hlist_for_each_entry_rcu(entry, h, hlist, lockdep_rtnl_is_held()) { |
| 1651 | if (entry->vlan != vlan) | 1651 | if (entry->vlan != vlan) |
| 1652 | continue; | 1652 | continue; |
| 1653 | if (nla_put(skb, IFLA_MACVLAN_MACADDR, ETH_ALEN, entry->addr)) | 1653 | if (nla_put(skb, IFLA_MACVLAN_MACADDR, ETH_ALEN, entry->addr)) |
| @@ -43,6 +43,7 @@ · 42 unmodified lines | |||
| 43 | enum { | 43 | enum { |
| 44 | MCTP_I2C_FLOW_STATE_NEW = 0, | 44 | MCTP_I2C_FLOW_STATE_NEW = 0, |
| 45 | MCTP_I2C_FLOW_STATE_ACTIVE, | 45 | MCTP_I2C_FLOW_STATE_ACTIVE, |
| 46 | MCTP_I2C_FLOW_STATE_INVALID, | ||
| 46 | }; | 47 | }; |
| 47 | 48 | ||
| 48 | /* List of all struct mctp_i2c_client | 49 | /* List of all struct mctp_i2c_client |
| @@ -374,12 +375,18 @@ mctp_i2c_get_tx_flow_state(struct mctp_i2c_dev *midev, struct sk_buff *skb) · 325 unmodified lines | |||
| 374 | */ | 375 | */ |
| 375 | if (!key->valid) { | 376 | if (!key->valid) { |
| 376 | state = MCTP_I2C_TX_FLOW_INVALID; | 377 | state = MCTP_I2C_TX_FLOW_INVALID; |
| 377 | |||
| 378 | } else if (key->dev_flow_state == MCTP_I2C_FLOW_STATE_NEW) { | ||
| 379 | key->dev_flow_state = MCTP_I2C_FLOW_STATE_ACTIVE; | ||
| 380 | state = MCTP_I2C_TX_FLOW_NEW; | ||
| 381 | } else { | 378 | } else { |
| 382 | state = MCTP_I2C_TX_FLOW_EXISTING; | 379 | switch (key->dev_flow_state) { |
| 380 | case MCTP_I2C_FLOW_STATE_NEW: | ||
| 381 | key->dev_flow_state = MCTP_I2C_FLOW_STATE_ACTIVE; | ||
| 382 | state = MCTP_I2C_TX_FLOW_NEW; | ||
| 383 | break; | ||
| 384 | case MCTP_I2C_FLOW_STATE_ACTIVE: | ||
| 385 | state = MCTP_I2C_TX_FLOW_EXISTING; | ||
| 386 | break; | ||
| 387 | default: | ||
| 388 | state = MCTP_I2C_TX_FLOW_INVALID; | ||
| 389 | } | ||
| 383 | } | 390 | } |
| 384 | 391 | ||
| 385 | spin_unlock_irqrestore(&key->lock, flags); | 392 | spin_unlock_irqrestore(&key->lock, flags); |
| @@ -617,21 +624,31 @@ static void mctp_i2c_release_flow(struct mctp_dev *mdev, · 231 unmodified lines | |||
| 617 | 624 | ||
| 618 | { | 625 | { |
| 619 | struct mctp_i2c_dev *midev = netdev_priv(mdev->dev); | 626 | struct mctp_i2c_dev *midev = netdev_priv(mdev->dev); |
| 627 | bool queue_release = false; | ||
| 620 | unsigned long flags; | 628 | unsigned long flags; |
| 621 | 629 | ||
| 622 | spin_lock_irqsave(&midev->lock, flags); | 630 | spin_lock_irqsave(&midev->lock, flags); |
| 623 | midev->release_count++; | 631 | /* if we have seen the flow/key previously, we need to pair the |
| 624 | spin_unlock_irqrestore(&midev->lock, flags); | 632 | * original lock with a release |
| 625 | |||
| 626 | /* Ensure we have a release operation queued, through the fake | ||
| 627 | * marker skb | ||
| 628 | */ | 633 | */ |
| 629 | spin_lock(&midev->tx_queue.lock); | 634 | if (key->dev_flow_state == MCTP_I2C_FLOW_STATE_ACTIVE) { |
| 630 | if (!midev->unlock_marker.next) | 635 | midev->release_count++; |
| 631 | __skb_queue_tail(&midev->tx_queue, &midev->unlock_marker); | 636 | queue_release = true; |
| 632 | spin_unlock(&midev->tx_queue.lock); | 637 | } |
| 638 | key->dev_flow_state = MCTP_I2C_FLOW_STATE_INVALID; | ||
| 639 | spin_unlock_irqrestore(&midev->lock, flags); | ||
| 633 | 640 | ||
| 634 | wake_up(&midev->tx_wq); | 641 | if (queue_release) { |
| 642 | /* Ensure we have a release operation queued, through the fake | ||
| 643 | * marker skb | ||
| 644 | */ | ||
| 645 | spin_lock(&midev->tx_queue.lock); | ||
| 646 | if (!midev->unlock_marker.next) | ||
| 647 | __skb_queue_tail(&midev->tx_queue, | ||
| 648 | &midev->unlock_marker); | ||
| 649 | spin_unlock(&midev->tx_queue.lock); | ||
| 650 | wake_up(&midev->tx_wq); | ||
| 651 | } | ||
| 635 | } | 652 | } |
| 636 | 653 | ||
| 637 | static const struct net_device_ops mctp_i2c_ops = { | 654 | static const struct net_device_ops mctp_i2c_ops = { |
| @@ -343,6 +343,8 @@ static void mhi_net_dellink(struct mhi_device *mhi_dev, struct net_device *ndev) · 342 unmodified lines | |||
| 343 | 343 | ||
| 344 | kfree_skb(mhi_netdev->skbagg_head); | 344 | kfree_skb(mhi_netdev->skbagg_head); |
| 345 | 345 | ||
| 346 | free_netdev(ndev); | ||
| 347 | |||
| 346 | dev_set_drvdata(&mhi_dev->dev, NULL); | 348 | dev_set_drvdata(&mhi_dev->dev, NULL); |
| 347 | } | 349 | } |
| 348 | 350 | ||
| @@ -1683,6 +1683,7 @@ void nsim_drv_remove(struct nsim_bus_dev *nsim_bus_dev) · 1682 unmodified lines | |||
| 1683 | ARRAY_SIZE(nsim_devlink_params)); | 1683 | ARRAY_SIZE(nsim_devlink_params)); |
| 1684 | devl_resources_unregister(devlink); | 1684 | devl_resources_unregister(devlink); |
| 1685 | kfree(nsim_dev->vfconfigs); | 1685 | kfree(nsim_dev->vfconfigs); |
| 1686 | kfree(nsim_dev->fa_cookie); | ||
| 1686 | devl_unlock(devlink); | 1687 | devl_unlock(devlink); |
| 1687 | devlink_free(devlink); | 1688 | devlink_free(devlink); |
| 1688 | dev_set_drvdata(&nsim_bus_dev->dev, NULL); | 1689 | dev_set_drvdata(&nsim_bus_dev->dev, NULL); |
| @@ -682,6 +682,13 @@ static int dp83867_of_init(struct phy_device *phydev) · 681 unmodified lines | |||
| 682 | */ | 682 | */ |
| 683 | dp83867->io_impedance = DP83867_IO_MUX_CFG_IO_IMPEDANCE_MIN / 2; | 683 | dp83867->io_impedance = DP83867_IO_MUX_CFG_IO_IMPEDANCE_MIN / 2; |
| 684 | 684 | ||
| 685 | /* For non-OF device, the RX and TX FIFO depths are taken from | ||
| 686 | * default value. So, we init RX & TX FIFO depths here | ||
| 687 | * so that it is configured correctly later in dp83867_config_init(); | ||
| 688 | */ | ||
| 689 | dp83867->tx_fifo_depth = DP83867_PHYCR_FIFO_DEPTH_4_B_NIB; | ||
| 690 | dp83867->rx_fifo_depth = DP83867_PHYCR_FIFO_DEPTH_4_B_NIB; | ||
| 691 | |||
| 685 | return 0; | 692 | return 0; |
| 686 | } | 693 | } |
| 687 | #endif /* CONFIG_OF_MDIO */ | 694 | #endif /* CONFIG_OF_MDIO */ |
| @@ -2015,14 +2015,16 @@ static int m88e1510_loopback(struct phy_device *phydev, bool enable) · 2014 unmodified lines | |||
| 2015 | if (err < 0) | 2015 | if (err < 0) |
| 2016 | return err; | 2016 | return err; |
| 2017 | 2017 | ||
| 2018 | /* FIXME: Based on trial and error test, it seem 1G need to have | 2018 | err = phy_modify(phydev, MII_BMCR, BMCR_LOOPBACK, |
| 2019 | * delay between soft reset and loopback enablement. | 2019 | BMCR_LOOPBACK); |
| 2020 | */ | ||
| 2021 | if (phydev->speed == SPEED_1000) | ||
| 2022 | msleep(1000); | ||
| 2023 | 2020 | ||
| 2024 | return phy_modify(phydev, MII_BMCR, BMCR_LOOPBACK, | 2021 | if (!err) { |
| 2025 | BMCR_LOOPBACK); | 2022 | /* It takes some time for PHY device to switch |
| 2023 | * into/out-of loopback mode. | ||
| 2024 | */ | ||
| 2025 | msleep(1000); | ||
| 2026 | } | ||
| 2027 | return err; | ||
| 2026 | } else { | 2028 | } else { |
| 2027 | err = phy_modify(phydev, MII_BMCR, BMCR_LOOPBACK, 0); | 2029 | err = phy_modify(phydev, MII_BMCR, BMCR_LOOPBACK, 0); |
| 2028 | if (err < 0) | 2030 | if (err < 0) |
| @@ -1391,12 +1391,21 @@ static int __init tbnet_init(void) · 1390 unmodified lines | |||
| 1391 | tb_property_add_immediate(tbnet_dir, "prtcstns", flags); | 1391 | tb_property_add_immediate(tbnet_dir, "prtcstns", flags); |
| 1392 | 1392 | ||
| 1393 | ret = tb_register_property_dir("network", tbnet_dir); | 1393 | ret = tb_register_property_dir("network", tbnet_dir); |
| 1394 | if (ret) { | 1394 | if (ret) |
| 1395 | tb_property_free_dir(tbnet_dir); | 1395 | goto err_free_dir; |
| 1396 | return ret; | 1396 | |
| 1397 | } | 1397 | ret = tb_register_service_driver(&tbnet_driver); |
| 1398 | if (ret) | ||
| 1399 | goto err_unregister; | ||
| 1398 | 1400 | ||
| 1399 | return tb_register_service_driver(&tbnet_driver); | 1401 | return 0; |
| 1402 | |||
| 1403 | err_unregister: | ||
| 1404 | tb_unregister_property_dir("network", tbnet_dir); | ||
| 1405 | err_free_dir: | ||
| 1406 | tb_property_free_dir(tbnet_dir); | ||
| 1407 | |||
| 1408 | return ret; | ||
| 1400 | } | 1409 | } |
| 1401 | module_init(tbnet_init); | 1410 | module_init(tbnet_init); |
| 1402 | 1411 | ||
| @@ -1357,6 +1357,7 @@ static const struct usb_device_id products[] = { · 1356 unmodified lines | |||
| 1357 | {QMI_FIXED_INTF(0x2357, 0x0201, 4)}, /* TP-LINK HSUPA Modem MA180 */ | 1357 | {QMI_FIXED_INTF(0x2357, 0x0201, 4)}, /* TP-LINK HSUPA Modem MA180 */ |
| 1358 | {QMI_FIXED_INTF(0x2357, 0x9000, 4)}, /* TP-LINK MA260 */ | 1358 | {QMI_FIXED_INTF(0x2357, 0x9000, 4)}, /* TP-LINK MA260 */ |
| 1359 | {QMI_QUIRK_SET_DTR(0x1bc7, 0x1031, 3)}, /* Telit LE910C1-EUX */ | 1359 | {QMI_QUIRK_SET_DTR(0x1bc7, 0x1031, 3)}, /* Telit LE910C1-EUX */ |
| 1360 | {QMI_QUIRK_SET_DTR(0x1bc7, 0x103a, 0)}, /* Telit LE910C4-WWX */ | ||
| 1360 | {QMI_QUIRK_SET_DTR(0x1bc7, 0x1040, 2)}, /* Telit LE922A */ | 1361 | {QMI_QUIRK_SET_DTR(0x1bc7, 0x1040, 2)}, /* Telit LE922A */ |
| 1361 | {QMI_QUIRK_SET_DTR(0x1bc7, 0x1050, 2)}, /* Telit FN980 */ | 1362 | {QMI_QUIRK_SET_DTR(0x1bc7, 0x1050, 2)}, /* Telit FN980 */ |
| 1362 | {QMI_QUIRK_SET_DTR(0x1bc7, 0x1057, 2)}, /* Telit FN980 */ | 1363 | {QMI_QUIRK_SET_DTR(0x1bc7, 0x1057, 2)}, /* Telit FN980 */ |
| @@ -66,6 +66,7 @@ struct smsc95xx_priv { · 65 unmodified lines | |||
| 66 | spinlock_t mac_cr_lock; | 66 | spinlock_t mac_cr_lock; |
| 67 | u8 features; | 67 | u8 features; |
| 68 | u8 suspend_flags; | 68 | u8 suspend_flags; |
| 69 | bool is_internal_phy; | ||
| 69 | struct irq_chip irqchip; | 70 | struct irq_chip irqchip; |
| 70 | struct irq_domain *irqdomain; | 71 | struct irq_domain *irqdomain; |
| 71 | struct fwnode_handle *irqfwnode; | 72 | struct fwnode_handle *irqfwnode; |
| @@ -252,6 +253,43 @@ done: · 180 unmodified lines | |||
| 252 | mutex_unlock(&dev->phy_mutex); | 253 | mutex_unlock(&dev->phy_mutex); |
| 253 | } | 254 | } |
| 254 | 255 | ||
| 256 | static int smsc95xx_mdiobus_reset(struct mii_bus *bus) | ||
| 257 | { | ||
| 258 | struct smsc95xx_priv *pdata; | ||
| 259 | struct usbnet *dev; | ||
| 260 | u32 val; | ||
| 261 | int ret; | ||
| 262 | |||
| 263 | dev = bus->priv; | ||
| 264 | pdata = dev->driver_priv; | ||
| 265 | |||
| 266 | if (pdata->is_internal_phy) | ||
| 267 | return 0; | ||
| 268 | |||
| 269 | mutex_lock(&dev->phy_mutex); | ||
| 270 | |||
| 271 | ret = smsc95xx_read_reg(dev, PM_CTRL, &val); | ||
| 272 | if (ret < 0) | ||
| 273 | goto reset_out; | ||
| 274 | |||
| 275 | val |= PM_CTL_PHY_RST_; | ||
| 276 | |||
| 277 | ret = smsc95xx_write_reg(dev, PM_CTRL, val); | ||
| 278 | if (ret < 0) | ||
| 279 | goto reset_out; | ||
| 280 | |||
| 281 | /* Driver has no knowledge at this point about the external PHY. | ||
| 282 | * The 802.3 specifies that the reset process shall | ||
| 283 | * be completed within 0.5 s. | ||
| 284 | */ | ||
| 285 | fsleep(500000); | ||
| 286 | |||
| 287 | reset_out: | ||
| 288 | mutex_unlock(&dev->phy_mutex); | ||
| 289 | |||
| 290 | return 0; | ||
| 291 | } | ||
| 292 | |||
| 255 | static int smsc95xx_mdiobus_read(struct mii_bus *bus, int phy_id, int idx) | 293 | static int smsc95xx_mdiobus_read(struct mii_bus *bus, int phy_id, int idx) |
| 256 | { | 294 | { |
| 257 | struct usbnet *dev = bus->priv; | 295 | struct usbnet *dev = bus->priv; |
| @@ -1052,7 +1090,6 @@ static void smsc95xx_handle_link_change(struct net_device *net) · 794 unmodified lines | |||
| 1052 | static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf) | 1090 | static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf) |
| 1053 | { | 1091 | { |
| 1054 | struct smsc95xx_priv *pdata; | 1092 | struct smsc95xx_priv *pdata; |
| 1055 | bool is_internal_phy; | ||
| 1056 | char usb_path[64]; | 1093 | char usb_path[64]; |
| 1057 | int ret, phy_irq; | 1094 | int ret, phy_irq; |
| 1058 | u32 val; | 1095 | u32 val; |
| @@ -1133,13 +1170,14 @@ static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf) · 74 unmodified lines | |||
| 1133 | if (ret < 0) | 1170 | if (ret < 0) |
| 1134 | goto free_mdio; | 1171 | goto free_mdio; |
| 1135 | 1172 | ||
| 1136 | is_internal_phy = !(val & HW_CFG_PSEL_); | 1173 | pdata->is_internal_phy = !(val & HW_CFG_PSEL_); |
| 1137 | if (is_internal_phy) | 1174 | if (pdata->is_internal_phy) |
| 1138 | pdata->mdiobus->phy_mask = ~(1u << SMSC95XX_INTERNAL_PHY_ID); | 1175 | pdata->mdiobus->phy_mask = ~(1u << SMSC95XX_INTERNAL_PHY_ID); |
| 1139 | 1176 | ||
| 1140 | pdata->mdiobus->priv = dev; | 1177 | pdata->mdiobus->priv = dev; |
| 1141 | pdata->mdiobus->read = smsc95xx_mdiobus_read; | 1178 | pdata->mdiobus->read = smsc95xx_mdiobus_read; |
| 1142 | pdata->mdiobus->write = smsc95xx_mdiobus_write; | 1179 | pdata->mdiobus->write = smsc95xx_mdiobus_write; |
| 1180 | pdata->mdiobus->reset = smsc95xx_mdiobus_reset; | ||
| 1143 | pdata->mdiobus->name = "smsc95xx-mdiobus"; | 1181 | pdata->mdiobus->name = "smsc95xx-mdiobus"; |
| 1144 | pdata->mdiobus->parent = &dev->udev->dev; | 1182 | pdata->mdiobus->parent = &dev->udev->dev; |
| 1145 | 1183 | ||
| @@ -1160,7 +1198,7 @@ static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf) · 14 unmodified lines | |||
| 1160 | } | 1198 | } |
| 1161 | 1199 | ||
| 1162 | pdata->phydev->irq = phy_irq; | 1200 | pdata->phydev->irq = phy_irq; |
| 1163 | pdata->phydev->is_internal = is_internal_phy; | 1201 | pdata->phydev->is_internal = pdata->is_internal_phy; |
| 1164 | 1202 | ||
| 1165 | /* detect device revision as different features may be available */ | 1203 | /* detect device revision as different features may be available */ |
| 1166 | ret = smsc95xx_read_reg(dev, ID_REV, &val); | 1204 | ret = smsc95xx_read_reg(dev, ID_REV, &val); |
| @@ -3489,6 +3489,8 @@ static const struct pci_device_id nvme_id_table[] = { · 3488 unmodified lines | |||
| 3489 | NVME_QUIRK_IGNORE_DEV_SUBNQN, }, | 3489 | NVME_QUIRK_IGNORE_DEV_SUBNQN, }, |
| 3490 | { PCI_DEVICE(0x1344, 0x5407), /* Micron Technology Inc NVMe SSD */ | 3490 | { PCI_DEVICE(0x1344, 0x5407), /* Micron Technology Inc NVMe SSD */ |
| 3491 | .driver_data = NVME_QUIRK_IGNORE_DEV_SUBNQN }, | 3491 | .driver_data = NVME_QUIRK_IGNORE_DEV_SUBNQN }, |
| 3492 | { PCI_DEVICE(0x1344, 0x6001), /* Micron Nitro NVMe */ | ||
| 3493 | .driver_data = NVME_QUIRK_BOGUS_NID, }, | ||
| 3492 | { PCI_DEVICE(0x1c5c, 0x1504), /* SK Hynix PC400 */ | 3494 | { PCI_DEVICE(0x1c5c, 0x1504), /* SK Hynix PC400 */ |
| 3493 | .driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES, }, | 3495 | .driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES, }, |
| 3494 | { PCI_DEVICE(0x1c5c, 0x174a), /* SK Hynix P31 SSD */ | 3496 | { PCI_DEVICE(0x1c5c, 0x174a), /* SK Hynix P31 SSD */ |
| @@ -3519,6 +3521,8 @@ static const struct pci_device_id nvme_id_table[] = { · 24 unmodified lines | |||
| 3519 | .driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES, }, | 3521 | .driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES, }, |
| 3520 | { PCI_DEVICE(0x2646, 0x501E), /* KINGSTON OM3PGP4xxxxQ OS21011 NVMe SSD */ | 3522 | { PCI_DEVICE(0x2646, 0x501E), /* KINGSTON OM3PGP4xxxxQ OS21011 NVMe SSD */ |
| 3521 | .driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES, }, | 3523 | .driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES, }, |
| 3524 | { PCI_DEVICE(0x1f40, 0x5236), /* Netac Technologies Co. NV7000 NVMe SSD */ | ||
| 3525 | .driver_data = NVME_QUIRK_BOGUS_NID, }, | ||
| 3522 | { PCI_DEVICE(0x1e4B, 0x1001), /* MAXIO MAP1001 */ | 3526 | { PCI_DEVICE(0x1e4B, 0x1001), /* MAXIO MAP1001 */ |
| 3523 | .driver_data = NVME_QUIRK_BOGUS_NID, }, | 3527 | .driver_data = NVME_QUIRK_BOGUS_NID, }, |
| 3524 | { PCI_DEVICE(0x1e4B, 0x1002), /* MAXIO MAP1002 */ | 3528 | { PCI_DEVICE(0x1e4B, 0x1002), /* MAXIO MAP1002 */ |
| @@ -45,9 +45,11 @@ int nvmet_auth_set_key(struct nvmet_host *host, const char *secret, · 44 unmodified lines | |||
| 45 | if (!dhchap_secret) | 45 | if (!dhchap_secret) |
| 46 | return -ENOMEM; | 46 | return -ENOMEM; |
| 47 | if (set_ctrl) { | 47 | if (set_ctrl) { |
| 48 | kfree(host->dhchap_ctrl_secret); | ||
| 48 | host->dhchap_ctrl_secret = strim(dhchap_secret); | 49 | host->dhchap_ctrl_secret = strim(dhchap_secret); |
| 49 | host->dhchap_ctrl_key_hash = key_hash; | 50 | host->dhchap_ctrl_key_hash = key_hash; |
| 50 | } else { | 51 | } else { |
| 52 | kfree(host->dhchap_secret); | ||
| 51 | host->dhchap_secret = strim(dhchap_secret); | 53 | host->dhchap_secret = strim(dhchap_secret); |
| 52 | host->dhchap_key_hash = key_hash; | 54 | host->dhchap_key_hash = key_hash; |
| 53 | } | 55 | } |
| @@ -203,7 +203,7 @@ static int lan9662_otp_probe(struct platform_device *pdev) · 202 unmodified lines | |||
| 203 | } | 203 | } |
| 204 | 204 | ||
| 205 | static const struct of_device_id lan9662_otp_match[] = { | 205 | static const struct of_device_id lan9662_otp_match[] = { |
| 206 | { .compatible = "microchip,lan9662-otp", }, | 206 | { .compatible = "microchip,lan9662-otpc", }, |
| 207 | { }, | 207 | { }, |
| 208 | }; | 208 | }; |
| 209 | MODULE_DEVICE_TABLE(of, lan9662_otp_match); | 209 | MODULE_DEVICE_TABLE(of, lan9662_otp_match); |
| @@ -135,7 +135,7 @@ static int u_boot_env_parse(struct u_boot_env *priv) · 134 unmodified lines | |||
| 135 | break; | 135 | break; |
| 136 | case U_BOOT_FORMAT_REDUNDANT: | 136 | case U_BOOT_FORMAT_REDUNDANT: |
| 137 | crc32_offset = offsetof(struct u_boot_env_image_redundant, crc32); | 137 | crc32_offset = offsetof(struct u_boot_env_image_redundant, crc32); |
| 138 | crc32_data_offset = offsetof(struct u_boot_env_image_redundant, mark); | 138 | crc32_data_offset = offsetof(struct u_boot_env_image_redundant, data); |
| 139 | data_offset = offsetof(struct u_boot_env_image_redundant, data); | 139 | data_offset = offsetof(struct u_boot_env_image_redundant, data); |
| 140 | break; | 140 | break; |
| 141 | } | 141 | } |
| @@ -468,7 +468,7 @@ static size_t parport_pc_fifo_write_block_pio(struct parport *port, · 467 unmodified lines | |||
| 468 | const unsigned char *bufp = buf; | 468 | const unsigned char *bufp = buf; |
| 469 | size_t left = length; | 469 | size_t left = length; |
| 470 | unsigned long expire = jiffies + port->physport->cad->timeout; | 470 | unsigned long expire = jiffies + port->physport->cad->timeout; |
| 471 | const int fifo = FIFO(port); | 471 | const unsigned long fifo = FIFO(port); |
| 472 | int poll_for = 8; /* 80 usecs */ | 472 | int poll_for = 8; /* 80 usecs */ |
| 473 | const struct parport_pc_private *priv = port->physport->private_data; | 473 | const struct parport_pc_private *priv = port->physport->private_data; |
| 474 | const int fifo_depth = priv->fifo_depth; | 474 | const int fifo_depth = priv->fifo_depth; |
| @@ -220,6 +220,8 @@ int pinctrl_dt_to_map(struct pinctrl *p, struct pinctrl_dev *pctldev) · 219 unmodified lines | |||
| 220 | for (state = 0; ; state++) { | 220 | for (state = 0; ; state++) { |
| 221 | /* Retrieve the pinctrl-* property */ | 221 | /* Retrieve the pinctrl-* property */ |
| 222 | propname = kasprintf(GFP_KERNEL, "pinctrl-%d", state); | 222 | propname = kasprintf(GFP_KERNEL, "pinctrl-%d", state); |
| 223 | if (!propname) | ||
| 224 | return -ENOMEM; | ||
| 223 | prop = of_find_property(np, propname, &size); | 225 | prop = of_find_property(np, propname, &size); |
| 224 | kfree(propname); | 226 | kfree(propname); |
| 225 | if (!prop) { | 227 | if (!prop) { |
| @@ -24,6 +24,7 @@ · 23 unmodified lines | |||
| 24 | #define MTK_EINT_EDGE_SENSITIVE 0 | 24 | #define MTK_EINT_EDGE_SENSITIVE 0 |
| 25 | #define MTK_EINT_LEVEL_SENSITIVE 1 | 25 | #define MTK_EINT_LEVEL_SENSITIVE 1 |
| 26 | #define MTK_EINT_DBNC_SET_DBNC_BITS 4 | 26 | #define MTK_EINT_DBNC_SET_DBNC_BITS 4 |
| 27 | #define MTK_EINT_DBNC_MAX 16 | ||
| 27 | #define MTK_EINT_DBNC_RST_BIT (0x1 << 1) | 28 | #define MTK_EINT_DBNC_RST_BIT (0x1 << 1) |
| 28 | #define MTK_EINT_DBNC_SET_EN (0x1 << 0) | 29 | #define MTK_EINT_DBNC_SET_EN (0x1 << 0) |
| 29 | 30 | ||
| @@ -48,6 +49,21 @@ static const struct mtk_eint_regs mtk_generic_eint_regs = { · 18 unmodified lines | |||
| 48 | .dbnc_clr = 0x700, | 49 | .dbnc_clr = 0x700, |
| 49 | }; | 50 | }; |
| 50 | 51 | ||
| 52 | const unsigned int debounce_time_mt2701[] = { | ||
| 53 | 500, 1000, 16000, 32000, 64000, 128000, 256000, 0 | ||
| 54 | }; | ||
| 55 | EXPORT_SYMBOL_GPL(debounce_time_mt2701); | ||
| 56 | |||
| 57 | const unsigned int debounce_time_mt6765[] = { | ||
| 58 | 125, 250, 500, 1000, 16000, 32000, 64000, 128000, 256000, 512000, 0 | ||
| 59 | }; | ||
| 60 | EXPORT_SYMBOL_GPL(debounce_time_mt6765); | ||
| 61 | |||
| 62 | const unsigned int debounce_time_mt6795[] = { | ||
| 63 | 500, 1000, 16000, 32000, 64000, 128000, 256000, 512000, 0 | ||
| 64 | }; | ||
| 65 | EXPORT_SYMBOL_GPL(debounce_time_mt6795); | ||
| 66 | |||
| 51 | static void __iomem *mtk_eint_get_offset(struct mtk_eint *eint, | 67 | static void __iomem *mtk_eint_get_offset(struct mtk_eint *eint, |
| 52 | unsigned int eint_num, | 68 | unsigned int eint_num, |
| 53 | unsigned int offset) | 69 | unsigned int offset) |
| @@ -404,10 +420,11 @@ int mtk_eint_set_debounce(struct mtk_eint *eint, unsigned long eint_num, · 350 unmodified lines | |||
| 404 | int virq, eint_offset; | 420 | int virq, eint_offset; |
| 405 | unsigned int set_offset, bit, clr_bit, clr_offset, rst, i, unmask, | 421 | unsigned int set_offset, bit, clr_bit, clr_offset, rst, i, unmask, |
| 406 | dbnc; | 422 | dbnc; |
| 407 | static const unsigned int debounce_time[] = {500, 1000, 16000, 32000, | ||
| 408 | 64000, 128000, 256000}; | ||
| 409 | struct irq_data *d; | 423 | struct irq_data *d; |
| 410 | 424 | ||
| 425 | if (!eint->hw->db_time) | ||
| 426 | return -EOPNOTSUPP; | ||
| 427 | |||
| 411 | virq = irq_find_mapping(eint->domain, eint_num); | 428 | virq = irq_find_mapping(eint->domain, eint_num); |
| 412 | eint_offset = (eint_num % 4) * 8; | 429 | eint_offset = (eint_num % 4) * 8; |
| 413 | d = irq_get_irq_data(virq); | 430 | d = irq_get_irq_data(virq); |
| @@ -418,9 +435,9 @@ int mtk_eint_set_debounce(struct mtk_eint *eint, unsigned long eint_num, · 4 unmodified lines | |||
| 418 | if (!mtk_eint_can_en_debounce(eint, eint_num)) | 435 | if (!mtk_eint_can_en_debounce(eint, eint_num)) |
| 419 | return -EINVAL; | 436 | return -EINVAL; |
| 420 | 437 | ||
| 421 | dbnc = ARRAY_SIZE(debounce_time); | 438 | dbnc = eint->num_db_time; |
| 422 | for (i = 0; i < ARRAY_SIZE(debounce_time); i++) { | 439 | for (i = 0; i < eint->num_db_time; i++) { |
| 423 | if (debounce <= debounce_time[i]) { | 440 | if (debounce <= eint->hw->db_time[i]) { |
| 424 | dbnc = i; | 441 | dbnc = i; |
| 425 | break; | 442 | break; |
| 426 | } | 443 | } |
| @@ -494,6 +511,13 @@ int mtk_eint_do_init(struct mtk_eint *eint) · 67 unmodified lines | |||
| 494 | if (!eint->domain) | 511 | if (!eint->domain) |
| 495 | return -ENOMEM; | 512 | return -ENOMEM; |
| 496 | 513 | ||
| 514 | if (eint->hw->db_time) { | ||
| 515 | for (i = 0; i < MTK_EINT_DBNC_MAX; i++) | ||
| 516 | if (eint->hw->db_time[i] == 0) | ||
| 517 | break; | ||
| 518 | eint->num_db_time = i; | ||
| 519 | } | ||
| 520 | |||
| 497 | mtk_eint_hw_init(eint); | 521 | mtk_eint_hw_init(eint); |
| 498 | for (i = 0; i < eint->hw->ap_num; i++) { | 522 | for (i = 0; i < eint->hw->ap_num; i++) { |
| 499 | int virq = irq_create_mapping(eint->domain, i); | 523 | int virq = irq_create_mapping(eint->domain, i); |
| @@ -37,8 +37,13 @@ struct mtk_eint_hw { · 36 unmodified lines | |||
| 37 | u8 ports; | 37 | u8 ports; |
| 38 | unsigned int ap_num; | 38 | unsigned int ap_num; |
| 39 | unsigned int db_cnt; | 39 | unsigned int db_cnt; |
| 40 | const unsigned int *db_time; | ||
| 40 | }; | 41 | }; |
| 41 | 42 | ||
| 43 | extern const unsigned int debounce_time_mt2701[]; | ||
| 44 | extern const unsigned int debounce_time_mt6765[]; | ||
| 45 | extern const unsigned int debounce_time_mt6795[]; | ||
| 46 | |||
| 42 | struct mtk_eint; | 47 | struct mtk_eint; |
| 43 | 48 | ||
| 44 | struct mtk_eint_xt { | 49 | struct mtk_eint_xt { |
| @@ -62,6 +67,7 @@ struct mtk_eint { · 17 unmodified lines | |||
| 62 | /* Used to fit into various EINT device */ | 67 | /* Used to fit into various EINT device */ |
| 63 | const struct mtk_eint_hw *hw; | 68 | const struct mtk_eint_hw *hw; |
| 64 | const struct mtk_eint_regs *regs; | 69 | const struct mtk_eint_regs *regs; |
| 70 | u16 num_db_time; | ||
| 65 | 71 | ||
| 66 | /* Used to fit into various pinctrl device */ | 72 | /* Used to fit into various pinctrl device */ |
| 67 | void *pctl; | 73 | void *pctl; |
| @@ -518,6 +518,7 @@ static const struct mtk_pinctrl_devdata mt2701_pinctrl_data = { · 517 unmodified lines | |||
| 518 | .ports = 6, | 518 | .ports = 6, |
| 519 | .ap_num = 169, | 519 | .ap_num = 169, |
| 520 | .db_cnt = 16, | 520 | .db_cnt = 16, |
| 521 | .db_time = debounce_time_mt2701, | ||
| 521 | }, | 522 | }, |
| 522 | }; | 523 | }; |
| 523 | 524 | ||
| @@ -567,6 +567,7 @@ static const struct mtk_pinctrl_devdata mt2712_pinctrl_data = { · 566 unmodified lines | |||
| 567 | .ports = 8, | 567 | .ports = 8, |
| 568 | .ap_num = 229, | 568 | .ap_num = 229, |
| 569 | .db_cnt = 40, | 569 | .db_cnt = 40, |
| 570 | .db_time = debounce_time_mt2701, | ||
| 570 | }, | 571 | }, |
| 571 | }; | 572 | }; |
| 572 | 573 | ||
| @@ -1062,6 +1062,7 @@ static const struct mtk_eint_hw mt6765_eint_hw = { · 1061 unmodified lines | |||
| 1062 | .ports = 6, | 1062 | .ports = 6, |
| 1063 | .ap_num = 160, | 1063 | .ap_num = 160, |
| 1064 | .db_cnt = 13, | 1064 | .db_cnt = 13, |
| 1065 | .db_time = debounce_time_mt6765, | ||
| 1065 | }; | 1066 | }; |
| 1066 | 1067 | ||
| 1067 | static const struct mtk_pin_soc mt6765_data = { | 1068 | static const struct mtk_pin_soc mt6765_data = { |
| @@ -737,6 +737,7 @@ static const struct mtk_eint_hw mt6779_eint_hw = { · 736 unmodified lines | |||
| 737 | .ports = 6, | 737 | .ports = 6, |
| 738 | .ap_num = 195, | 738 | .ap_num = 195, |
| 739 | .db_cnt = 13, | 739 | .db_cnt = 13, |
| 740 | .db_time = debounce_time_mt2701, | ||
| 740 | }; | 741 | }; |
| 741 | 742 | ||
| 742 | static const struct mtk_pin_soc mt6779_data = { | 743 | static const struct mtk_pin_soc mt6779_data = { |
| @@ -475,6 +475,7 @@ static const struct mtk_eint_hw mt6795_eint_hw = { · 474 unmodified lines | |||
| 475 | .ports = 7, | 475 | .ports = 7, |
| 476 | .ap_num = 224, | 476 | .ap_num = 224, |
| 477 | .db_cnt = 32, | 477 | .db_cnt = 32, |
| 478 | .db_time = debounce_time_mt6795, | ||
| 478 | }; | 479 | }; |
| 479 | 480 | ||
| 480 | static const unsigned int mt6795_pull_type[] = { | 481 | static const unsigned int mt6795_pull_type[] = { |
| @@ -846,6 +846,7 @@ static const struct mtk_eint_hw mt7622_eint_hw = { · 845 unmodified lines | |||
| 846 | .ports = 7, | 846 | .ports = 7, |
| 847 | .ap_num = ARRAY_SIZE(mt7622_pins), | 847 | .ap_num = ARRAY_SIZE(mt7622_pins), |
| 848 | .db_cnt = 20, | 848 | .db_cnt = 20, |
| 849 | .db_time = debounce_time_mt6765, | ||
| 849 | }; | 850 | }; |
| 850 | 851 | ||
| 851 | static const struct mtk_pin_soc mt7622_data = { | 852 | static const struct mtk_pin_soc mt7622_data = { |
| @@ -1369,6 +1369,7 @@ static const struct mtk_eint_hw mt7623_eint_hw = { · 1368 unmodified lines | |||
| 1369 | .ports = 6, | 1369 | .ports = 6, |
| 1370 | .ap_num = 169, | 1370 | .ap_num = 169, |
| 1371 | .db_cnt = 20, | 1371 | .db_cnt = 20, |
| 1372 | .db_time = debounce_time_mt2701, | ||
| 1372 | }; | 1373 | }; |
| 1373 | 1374 | ||
| 1374 | static struct mtk_pin_soc mt7623_data = { | 1375 | static struct mtk_pin_soc mt7623_data = { |
| @@ -402,6 +402,7 @@ static const struct mtk_eint_hw mt7629_eint_hw = { · 401 unmodified lines | |||
| 402 | .ports = 7, | 402 | .ports = 7, |
| 403 | .ap_num = ARRAY_SIZE(mt7629_pins), | 403 | .ap_num = ARRAY_SIZE(mt7629_pins), |
| 404 | .db_cnt = 16, | 404 | .db_cnt = 16, |
| 405 | .db_time = debounce_time_mt2701, | ||
| 405 | }; | 406 | }; |
| 406 | 407 | ||
| 407 | static struct mtk_pin_soc mt7629_data = { | 408 | static struct mtk_pin_soc mt7629_data = { |
| @@ -826,6 +826,7 @@ static const struct mtk_eint_hw mt7986a_eint_hw = { · 825 unmodified lines | |||
| 826 | .ports = 7, | 826 | .ports = 7, |
| 827 | .ap_num = ARRAY_SIZE(mt7986a_pins), | 827 | .ap_num = ARRAY_SIZE(mt7986a_pins), |
| 828 | .db_cnt = 16, | 828 | .db_cnt = 16, |
| 829 | .db_time = debounce_time_mt6765, | ||
| 829 | }; | 830 | }; |
| 830 | 831 | ||
| 831 | static const struct mtk_eint_hw mt7986b_eint_hw = { | 832 | static const struct mtk_eint_hw mt7986b_eint_hw = { |
| @@ -833,6 +834,7 @@ static const struct mtk_eint_hw mt7986b_eint_hw = { · 1 unmodified line | |||
| 833 | .ports = 7, | 834 | .ports = 7, |
| 834 | .ap_num = ARRAY_SIZE(mt7986b_pins), | 835 | .ap_num = ARRAY_SIZE(mt7986b_pins), |
| 835 | .db_cnt = 16, | 836 | .db_cnt = 16, |
| 837 | .db_time = debounce_time_mt6765, | ||
| 836 | }; | 838 | }; |
| 837 | 839 | ||
| 838 | static struct mtk_pin_soc mt7986a_data = { | 840 | static struct mtk_pin_soc mt7986a_data = { |
| @@ -286,6 +286,7 @@ static const struct mtk_pinctrl_devdata mt8127_pinctrl_data = { · 285 unmodified lines | |||
| 286 | .ports = 6, | 286 | .ports = 6, |
| 287 | .ap_num = 143, | 287 | .ap_num = 143, |
| 288 | .db_cnt = 16, | 288 | .db_cnt = 16, |
| 289 | .db_time = debounce_time_mt2701, | ||
| 289 | }, | 290 | }, |
| 290 | }; | 291 | }; |
| 291 | 292 | ||
| @@ -315,6 +315,7 @@ static const struct mtk_pinctrl_devdata mt8135_pinctrl_data = { · 314 unmodified lines | |||
| 315 | .ports = 6, | 315 | .ports = 6, |
| 316 | .ap_num = 192, | 316 | .ap_num = 192, |
| 317 | .db_cnt = 16, | 317 | .db_cnt = 16, |
| 318 | .db_time = debounce_time_mt2701, | ||
| 318 | }, | 319 | }, |
| 319 | }; | 320 | }; |
| 320 | 321 | ||
| @@ -319,6 +319,7 @@ static const struct mtk_pinctrl_devdata mt8167_pinctrl_data = { · 318 unmodified lines | |||
| 319 | .ports = 6, | 319 | .ports = 6, |
| 320 | .ap_num = 169, | 320 | .ap_num = 169, |
| 321 | .db_cnt = 64, | 321 | .db_cnt = 64, |
| 322 | .db_time = debounce_time_mt6795, | ||
| 322 | }, | 323 | }, |
| 323 | }; | 324 | }; |
| 324 | 325 | ||
| @@ -327,6 +327,7 @@ static const struct mtk_pinctrl_devdata mt8173_pinctrl_data = { · 326 unmodified lines | |||
| 327 | .ports = 6, | 327 | .ports = 6, |
| 328 | .ap_num = 224, | 328 | .ap_num = 224, |
| 329 | .db_cnt = 16, | 329 | .db_cnt = 16, |
| 330 | .db_time = debounce_time_mt2701, | ||
| 330 | }, | 331 | }, |
| 331 | }; | 332 | }; |
| 332 | 333 | ||
| @@ -545,6 +545,7 @@ static const struct mtk_eint_hw mt8183_eint_hw = { · 544 unmodified lines | |||
| 545 | .ports = 6, | 545 | .ports = 6, |
| 546 | .ap_num = 212, | 546 | .ap_num = 212, |
| 547 | .db_cnt = 13, | 547 | .db_cnt = 13, |
| 548 | .db_time = debounce_time_mt6765, | ||
| 548 | }; | 549 | }; |
| 549 | 550 | ||
| 550 | static const struct mtk_pin_soc mt8183_data = { | 551 | static const struct mtk_pin_soc mt8183_data = { |
| @@ -1222,6 +1222,7 @@ static const struct mtk_eint_hw mt8186_eint_hw = { · 1221 unmodified lines | |||
| 1222 | .ports = 7, | 1222 | .ports = 7, |
| 1223 | .ap_num = 217, | 1223 | .ap_num = 217, |
| 1224 | .db_cnt = 32, | 1224 | .db_cnt = 32, |
| 1225 | .db_time = debounce_time_mt6765, | ||
| 1225 | }; | 1226 | }; |
| 1226 | 1227 | ||
| 1227 | static const struct mtk_pin_soc mt8186_data = { | 1228 | static const struct mtk_pin_soc mt8186_data = { |
| @@ -1625,6 +1625,7 @@ static const struct mtk_eint_hw mt8188_eint_hw = { · 1624 unmodified lines | |||
| 1625 | .ports = 7, | 1625 | .ports = 7, |
| 1626 | .ap_num = 225, | 1626 | .ap_num = 225, |
| 1627 | .db_cnt = 32, | 1627 | .db_cnt = 32, |
| 1628 | .db_time = debounce_time_mt6765, | ||
| 1628 | }; | 1629 | }; |
| 1629 | 1630 | ||
| 1630 | static const struct mtk_pin_soc mt8188_data = { | 1631 | static const struct mtk_pin_soc mt8188_data = { |
| @@ -1371,6 +1371,7 @@ static const struct mtk_eint_hw mt8192_eint_hw = { · 1370 unmodified lines | |||
| 1371 | .ports = 7, | 1371 | .ports = 7, |
| 1372 | .ap_num = 224, | 1372 | .ap_num = 224, |
| 1373 | .db_cnt = 32, | 1373 | .db_cnt = 32, |
| 1374 | .db_time = debounce_time_mt6765, | ||
| 1374 | }; | 1375 | }; |
| 1375 | 1376 | ||
| 1376 | static const struct mtk_pin_reg_calc mt8192_reg_cals[PINCTRL_PIN_REG_MAX] = { | 1377 | static const struct mtk_pin_reg_calc mt8192_reg_cals[PINCTRL_PIN_REG_MAX] = { |
| @@ -935,6 +935,7 @@ static const struct mtk_eint_hw mt8195_eint_hw = { · 934 unmodified lines | |||
| 935 | .ports = 7, | 935 | .ports = 7, |
| 936 | .ap_num = 225, | 936 | .ap_num = 225, |
| 937 | .db_cnt = 32, | 937 | .db_cnt = 32, |
| 938 | .db_time = debounce_time_mt6765, | ||
| 938 | }; | 939 | }; |
| 939 | 940 | ||
| 940 | static const struct mtk_pin_soc mt8195_data = { | 941 | static const struct mtk_pin_soc mt8195_data = { |
| @@ -453,6 +453,7 @@ static const struct mtk_pinctrl_devdata mt8365_pinctrl_data = { · 452 unmodified lines | |||
| 453 | .ports = 5, | 453 | .ports = 5, |
| 454 | .ap_num = 160, | 454 | .ap_num = 160, |
| 455 | .db_cnt = 160, | 455 | .db_cnt = 160, |
| 456 | .db_time = debounce_time_mt6765, | ||
| 456 | }, | 457 | }, |
| 457 | }; | 458 | }; |
| 458 | 459 | ||
| @@ -319,6 +319,7 @@ static const struct mtk_pinctrl_devdata mt8516_pinctrl_data = { · 318 unmodified lines | |||
| 319 | .ports = 6, | 319 | .ports = 6, |
| 320 | .ap_num = 169, | 320 | .ap_num = 169, |
| 321 | .db_cnt = 64, | 321 | .db_cnt = 64, |
| 322 | .db_time = debounce_time_mt6795, | ||
| 322 | }, | 323 | }, |
| 323 | }; | 324 | }; |
| 324 | 325 | ||
| @@ -709,6 +709,9 @@ static int mtk_pinconf_bias_set_rsel(struct mtk_pinctrl *hw, · 708 unmodified lines | |||
| 709 | { | 709 | { |
| 710 | int err, rsel_val; | 710 | int err, rsel_val; |
| 711 | 711 | ||
| 712 | if (!pullup && arg == MTK_DISABLE) | ||
| 713 | return 0; | ||
| 714 | |||
| 712 | if (hw->rsel_si_unit) { | 715 | if (hw->rsel_si_unit) { |
| 713 | /* find pin rsel_index from pin_rsel array*/ | 716 | /* find pin rsel_index from pin_rsel array*/ |
| 714 | err = mtk_hw_pin_rsel_lookup(hw, desc, pullup, arg, &rsel_val); | 717 | err = mtk_hw_pin_rsel_lookup(hw, desc, pullup, arg, &rsel_val); |
| @@ -679,14 +679,54 @@ static void rockchip_get_recalced_mux(struct rockchip_pin_bank *bank, int pin, · 678 unmodified lines | |||
| 679 | } | 679 | } |
| 680 | 680 | ||
| 681 | static struct rockchip_mux_route_data px30_mux_route_data[] = { | 681 | static struct rockchip_mux_route_data px30_mux_route_data[] = { |
| 682 | RK_MUXROUTE_SAME(2, RK_PB4, 1, 0x184, BIT(16 + 7)), /* cif-d0m0 */ | ||
| 683 | RK_MUXROUTE_SAME(3, RK_PA1, 3, 0x184, BIT(16 + 7) | BIT(7)), /* cif-d0m1 */ | ||
| 684 | RK_MUXROUTE_SAME(2, RK_PB6, 1, 0x184, BIT(16 + 7)), /* cif-d1m0 */ | ||
| 685 | RK_MUXROUTE_SAME(3, RK_PA2, 3, 0x184, BIT(16 + 7) | BIT(7)), /* cif-d1m1 */ | ||
| 682 | RK_MUXROUTE_SAME(2, RK_PA0, 1, 0x184, BIT(16 + 7)), /* cif-d2m0 */ | 686 | RK_MUXROUTE_SAME(2, RK_PA0, 1, 0x184, BIT(16 + 7)), /* cif-d2m0 */ |
| 683 | RK_MUXROUTE_SAME(3, RK_PA3, 3, 0x184, BIT(16 + 7) | BIT(7)), /* cif-d2m1 */ | 687 | RK_MUXROUTE_SAME(3, RK_PA3, 3, 0x184, BIT(16 + 7) | BIT(7)), /* cif-d2m1 */ |
| 688 | RK_MUXROUTE_SAME(2, RK_PA1, 1, 0x184, BIT(16 + 7)), /* cif-d3m0 */ | ||
| 689 | RK_MUXROUTE_SAME(3, RK_PA5, 3, 0x184, BIT(16 + 7) | BIT(7)), /* cif-d3m1 */ | ||
| 690 | RK_MUXROUTE_SAME(2, RK_PA2, 1, 0x184, BIT(16 + 7)), /* cif-d4m0 */ | ||
| 691 | RK_MUXROUTE_SAME(3, RK_PA7, 3, 0x184, BIT(16 + 7) | BIT(7)), /* cif-d4m1 */ | ||
| 692 | RK_MUXROUTE_SAME(2, RK_PA3, 1, 0x184, BIT(16 + 7)), /* cif-d5m0 */ | ||
| 693 | RK_MUXROUTE_SAME(3, RK_PB0, 3, 0x184, BIT(16 + 7) | BIT(7)), /* cif-d5m1 */ | ||
| 694 | RK_MUXROUTE_SAME(2, RK_PA4, 1, 0x184, BIT(16 + 7)), /* cif-d6m0 */ | ||
| 695 | RK_MUXROUTE_SAME(3, RK_PB1, 3, 0x184, BIT(16 + 7) | BIT(7)), /* cif-d6m1 */ | ||
| 696 | RK_MUXROUTE_SAME(2, RK_PA5, 1, 0x184, BIT(16 + 7)), /* cif-d7m0 */ | ||
| 697 | RK_MUXROUTE_SAME(3, RK_PB4, 3, 0x184, BIT(16 + 7) | BIT(7)), /* cif-d7m1 */ | ||
| 698 | RK_MUXROUTE_SAME(2, RK_PA6, 1, 0x184, BIT(16 + 7)), /* cif-d8m0 */ | ||
| 699 | RK_MUXROUTE_SAME(3, RK_PB6, 3, 0x184, BIT(16 + 7) | BIT(7)), /* cif-d8m1 */ | ||
| 700 | RK_MUXROUTE_SAME(2, RK_PA7, 1, 0x184, BIT(16 + 7)), /* cif-d9m0 */ | ||
| 701 | RK_MUXROUTE_SAME(3, RK_PB7, 3, 0x184, BIT(16 + 7) | BIT(7)), /* cif-d9m1 */ | ||
| 702 | RK_MUXROUTE_SAME(2, RK_PB7, 1, 0x184, BIT(16 + 7)), /* cif-d10m0 */ | ||
| 703 | RK_MUXROUTE_SAME(3, RK_PC6, 3, 0x184, BIT(16 + 7) | BIT(7)), /* cif-d10m1 */ | ||
| 704 | RK_MUXROUTE_SAME(2, RK_PC0, 1, 0x184, BIT(16 + 7)), /* cif-d11m0 */ | ||
| 705 | RK_MUXROUTE_SAME(3, RK_PC7, 3, 0x184, BIT(16 + 7) | BIT(7)), /* cif-d11m1 */ | ||
| 706 | RK_MUXROUTE_SAME(2, RK_PB0, 1, 0x184, BIT(16 + 7)), /* cif-vsyncm0 */ | ||
| 707 | RK_MUXROUTE_SAME(3, RK_PD1, 3, 0x184, BIT(16 + 7) | BIT(7)), /* cif-vsyncm1 */ | ||
| 708 | RK_MUXROUTE_SAME(2, RK_PB1, 1, 0x184, BIT(16 + 7)), /* cif-hrefm0 */ | ||
| 709 | RK_MUXROUTE_SAME(3, RK_PD2, 3, 0x184, BIT(16 + 7) | BIT(7)), /* cif-hrefm1 */ | ||
| 710 | RK_MUXROUTE_SAME(2, RK_PB2, 1, 0x184, BIT(16 + 7)), /* cif-clkinm0 */ | ||
| 711 | RK_MUXROUTE_SAME(3, RK_PD3, 3, 0x184, BIT(16 + 7) | BIT(7)), /* cif-clkinm1 */ | ||
| 712 | RK_MUXROUTE_SAME(2, RK_PB3, 1, 0x184, BIT(16 + 7)), /* cif-clkoutm0 */ | ||
| 713 | RK_MUXROUTE_SAME(3, RK_PD0, 3, 0x184, BIT(16 + 7) | BIT(7)), /* cif-clkoutm1 */ | ||
| 684 | RK_MUXROUTE_SAME(3, RK_PC6, 2, 0x184, BIT(16 + 8)), /* pdm-m0 */ | 714 | RK_MUXROUTE_SAME(3, RK_PC6, 2, 0x184, BIT(16 + 8)), /* pdm-m0 */ |
| 685 | RK_MUXROUTE_SAME(2, RK_PC6, 1, 0x184, BIT(16 + 8) | BIT(8)), /* pdm-m1 */ | 715 | RK_MUXROUTE_SAME(2, RK_PC6, 1, 0x184, BIT(16 + 8) | BIT(8)), /* pdm-m1 */ |
| 716 | RK_MUXROUTE_SAME(3, RK_PD3, 2, 0x184, BIT(16 + 8)), /* pdm-sdi0m0 */ | ||
| 717 | RK_MUXROUTE_SAME(2, RK_PC5, 2, 0x184, BIT(16 + 8) | BIT(8)), /* pdm-sdi0m1 */ | ||
| 686 | RK_MUXROUTE_SAME(1, RK_PD3, 2, 0x184, BIT(16 + 10)), /* uart2-rxm0 */ | 718 | RK_MUXROUTE_SAME(1, RK_PD3, 2, 0x184, BIT(16 + 10)), /* uart2-rxm0 */ |
| 687 | RK_MUXROUTE_SAME(2, RK_PB6, 2, 0x184, BIT(16 + 10) | BIT(10)), /* uart2-rxm1 */ | 719 | RK_MUXROUTE_SAME(2, RK_PB6, 2, 0x184, BIT(16 + 10) | BIT(10)), /* uart2-rxm1 */ |
| 720 | RK_MUXROUTE_SAME(1, RK_PD2, 2, 0x184, BIT(16 + 10)), /* uart2-txm0 */ | ||
| 721 | RK_MUXROUTE_SAME(2, RK_PB4, 2, 0x184, BIT(16 + 10) | BIT(10)), /* uart2-txm1 */ | ||
| 688 | RK_MUXROUTE_SAME(0, RK_PC1, 2, 0x184, BIT(16 + 9)), /* uart3-rxm0 */ | 722 | RK_MUXROUTE_SAME(0, RK_PC1, 2, 0x184, BIT(16 + 9)), /* uart3-rxm0 */ |
| 689 | RK_MUXROUTE_SAME(1, RK_PB7, 2, 0x184, BIT(16 + 9) | BIT(9)), /* uart3-rxm1 */ | 723 | RK_MUXROUTE_SAME(1, RK_PB7, 2, 0x184, BIT(16 + 9) | BIT(9)), /* uart3-rxm1 */ |
| 724 | RK_MUXROUTE_SAME(0, RK_PC0, 2, 0x184, BIT(16 + 9)), /* uart3-txm0 */ | ||
| 725 | RK_MUXROUTE_SAME(1, RK_PB6, 2, 0x184, BIT(16 + 9) | BIT(9)), /* uart3-txm1 */ | ||
| 726 | RK_MUXROUTE_SAME(0, RK_PC2, 2, 0x184, BIT(16 + 9)), /* uart3-ctsm0 */ | ||
| 727 | RK_MUXROUTE_SAME(1, RK_PB4, 2, 0x184, BIT(16 + 9) | BIT(9)), /* uart3-ctsm1 */ | ||
| 728 | RK_MUXROUTE_SAME(0, RK_PC3, 2, 0x184, BIT(16 + 9)), /* uart3-rtsm0 */ | ||
| 729 | RK_MUXROUTE_SAME(1, RK_PB5, 2, 0x184, BIT(16 + 9) | BIT(9)), /* uart3-rtsm1 */ | ||
| 690 | }; | 730 | }; |
| 691 | 731 | ||
| 692 | static struct rockchip_mux_route_data rv1126_mux_route_data[] = { | 732 | static struct rockchip_mux_route_data rv1126_mux_route_data[] = { |
| @@ -1873,8 +1873,8 @@ static const struct msm_pingroup sc8280xp_groups[] = { · 1872 unmodified lines | |||
| 1873 | [225] = PINGROUP(225, hs3_mi2s, phase_flag, _, _, _, _, egpio), | 1873 | [225] = PINGROUP(225, hs3_mi2s, phase_flag, _, _, _, _, egpio), |
| 1874 | [226] = PINGROUP(226, hs3_mi2s, phase_flag, _, _, _, _, egpio), | 1874 | [226] = PINGROUP(226, hs3_mi2s, phase_flag, _, _, _, _, egpio), |
| 1875 | [227] = PINGROUP(227, hs3_mi2s, phase_flag, _, _, _, _, egpio), | 1875 | [227] = PINGROUP(227, hs3_mi2s, phase_flag, _, _, _, _, egpio), |
| 1876 | [228] = UFS_RESET(ufs_reset, 0xf1004), | 1876 | [228] = UFS_RESET(ufs_reset, 0xf1000), |
| 1877 | [229] = UFS_RESET(ufs1_reset, 0xf3004), | 1877 | [229] = UFS_RESET(ufs1_reset, 0xf3000), |
| 1878 | [230] = SDC_QDSD_PINGROUP(sdc2_clk, 0xe8000, 14, 6), | 1878 | [230] = SDC_QDSD_PINGROUP(sdc2_clk, 0xe8000, 14, 6), |
| 1879 | [231] = SDC_QDSD_PINGROUP(sdc2_cmd, 0xe8000, 11, 3), | 1879 | [231] = SDC_QDSD_PINGROUP(sdc2_cmd, 0xe8000, 11, 3), |
| 1880 | [232] = SDC_QDSD_PINGROUP(sdc2_data, 0xe8000, 9, 0), | 1880 | [232] = SDC_QDSD_PINGROUP(sdc2_data, 0xe8000, 9, 0), |
| @@ -1596,16 +1596,32 @@ static void ssh_ptl_timeout_reap(struct work_struct *work) · 1595 unmodified lines | |||
| 1596 | ssh_ptl_tx_wakeup_packet(ptl); | 1596 | ssh_ptl_tx_wakeup_packet(ptl); |
| 1597 | } | 1597 | } |
| 1598 | 1598 | ||
| 1599 | static bool ssh_ptl_rx_retransmit_check(struct ssh_ptl *ptl, u8 seq) | 1599 | static bool ssh_ptl_rx_retransmit_check(struct ssh_ptl *ptl, const struct ssh_frame *frame) |
| 1600 | { | 1600 | { |
| 1601 | int i; | 1601 | int i; |
| 1602 | 1602 | ||
| 1603 | /* | ||
| 1604 | * Ignore unsequenced packets. On some devices (notably Surface Pro 9), | ||
| 1605 | * unsequenced events will always be sent with SEQ=0x00. Attempting to | ||
| 1606 | * detect retransmission would thus just block all events. | ||
| 1607 | * | ||
| 1608 | * While sequence numbers would also allow detection of retransmitted | ||
| 1609 | * packets in unsequenced communication, they have only ever been used | ||
| 1610 | * to cover edge-cases in sequenced transmission. In particular, the | ||
| 1611 | * only instance of packets being retransmitted (that we are aware of) | ||
| 1612 | * is due to an ACK timeout. As this does not happen in unsequenced | ||
| 1613 | * communication, skip the retransmission check for those packets | ||
| 1614 | * entirely. | ||
| 1615 | */ | ||
| 1616 | if (frame->type == SSH_FRAME_TYPE_DATA_NSQ) | ||
| 1617 | return false; | ||
| 1618 | |||
| 1603 | /* | 1619 | /* |
| 1604 | * Check if SEQ has been seen recently (i.e. packet was | 1620 | * Check if SEQ has been seen recently (i.e. packet was |
| 1605 | * re-transmitted and we should ignore it). | 1621 | * re-transmitted and we should ignore it). |
| 1606 | */ | 1622 | */ |
| 1607 | for (i = 0; i < ARRAY_SIZE(ptl->rx.blocked.seqs); i++) { | 1623 | for (i = 0; i < ARRAY_SIZE(ptl->rx.blocked.seqs); i++) { |
| 1608 | if (likely(ptl->rx.blocked.seqs[i] != seq)) | 1624 | if (likely(ptl->rx.blocked.seqs[i] != frame->seq)) |
| 1609 | continue; | 1625 | continue; |
| 1610 | 1626 | ||
| 1611 | ptl_dbg(ptl, "ptl: ignoring repeated data packet\n"); | 1627 | ptl_dbg(ptl, "ptl: ignoring repeated data packet\n"); |
| @@ -1613,7 +1629,7 @@ static bool ssh_ptl_rx_retransmit_check(struct ssh_ptl *ptl, u8 seq) · 1 unmodified line | |||
| 1613 | } | 1629 | } |
| 1614 | 1630 | ||
| 1615 | /* Update list of blocked sequence IDs. */ | 1631 | /* Update list of blocked sequence IDs. */ |
| 1616 | ptl->rx.blocked.seqs[ptl->rx.blocked.offset] = seq; | 1632 | ptl->rx.blocked.seqs[ptl->rx.blocked.offset] = frame->seq; |
| 1617 | ptl->rx.blocked.offset = (ptl->rx.blocked.offset + 1) | 1633 | ptl->rx.blocked.offset = (ptl->rx.blocked.offset + 1) |
| 1618 | % ARRAY_SIZE(ptl->rx.blocked.seqs); | 1634 | % ARRAY_SIZE(ptl->rx.blocked.seqs); |
| 1619 | 1635 | ||
| @@ -1624,7 +1640,7 @@ static void ssh_ptl_rx_dataframe(struct ssh_ptl *ptl, · 4 unmodified lines | |||
| 1624 | const struct ssh_frame *frame, | 1640 | const struct ssh_frame *frame, |
| 1625 | const struct ssam_span *payload) | 1641 | const struct ssam_span *payload) |
| 1626 | { | 1642 | { |
| 1627 | if (ssh_ptl_rx_retransmit_check(ptl, frame->seq)) | 1643 | if (ssh_ptl_rx_retransmit_check(ptl, frame)) |
| 1628 | return; | 1644 | return; |
| 1629 | 1645 | ||
| 1630 | ptl->ops.data_received(ptl, payload); | 1646 | ptl->ops.data_received(ptl, payload); |
| @@ -234,6 +234,19 @@ static const struct software_node *ssam_node_group_sl3[] = { · 233 unmodified lines | |||
| 234 | NULL, | 234 | NULL, |
| 235 | }; | 235 | }; |
| 236 | 236 | ||
| 237 | /* Devices for Surface Laptop 5. */ | ||
| 238 | static const struct software_node *ssam_node_group_sl5[] = { | ||
| 239 | &ssam_node_root, | ||
| 240 | &ssam_node_bat_ac, | ||
| 241 | &ssam_node_bat_main, | ||
| 242 | &ssam_node_tmp_pprof, | ||
| 243 | &ssam_node_hid_main_keyboard, | ||
| 244 | &ssam_node_hid_main_touchpad, | ||
| 245 | &ssam_node_hid_main_iid5, | ||
| 246 | &ssam_node_hid_sam_ucm_ucsi, | ||
| 247 | NULL, | ||
| 248 | }; | ||
| 249 | |||
| 237 | /* Devices for Surface Laptop Studio. */ | 250 | /* Devices for Surface Laptop Studio. */ |
| 238 | static const struct software_node *ssam_node_group_sls[] = { | 251 | static const struct software_node *ssam_node_group_sls[] = { |
| 239 | &ssam_node_root, | 252 | &ssam_node_root, |
| @@ -268,6 +281,7 @@ static const struct software_node *ssam_node_group_sp7[] = { · 28 unmodified lines | |||
| 268 | NULL, | 281 | NULL, |
| 269 | }; | 282 | }; |
| 270 | 283 | ||
| 284 | /* Devices for Surface Pro 8 */ | ||
| 271 | static const struct software_node *ssam_node_group_sp8[] = { | 285 | static const struct software_node *ssam_node_group_sp8[] = { |
| 272 | &ssam_node_root, | 286 | &ssam_node_root, |
| 273 | &ssam_node_hub_kip, | 287 | &ssam_node_hub_kip, |
| @@ -284,6 +298,23 @@ static const struct software_node *ssam_node_group_sp8[] = { · 10 unmodified lines | |||
| 284 | NULL, | 298 | NULL, |
| 285 | }; | 299 | }; |
| 286 | 300 | ||
| 301 | /* Devices for Surface Pro 9 */ | ||
| 302 | static const struct software_node *ssam_node_group_sp9[] = { | ||
| 303 | &ssam_node_root, | ||
| 304 | &ssam_node_hub_kip, | ||
| 305 | &ssam_node_bat_ac, | ||
| 306 | &ssam_node_bat_main, | ||
| 307 | &ssam_node_tmp_pprof, | ||
| 308 | /* TODO: Tablet mode switch (via POS subsystem) */ | ||
| 309 | &ssam_node_hid_kip_keyboard, | ||
| 310 | &ssam_node_hid_kip_penstash, | ||
| 311 | &ssam_node_hid_kip_touchpad, | ||
| 312 | &ssam_node_hid_kip_fwupd, | ||
| 313 | &ssam_node_hid_sam_sensors, | ||
| 314 | &ssam_node_hid_sam_ucm_ucsi, | ||
| 315 | NULL, | ||
| 316 | }; | ||
| 317 | |||
| 287 | 318 | ||
| 288 | /* -- SSAM platform/meta-hub driver. ---------------------------------------- */ | 319 | /* -- SSAM platform/meta-hub driver. ---------------------------------------- */ |
| 289 | 320 | ||
| @@ -303,6 +334,9 @@ static const struct acpi_device_id ssam_platform_hub_match[] = { · 13 unmodified lines | |||
| 303 | /* Surface Pro 8 */ | 334 | /* Surface Pro 8 */ |
| 304 | { "MSHW0263", (unsigned long)ssam_node_group_sp8 }, | 335 | { "MSHW0263", (unsigned long)ssam_node_group_sp8 }, |
| 305 | 336 | ||
| 337 | /* Surface Pro 9 */ | ||
| 338 | { "MSHW0343", (unsigned long)ssam_node_group_sp9 }, | ||
| 339 | |||
| 306 | /* Surface Book 2 */ | 340 | /* Surface Book 2 */ |
| 307 | { "MSHW0107", (unsigned long)ssam_node_group_gen5 }, | 341 | { "MSHW0107", (unsigned long)ssam_node_group_gen5 }, |
| 308 | 342 | ||
| @@ -324,6 +358,9 @@ static const struct acpi_device_id ssam_platform_hub_match[] = { · 15 unmodified lines | |||
| 324 | /* Surface Laptop 4 (13", Intel) */ | 358 | /* Surface Laptop 4 (13", Intel) */ |
| 325 | { "MSHW0250", (unsigned long)ssam_node_group_sl3 }, | 359 | { "MSHW0250", (unsigned long)ssam_node_group_sl3 }, |
| 326 | 360 | ||
| 361 | /* Surface Laptop 5 */ | ||
| 362 | { "MSHW0350", (unsigned long)ssam_node_group_sl5 }, | ||
| 363 | |||
| 327 | /* Surface Laptop Go 1 */ | 364 | /* Surface Laptop Go 1 */ |
| 328 | { "MSHW0118", (unsigned long)ssam_node_group_slg1 }, | 365 | { "MSHW0118", (unsigned long)ssam_node_group_slg1 }, |
| 329 | 366 | ||
| @@ -564,6 +564,15 @@ static const struct dmi_system_id acer_quirks[] __initconst = { · 563 unmodified lines | |||
| 564 | }, | 564 | }, |
| 565 | .driver_data = (void *)ACER_CAP_KBD_DOCK, | 565 | .driver_data = (void *)ACER_CAP_KBD_DOCK, |
| 566 | }, | 566 | }, |
| 567 | { | ||
| 568 | .callback = set_force_caps, | ||
| 569 | .ident = "Acer Aspire Switch V 10 SW5-017", | ||
| 570 | .matches = { | ||
| 571 | DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Acer"), | ||
| 572 | DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "SW5-017"), | ||
| 573 | }, | ||
| 574 | .driver_data = (void *)ACER_CAP_KBD_DOCK, | ||
| 575 | }, | ||
| 567 | { | 576 | { |
| 568 | .callback = set_force_caps, | 577 | .callback = set_force_caps, |
| 569 | .ident = "Acer One 10 (S1003)", | 578 | .ident = "Acer One 10 (S1003)", |
| @@ -276,7 +276,6 @@ static const struct file_operations amd_pmc_stb_debugfs_fops_v2 = { · 275 unmodified lines | |||
| 276 | .release = amd_pmc_stb_debugfs_release_v2, | 276 | .release = amd_pmc_stb_debugfs_release_v2, |
| 277 | }; | 277 | }; |
| 278 | 278 | ||
| 279 | #if defined(CONFIG_SUSPEND) || defined(CONFIG_DEBUG_FS) | ||
| 280 | static int amd_pmc_setup_smu_logging(struct amd_pmc_dev *dev) | 279 | static int amd_pmc_setup_smu_logging(struct amd_pmc_dev *dev) |
| 281 | { | 280 | { |
| 282 | if (dev->cpu_id == AMD_CPU_ID_PCO) { | 281 | if (dev->cpu_id == AMD_CPU_ID_PCO) { |
| @@ -351,7 +350,6 @@ static int get_metrics_table(struct amd_pmc_dev *pdev, struct smu_metrics *table · 68 unmodified lines | |||
| 351 | memcpy_fromio(table, pdev->smu_virt_addr, sizeof(struct smu_metrics)); | 350 | memcpy_fromio(table, pdev->smu_virt_addr, sizeof(struct smu_metrics)); |
| 352 | return 0; | 351 | return 0; |
| 353 | } | 352 | } |
| 354 | #endif /* CONFIG_SUSPEND || CONFIG_DEBUG_FS */ | ||
| 355 | 353 | ||
| 356 | #ifdef CONFIG_SUSPEND | 354 | #ifdef CONFIG_SUSPEND |
| 357 | static void amd_pmc_validate_deepest(struct amd_pmc_dev *pdev) | 355 | static void amd_pmc_validate_deepest(struct amd_pmc_dev *pdev) |
| @@ -964,6 +962,7 @@ static const struct acpi_device_id amd_pmc_acpi_ids[] = { · 606 unmodified lines | |||
| 964 | {"AMDI0006", 0}, | 962 | {"AMDI0006", 0}, |
| 965 | {"AMDI0007", 0}, | 963 | {"AMDI0007", 0}, |
| 966 | {"AMDI0008", 0}, | 964 | {"AMDI0008", 0}, |
| 965 | {"AMDI0009", 0}, | ||
| 967 | {"AMD0004", 0}, | 966 | {"AMD0004", 0}, |
| 968 | {"AMD0005", 0}, | 967 | {"AMD0005", 0}, |
| 969 | { } | 968 | { } |
| @@ -1738,6 +1738,8 @@ static void asus_wmi_set_xusb2pr(struct asus_wmi *asus) · 1737 unmodified lines | |||
| 1738 | pci_write_config_dword(xhci_pdev, USB_INTEL_XUSB2PR, | 1738 | pci_write_config_dword(xhci_pdev, USB_INTEL_XUSB2PR, |
| 1739 | cpu_to_le32(ports_available)); | 1739 | cpu_to_le32(ports_available)); |
| 1740 | 1740 | ||
| 1741 | pci_dev_put(xhci_pdev); | ||
| 1742 | |||
| 1741 | pr_info("set USB_INTEL_XUSB2PR old: 0x%04x, new: 0x%04x\n", | 1743 | pr_info("set USB_INTEL_XUSB2PR old: 0x%04x, new: 0x%04x\n", |
| 1742 | orig_ports_available, ports_available); | 1744 | orig_ports_available, ports_available); |
| 1743 | } | 1745 | } |
| @@ -90,6 +90,7 @@ enum hp_wmi_event_ids { · 89 unmodified lines | |||
| 90 | HPWMI_PEAKSHIFT_PERIOD = 0x0F, | 90 | HPWMI_PEAKSHIFT_PERIOD = 0x0F, |
| 91 | HPWMI_BATTERY_CHARGE_PERIOD = 0x10, | 91 | HPWMI_BATTERY_CHARGE_PERIOD = 0x10, |
| 92 | HPWMI_SANITIZATION_MODE = 0x17, | 92 | HPWMI_SANITIZATION_MODE = 0x17, |
| 93 | HPWMI_SMART_EXPERIENCE_APP = 0x21, | ||
| 93 | }; | 94 | }; |
| 94 | 95 | ||
| 95 | /* | 96 | /* |
| @@ -859,6 +860,8 @@ static void hp_wmi_notify(u32 value, void *context) · 763 unmodified lines | |||
| 859 | break; | 860 | break; |
| 860 | case HPWMI_SANITIZATION_MODE: | 861 | case HPWMI_SANITIZATION_MODE: |
| 861 | break; | 862 | break; |
| 863 | case HPWMI_SMART_EXPERIENCE_APP: | ||
| 864 | break; | ||
| 862 | default: | 865 | default: |
| 863 | pr_info("Unknown event_id - %d - 0x%x\n", event_id, event_data); | 866 | pr_info("Unknown event_id - %d - 0x%x\n", event_id, event_data); |
| 864 | break; | 867 | break; |
| @@ -136,6 +136,7 @@ struct ideapad_private { · 135 unmodified lines | |||
| 136 | bool dytc : 1; | 136 | bool dytc : 1; |
| 137 | bool fan_mode : 1; | 137 | bool fan_mode : 1; |
| 138 | bool fn_lock : 1; | 138 | bool fn_lock : 1; |
| 139 | bool set_fn_lock_led : 1; | ||
| 139 | bool hw_rfkill_switch : 1; | 140 | bool hw_rfkill_switch : 1; |
| 140 | bool kbd_bl : 1; | 141 | bool kbd_bl : 1; |
| 141 | bool touchpad_ctrl_via_ec : 1; | 142 | bool touchpad_ctrl_via_ec : 1; |
| @@ -154,7 +155,21 @@ MODULE_PARM_DESC(no_bt_rfkill, "No rfkill for bluetooth."); · 12 unmodified lines | |||
| 154 | 155 | ||
| 155 | static bool allow_v4_dytc; | 156 | static bool allow_v4_dytc; |
| 156 | module_param(allow_v4_dytc, bool, 0444); | 157 | module_param(allow_v4_dytc, bool, 0444); |
| 157 | MODULE_PARM_DESC(allow_v4_dytc, "Enable DYTC version 4 platform-profile support."); | 158 | MODULE_PARM_DESC(allow_v4_dytc, |
| 159 | "Enable DYTC version 4 platform-profile support. " | ||
| 160 | "If you need this please report this to: platform-driver-x86@vger.kernel.org"); | ||
| 161 | |||
| 162 | static bool hw_rfkill_switch; | ||
| 163 | module_param(hw_rfkill_switch, bool, 0444); | ||
| 164 | MODULE_PARM_DESC(hw_rfkill_switch, | ||
| 165 | "Enable rfkill support for laptops with a hw on/off wifi switch/slider. " | ||
| 166 | "If you need this please report this to: platform-driver-x86@vger.kernel.org"); | ||
| 167 | |||
| 168 | static bool set_fn_lock_led; | ||
| 169 | module_param(set_fn_lock_led, bool, 0444); | ||
| 170 | MODULE_PARM_DESC(set_fn_lock_led, | ||
| 171 | "Enable driver based updates of the fn-lock LED on fn-lock changes. " | ||
| 172 | "If you need this please report this to: platform-driver-x86@vger.kernel.org"); | ||
| 158 | 173 | ||
| 159 | /* | 174 | /* |
| 160 | * ACPI Helpers | 175 | * ACPI Helpers |
| @@ -1501,6 +1516,9 @@ static void ideapad_wmi_notify(u32 value, void *context) · 1340 unmodified lines | |||
| 1501 | ideapad_input_report(priv, value); | 1516 | ideapad_input_report(priv, value); |
| 1502 | break; | 1517 | break; |
| 1503 | case 208: | 1518 | case 208: |
| 1519 | if (!priv->features.set_fn_lock_led) | ||
| 1520 | break; | ||
| 1521 | |||
| 1504 | if (!eval_hals(priv->adev->handle, &result)) { | 1522 | if (!eval_hals(priv->adev->handle, &result)) { |
| 1505 | bool state = test_bit(HALS_FNLOCK_STATE_BIT, &result); | 1523 | bool state = test_bit(HALS_FNLOCK_STATE_BIT, &result); |
| 1506 | 1524 | ||
| @@ -1514,6 +1532,18 @@ static void ideapad_wmi_notify(u32 value, void *context) · 7 unmodified lines | |||
| 1514 | } | 1532 | } |
| 1515 | #endif | 1533 | #endif |
| 1516 | 1534 | ||
| 1535 | /* On some models we need to call exec_sals(SALS_FNLOCK_ON/OFF) to set the LED */ | ||
| 1536 | static const struct dmi_system_id set_fn_lock_led_list[] = { | ||
| 1537 | { | ||
| 1538 | /* https://bugzilla.kernel.org/show_bug.cgi?id=212671 */ | ||
| 1539 | .matches = { | ||
| 1540 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
| 1541 | DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Legion R7000P2020H"), | ||
| 1542 | } | ||
| 1543 | }, | ||
| 1544 | {} | ||
| 1545 | }; | ||
| 1546 | |||
| 1517 | /* | 1547 | /* |
| 1518 | * Some ideapads have a hardware rfkill switch, but most do not have one. | 1548 | * Some ideapads have a hardware rfkill switch, but most do not have one. |
| 1519 | * Reading VPCCMD_R_RF always results in 0 on models without a hardware rfkill, | 1549 | * Reading VPCCMD_R_RF always results in 0 on models without a hardware rfkill, |
| @@ -1556,7 +1586,10 @@ static void ideapad_check_features(struct ideapad_private *priv) · 36 unmodified lines | |||
| 1556 | acpi_handle handle = priv->adev->handle; | 1586 | acpi_handle handle = priv->adev->handle; |
| 1557 | unsigned long val; | 1587 | unsigned long val; |
| 1558 | 1588 | ||
| 1559 | priv->features.hw_rfkill_switch = dmi_check_system(hw_rfkill_list); | 1589 | priv->features.set_fn_lock_led = |
| 1590 | set_fn_lock_led || dmi_check_system(set_fn_lock_led_list); | ||
| 1591 | priv->features.hw_rfkill_switch = | ||
| 1592 | hw_rfkill_switch || dmi_check_system(hw_rfkill_list); | ||
| 1560 | 1593 | ||
| 1561 | /* Most ideapads with ELAN0634 touchpad don't use EC touchpad switch */ | 1594 | /* Most ideapads with ELAN0634 touchpad don't use EC touchpad switch */ |
| 1562 | if (acpi_dev_present("ELAN0634", NULL, -1)) | 1595 | if (acpi_dev_present("ELAN0634", NULL, -1)) |
| @@ -18,6 +18,8 @@ · 17 unmodified lines | |||
| 18 | #include <asm/cpu_device_id.h> | 18 | #include <asm/cpu_device_id.h> |
| 19 | #include <asm/intel-family.h> | 19 | #include <asm/intel-family.h> |
| 20 | 20 | ||
| 21 | #include <xen/xen.h> | ||
| 22 | |||
| 21 | static void intel_pmc_core_release(struct device *dev) | 23 | static void intel_pmc_core_release(struct device *dev) |
| 22 | { | 24 | { |
| 23 | kfree(dev); | 25 | kfree(dev); |
| @@ -53,6 +55,13 @@ static int __init pmc_core_platform_init(void) · 29 unmodified lines | |||
| 53 | if (acpi_dev_present("INT33A1", NULL, -1)) | 55 | if (acpi_dev_present("INT33A1", NULL, -1)) |
| 54 | return -ENODEV; | 56 | return -ENODEV; |
| 55 | 57 | ||
| 58 | /* | ||
| 59 | * Skip forcefully attaching the device for VMs. Make an exception for | ||
| 60 | * Xen dom0, which does have full hardware access. | ||
| 61 | */ | ||
| 62 | if (cpu_feature_enabled(X86_FEATURE_HYPERVISOR) && !xen_initial_domain()) | ||
| 63 | return -ENODEV; | ||
| 64 | |||
| 56 | if (!x86_match_cpu(intel_pmc_core_platform_ids)) | 65 | if (!x86_match_cpu(intel_pmc_core_platform_ids)) |
| 57 | return -ENODEV; | 66 | return -ENODEV; |
| 58 | 67 | ||
| @@ -4497,6 +4497,14 @@ static const struct dmi_system_id fwbug_list[] __initconst = { · 4496 unmodified lines | |||
| 4497 | DMI_MATCH(DMI_PRODUCT_NAME, "21A0"), | 4497 | DMI_MATCH(DMI_PRODUCT_NAME, "21A0"), |
| 4498 | } | 4498 | } |
| 4499 | }, | 4499 | }, |
| 4500 | { | ||
| 4501 | .ident = "P14s Gen2 AMD", | ||
| 4502 | .driver_data = &quirk_s2idle_bug, | ||
| 4503 | .matches = { | ||
| 4504 | DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), | ||
| 4505 | DMI_MATCH(DMI_PRODUCT_NAME, "21A1"), | ||
| 4506 | } | ||
| 4507 | }, | ||
| 4500 | {} | 4508 | {} |
| 4501 | }; | 4509 | }; |
| 4502 | 4510 | ||
| @@ -636,6 +636,7 @@ dcssblk_add_store(struct device *dev, struct device_attribute *attr, const char · 635 unmodified lines | |||
| 636 | dev_info->gd->minors = DCSSBLK_MINORS_PER_DISK; | 636 | dev_info->gd->minors = DCSSBLK_MINORS_PER_DISK; |
| 637 | dev_info->gd->fops = &dcssblk_devops; | 637 | dev_info->gd->fops = &dcssblk_devops; |
| 638 | dev_info->gd->private_data = dev_info; | 638 | dev_info->gd->private_data = dev_info; |
| 639 | dev_info->gd->flags |= GENHD_FL_NO_PART; | ||
| 639 | blk_queue_logical_block_size(dev_info->gd->queue, 4096); | 640 | blk_queue_logical_block_size(dev_info->gd->queue, 4096); |
| 640 | blk_queue_flag_set(QUEUE_FLAG_DAX, dev_info->gd->queue); | 641 | blk_queue_flag_set(QUEUE_FLAG_DAX, dev_info->gd->queue); |
| 641 | 642 | ||
| @@ -884,7 +884,7 @@ static int zfcp_fsf_req_send(struct zfcp_fsf_req *req) · 883 unmodified lines | |||
| 884 | const bool is_srb = zfcp_fsf_req_is_status_read_buffer(req); | 884 | const bool is_srb = zfcp_fsf_req_is_status_read_buffer(req); |
| 885 | struct zfcp_adapter *adapter = req->adapter; | 885 | struct zfcp_adapter *adapter = req->adapter; |
| 886 | struct zfcp_qdio *qdio = adapter->qdio; | 886 | struct zfcp_qdio *qdio = adapter->qdio; |
| 887 | int req_id = req->req_id; | 887 | unsigned long req_id = req->req_id; |
| 888 | 888 | ||
| 889 | zfcp_reqlist_add(adapter->req_list, req); | 889 | zfcp_reqlist_add(adapter->req_list, req); |
| 890 | 890 | ||
| @@ -3265,7 +3265,8 @@ void mpi3mr_process_op_reply_desc(struct mpi3mr_ioc *mrioc, · 3264 unmodified lines | |||
| 3265 | } | 3265 | } |
| 3266 | 3266 | ||
| 3267 | if (scmd->result != (DID_OK << 16) && (scmd->cmnd[0] != ATA_12) && | 3267 | if (scmd->result != (DID_OK << 16) && (scmd->cmnd[0] != ATA_12) && |
| 3268 | (scmd->cmnd[0] != ATA_16)) { | 3268 | (scmd->cmnd[0] != ATA_16) && |
| 3269 | mrioc->logging_level & MPI3_DEBUG_SCSI_ERROR) { | ||
| 3269 | ioc_info(mrioc, "%s :scmd->result 0x%x\n", __func__, | 3270 | ioc_info(mrioc, "%s :scmd->result 0x%x\n", __func__, |
| 3270 | scmd->result); | 3271 | scmd->result); |
| 3271 | scsi_print_command(scmd); | 3272 | scsi_print_command(scmd); |
| @@ -7323,8 +7323,12 @@ static int sdebug_add_host_helper(int per_host_idx) · 7322 unmodified lines | |||
| 7323 | dev_set_name(&sdbg_host->dev, "adapter%d", sdebug_num_hosts); | 7323 | dev_set_name(&sdbg_host->dev, "adapter%d", sdebug_num_hosts); |
| 7324 | 7324 | ||
| 7325 | error = device_register(&sdbg_host->dev); | 7325 | error = device_register(&sdbg_host->dev); |
| 7326 | if (error) | 7326 | if (error) { |
| 7327 | spin_lock(&sdebug_host_list_lock); | ||
| 7328 | list_del(&sdbg_host->host_list); | ||
| 7329 | spin_unlock(&sdebug_host_list_lock); | ||
| 7327 | goto clean; | 7330 | goto clean; |
| 7331 | } | ||
| 7328 | 7332 | ||
| 7329 | ++sdebug_num_hosts; | 7333 | ++sdebug_num_hosts; |
| 7330 | return 0; | 7334 | return 0; |
| @@ -231,7 +231,7 @@ iscsi_create_endpoint(int dd_size) · 230 unmodified lines | |||
| 231 | dev_set_name(&ep->dev, "ep-%d", id); | 231 | dev_set_name(&ep->dev, "ep-%d", id); |
| 232 | err = device_register(&ep->dev); | 232 | err = device_register(&ep->dev); |
| 233 | if (err) | 233 | if (err) |
| 234 | goto free_id; | 234 | goto put_dev; |
| 235 | 235 | ||
| 236 | err = sysfs_create_group(&ep->dev.kobj, &iscsi_endpoint_group); | 236 | err = sysfs_create_group(&ep->dev.kobj, &iscsi_endpoint_group); |
| 237 | if (err) | 237 | if (err) |
| @@ -245,10 +245,12 @@ unregister_dev: · 7 unmodified lines | |||
| 245 | device_unregister(&ep->dev); | 245 | device_unregister(&ep->dev); |
| 246 | return NULL; | 246 | return NULL; |
| 247 | 247 | ||
| 248 | free_id: | 248 | put_dev: |
| 249 | mutex_lock(&iscsi_ep_idr_mutex); | 249 | mutex_lock(&iscsi_ep_idr_mutex); |
| 250 | idr_remove(&iscsi_ep_idr, id); | 250 | idr_remove(&iscsi_ep_idr, id); |
| 251 | mutex_unlock(&iscsi_ep_idr_mutex); | 251 | mutex_unlock(&iscsi_ep_idr_mutex); |
| 252 | put_device(&ep->dev); | ||
| 253 | return NULL; | ||
| 252 | free_ep: | 254 | free_ep: |
| 253 | kfree(ep); | 255 | kfree(ep); |
| 254 | return NULL; | 256 | return NULL; |
| @@ -766,7 +768,7 @@ iscsi_create_iface(struct Scsi_Host *shost, struct iscsi_transport *transport, · 511 unmodified lines | |||
| 766 | 768 | ||
| 767 | err = device_register(&iface->dev); | 769 | err = device_register(&iface->dev); |
| 768 | if (err) | 770 | if (err) |
| 769 | goto free_iface; | 771 | goto put_dev; |
| 770 | 772 | ||
| 771 | err = sysfs_create_group(&iface->dev.kobj, &iscsi_iface_group); | 773 | err = sysfs_create_group(&iface->dev.kobj, &iscsi_iface_group); |
| 772 | if (err) | 774 | if (err) |
| @@ -780,9 +782,8 @@ unreg_iface: · 7 unmodified lines | |||
| 780 | device_unregister(&iface->dev); | 782 | device_unregister(&iface->dev); |
| 781 | return NULL; | 783 | return NULL; |
| 782 | 784 | ||
| 783 | free_iface: | 785 | put_dev: |
| 784 | put_device(iface->dev.parent); | 786 | put_device(&iface->dev); |
| 785 | kfree(iface); | ||
| 786 | return NULL; | 787 | return NULL; |
| 787 | } | 788 | } |
| 788 | EXPORT_SYMBOL_GPL(iscsi_create_iface); | 789 | EXPORT_SYMBOL_GPL(iscsi_create_iface); |
| @@ -1251,15 +1252,15 @@ iscsi_create_flashnode_sess(struct Scsi_Host *shost, int index, · 462 unmodified lines | |||
| 1251 | 1252 | ||
| 1252 | err = device_register(&fnode_sess->dev); | 1253 | err = device_register(&fnode_sess->dev); |
| 1253 | if (err) | 1254 | if (err) |
| 1254 | goto free_fnode_sess; | 1255 | goto put_dev; |
| 1255 | 1256 | ||
| 1256 | if (dd_size) | 1257 | if (dd_size) |
| 1257 | fnode_sess->dd_data = &fnode_sess[1]; | 1258 | fnode_sess->dd_data = &fnode_sess[1]; |
| 1258 | 1259 | ||
| 1259 | return fnode_sess; | 1260 | return fnode_sess; |
| 1260 | 1261 | ||
| 1261 | free_fnode_sess: | 1262 | put_dev: |
| 1262 | kfree(fnode_sess); | 1263 | put_device(&fnode_sess->dev); |
| 1263 | return NULL; | 1264 | return NULL; |
| 1264 | } | 1265 | } |
| 1265 | EXPORT_SYMBOL_GPL(iscsi_create_flashnode_sess); | 1266 | EXPORT_SYMBOL_GPL(iscsi_create_flashnode_sess); |
| @@ -1299,15 +1300,15 @@ iscsi_create_flashnode_conn(struct Scsi_Host *shost, · 33 unmodified lines | |||
| 1299 | 1300 | ||
| 1300 | err = device_register(&fnode_conn->dev); | 1301 | err = device_register(&fnode_conn->dev); |
| 1301 | if (err) | 1302 | if (err) |
| 1302 | goto free_fnode_conn; | 1303 | goto put_dev; |
| 1303 | 1304 | ||
| 1304 | if (dd_size) | 1305 | if (dd_size) |
| 1305 | fnode_conn->dd_data = &fnode_conn[1]; | 1306 | fnode_conn->dd_data = &fnode_conn[1]; |
| 1306 | 1307 | ||
| 1307 | return fnode_conn; | 1308 | return fnode_conn; |
| 1308 | 1309 | ||
| 1309 | free_fnode_conn: | 1310 | put_dev: |
| 1310 | kfree(fnode_conn); | 1311 | put_device(&fnode_conn->dev); |
| 1311 | return NULL; | 1312 | return NULL; |
| 1312 | } | 1313 | } |
| 1313 | EXPORT_SYMBOL_GPL(iscsi_create_flashnode_conn); | 1314 | EXPORT_SYMBOL_GPL(iscsi_create_flashnode_conn); |
| @@ -4815,7 +4816,7 @@ iscsi_register_transport(struct iscsi_transport *tt) · 3501 unmodified lines | |||
| 4815 | dev_set_name(&priv->dev, "%s", tt->name); | 4816 | dev_set_name(&priv->dev, "%s", tt->name); |
| 4816 | err = device_register(&priv->dev); | 4817 | err = device_register(&priv->dev); |
| 4817 | if (err) | 4818 | if (err) |
| 4818 | goto free_priv; | 4819 | goto put_dev; |
| 4819 | 4820 | ||
| 4820 | err = sysfs_create_group(&priv->dev.kobj, &iscsi_transport_group); | 4821 | err = sysfs_create_group(&priv->dev.kobj, &iscsi_transport_group); |
| 4821 | if (err) | 4822 | if (err) |
| @@ -4850,8 +4851,8 @@ iscsi_register_transport(struct iscsi_transport *tt) · 28 unmodified lines | |||
| 4850 | unregister_dev: | 4851 | unregister_dev: |
| 4851 | device_unregister(&priv->dev); | 4852 | device_unregister(&priv->dev); |
| 4852 | return NULL; | 4853 | return NULL; |
| 4853 | free_priv: | 4854 | put_dev: |
| 4854 | kfree(priv); | 4855 | put_device(&priv->dev); |
| 4855 | return NULL; | 4856 | return NULL; |
| 4856 | } | 4857 | } |
| 4857 | EXPORT_SYMBOL_GPL(iscsi_register_transport); | 4858 | EXPORT_SYMBOL_GPL(iscsi_register_transport); |
| @@ -839,6 +839,8 @@ static struct siox_device *siox_device_add(struct siox_master *smaster, · 838 unmodified lines | |||
| 839 | 839 | ||
| 840 | err_device_register: | 840 | err_device_register: |
| 841 | /* don't care to make the buffer smaller again */ | 841 | /* don't care to make the buffer smaller again */ |
| 842 | put_device(&sdevice->dev); | ||
| 843 | sdevice = NULL; | ||
| 842 | 844 | ||
| 843 | err_buf_alloc: | 845 | err_buf_alloc: |
| 844 | siox_master_unlock(smaster); | 846 | siox_master_unlock(smaster); |
| @@ -23,7 +23,7 @@ config SLIM_QCOM_CTRL · 22 unmodified lines | |||
| 23 | config SLIM_QCOM_NGD_CTRL | 23 | config SLIM_QCOM_NGD_CTRL |
| 24 | tristate "Qualcomm SLIMbus Satellite Non-Generic Device Component" | 24 | tristate "Qualcomm SLIMbus Satellite Non-Generic Device Component" |
| 25 | depends on HAS_IOMEM && DMA_ENGINE && NET | 25 | depends on HAS_IOMEM && DMA_ENGINE && NET |
| 26 | depends on QCOM_RPROC_COMMON || COMPILE_TEST | 26 | depends on QCOM_RPROC_COMMON || (COMPILE_TEST && !QCOM_RPROC_COMMON) |
| 27 | depends on ARCH_QCOM || COMPILE_TEST | 27 | depends on ARCH_QCOM || COMPILE_TEST |
| 28 | select QCOM_QMI_HELPERS | 28 | select QCOM_QMI_HELPERS |
| 29 | select QCOM_PDR_HELPERS | 29 | select QCOM_PDR_HELPERS |
| @@ -67,10 +67,10 @@ static const int slim_presence_rate_table[] = { · 66 unmodified lines | |||
| 67 | 384000, | 67 | 384000, |
| 68 | 768000, | 68 | 768000, |
| 69 | 0, /* Reserved */ | 69 | 0, /* Reserved */ |
| 70 | 110250, | 70 | 11025, |
| 71 | 220500, | 71 | 22050, |
| 72 | 441000, | 72 | 44100, |
| 73 | 882000, | 73 | 88200, |
| 74 | 176400, | 74 | 176400, |
| 75 | 352800, | 75 | 352800, |
| 76 | 705600, | 76 | 705600, |
| @@ -11,6 +11,7 @@ · 10 unmodified lines | |||
| 11 | #include <linux/platform_device.h> | 11 | #include <linux/platform_device.h> |
| 12 | #include <linux/arm-smccc.h> | 12 | #include <linux/arm-smccc.h> |
| 13 | #include <linux/of.h> | 13 | #include <linux/of.h> |
| 14 | #include <linux/clk.h> | ||
| 14 | 15 | ||
| 15 | #define REV_B1 0x21 | 16 | #define REV_B1 0x21 |
| 16 | 17 | ||
| @@ -56,6 +57,7 @@ static u32 __init imx8mq_soc_revision(void) · 39 unmodified lines | |||
| 56 | void __iomem *ocotp_base; | 57 | void __iomem *ocotp_base; |
| 57 | u32 magic; | 58 | u32 magic; |
| 58 | u32 rev; | 59 | u32 rev; |
| 60 | struct clk *clk; | ||
| 59 | 61 | ||
| 60 | np = of_find_compatible_node(NULL, NULL, "fsl,imx8mq-ocotp"); | 62 | np = of_find_compatible_node(NULL, NULL, "fsl,imx8mq-ocotp"); |
| 61 | if (!np) | 63 | if (!np) |
| @@ -63,6 +65,13 @@ static u32 __init imx8mq_soc_revision(void) · 1 unmodified line | |||
| 63 | 65 | ||
| 64 | ocotp_base = of_iomap(np, 0); | 66 | ocotp_base = of_iomap(np, 0); |
| 65 | WARN_ON(!ocotp_base); | 67 | WARN_ON(!ocotp_base); |
| 68 | clk = of_clk_get_by_name(np, NULL); | ||
| 69 | if (!clk) { | ||
| 70 | WARN_ON(!clk); | ||
| 71 | return 0; | ||
| 72 | } | ||
| 73 | |||
| 74 | clk_prepare_enable(clk); | ||
| 66 | 75 | ||
| 67 | /* | 76 | /* |
| 68 | * SOC revision on older imx8mq is not available in fuses so query | 77 | * SOC revision on older imx8mq is not available in fuses so query |
| @@ -79,6 +88,8 @@ static u32 __init imx8mq_soc_revision(void) · 10 unmodified lines | |||
| 79 | soc_uid <<= 32; | 88 | soc_uid <<= 32; |
| 80 | soc_uid |= readl_relaxed(ocotp_base + OCOTP_UID_LOW); | 89 | soc_uid |= readl_relaxed(ocotp_base + OCOTP_UID_LOW); |
| 81 | 90 | ||
| 91 | clk_disable_unprepare(clk); | ||
| 92 | clk_put(clk); | ||
| 82 | iounmap(ocotp_base); | 93 | iounmap(ocotp_base); |
| 83 | of_node_put(np); | 94 | of_node_put(np); |
| 84 | 95 | ||
| @@ -439,7 +439,7 @@ int rtllib_wx_set_essid(struct rtllib_device *ieee, · 438 unmodified lines | |||
| 439 | union iwreq_data *wrqu, char *extra) | 439 | union iwreq_data *wrqu, char *extra) |
| 440 | { | 440 | { |
| 441 | 441 | ||
| 442 | int ret = 0, len, i; | 442 | int ret = 0, len; |
| 443 | short proto_started; | 443 | short proto_started; |
| 444 | unsigned long flags; | 444 | unsigned long flags; |
| 445 | 445 | ||
| @@ -455,13 +455,6 @@ int rtllib_wx_set_essid(struct rtllib_device *ieee, · 9 unmodified lines | |||
| 455 | goto out; | 455 | goto out; |
| 456 | } | 456 | } |
| 457 | 457 | ||
| 458 | for (i = 0; i < len; i++) { | ||
| 459 | if (extra[i] < 0) { | ||
| 460 | ret = -1; | ||
| 461 | goto out; | ||
| 462 | } | ||
| 463 | } | ||
| 464 | |||
| 465 | if (proto_started) | 458 | if (proto_started) |
| 466 | rtllib_stop_protocol(ieee, true); | 459 | rtllib_stop_protocol(ieee, true); |
| 467 | 460 | ||
| @@ -397,6 +397,7 @@ static int tcm_loop_setup_hba_bus(struct tcm_loop_hba *tl_hba, int tcm_loop_host · 396 unmodified lines | |||
| 397 | ret = device_register(&tl_hba->dev); | 397 | ret = device_register(&tl_hba->dev); |
| 398 | if (ret) { | 398 | if (ret) { |
| 399 | pr_err("device_register() failed for tl_hba->dev: %d\n", ret); | 399 | pr_err("device_register() failed for tl_hba->dev: %d\n", ret); |
| 400 | put_device(&tl_hba->dev); | ||
| 400 | return -ENODEV; | 401 | return -ENODEV; |
| 401 | } | 402 | } |
| 402 | 403 | ||
| @@ -1073,7 +1074,7 @@ check_len: · 670 unmodified lines | |||
| 1073 | */ | 1074 | */ |
| 1074 | ret = tcm_loop_setup_hba_bus(tl_hba, tcm_loop_hba_no_cnt); | 1075 | ret = tcm_loop_setup_hba_bus(tl_hba, tcm_loop_hba_no_cnt); |
| 1075 | if (ret) | 1076 | if (ret) |
| 1076 | goto out; | 1077 | return ERR_PTR(ret); |
| 1077 | 1078 | ||
| 1078 | sh = tl_hba->sh; | 1079 | sh = tl_hba->sh; |
| 1079 | tcm_loop_hba_no_cnt++; | 1080 | tcm_loop_hba_no_cnt++; |
| @@ -264,7 +264,7 @@ struct gsm_mux { · 263 unmodified lines | |||
| 264 | bool constipated; /* Asked by remote to shut up */ | 264 | bool constipated; /* Asked by remote to shut up */ |
| 265 | bool has_devices; /* Devices were registered */ | 265 | bool has_devices; /* Devices were registered */ |
| 266 | 266 | ||
| 267 | struct mutex tx_mutex; | 267 | spinlock_t tx_lock; |
| 268 | unsigned int tx_bytes; /* TX data outstanding */ | 268 | unsigned int tx_bytes; /* TX data outstanding */ |
| 269 | #define TX_THRESH_HI 8192 | 269 | #define TX_THRESH_HI 8192 |
| 270 | #define TX_THRESH_LO 2048 | 270 | #define TX_THRESH_LO 2048 |
| @@ -272,7 +272,7 @@ struct gsm_mux { · 1 unmodified line | |||
| 272 | struct list_head tx_data_list; /* Pending data packets */ | 272 | struct list_head tx_data_list; /* Pending data packets */ |
| 273 | 273 | ||
| 274 | /* Control messages */ | 274 | /* Control messages */ |
| 275 | struct delayed_work kick_timeout; /* Kick TX queuing on timeout */ | 275 | struct timer_list kick_timer; /* Kick TX queuing on timeout */ |
| 276 | struct timer_list t2_timer; /* Retransmit timer for commands */ | 276 | struct timer_list t2_timer; /* Retransmit timer for commands */ |
| 277 | int cretries; /* Command retry counter */ | 277 | int cretries; /* Command retry counter */ |
| 278 | struct gsm_control *pending_cmd;/* Our current pending command */ | 278 | struct gsm_control *pending_cmd;/* Our current pending command */ |
| @@ -700,6 +700,7 @@ static int gsm_send(struct gsm_mux *gsm, int addr, int cr, int control) · 421 unmodified lines | |||
| 700 | struct gsm_msg *msg; | 700 | struct gsm_msg *msg; |
| 701 | u8 *dp; | 701 | u8 *dp; |
| 702 | int ocr; | 702 | int ocr; |
| 703 | unsigned long flags; | ||
| 703 | 704 | ||
| 704 | msg = gsm_data_alloc(gsm, addr, 0, control); | 705 | msg = gsm_data_alloc(gsm, addr, 0, control); |
| 705 | if (!msg) | 706 | if (!msg) |
| @@ -721,10 +722,10 @@ static int gsm_send(struct gsm_mux *gsm, int addr, int cr, int control) · 15 unmodified lines | |||
| 721 | 722 | ||
| 722 | gsm_print_packet("Q->", addr, cr, control, NULL, 0); | 723 | gsm_print_packet("Q->", addr, cr, control, NULL, 0); |
| 723 | 724 | ||
| 724 | mutex_lock(&gsm->tx_mutex); | 725 | spin_lock_irqsave(&gsm->tx_lock, flags); |
| 725 | list_add_tail(&msg->list, &gsm->tx_ctrl_list); | 726 | list_add_tail(&msg->list, &gsm->tx_ctrl_list); |
| 726 | gsm->tx_bytes += msg->len; | 727 | gsm->tx_bytes += msg->len; |
| 727 | mutex_unlock(&gsm->tx_mutex); | 728 | spin_unlock_irqrestore(&gsm->tx_lock, flags); |
| 728 | gsmld_write_trigger(gsm); | 729 | gsmld_write_trigger(gsm); |
| 729 | 730 | ||
| 730 | return 0; | 731 | return 0; |
| @@ -749,7 +750,7 @@ static void gsm_dlci_clear_queues(struct gsm_mux *gsm, struct gsm_dlci *dlci) · 18 unmodified lines | |||
| 749 | spin_unlock_irqrestore(&dlci->lock, flags); | 750 | spin_unlock_irqrestore(&dlci->lock, flags); |
| 750 | 751 | ||
| 751 | /* Clear data packets in MUX write queue */ | 752 | /* Clear data packets in MUX write queue */ |
| 752 | mutex_lock(&gsm->tx_mutex); | 753 | spin_lock_irqsave(&gsm->tx_lock, flags); |
| 753 | list_for_each_entry_safe(msg, nmsg, &gsm->tx_data_list, list) { | 754 | list_for_each_entry_safe(msg, nmsg, &gsm->tx_data_list, list) { |
| 754 | if (msg->addr != addr) | 755 | if (msg->addr != addr) |
| 755 | continue; | 756 | continue; |
| @@ -757,7 +758,7 @@ static void gsm_dlci_clear_queues(struct gsm_mux *gsm, struct gsm_dlci *dlci) · 1 unmodified line | |||
| 757 | list_del(&msg->list); | 758 | list_del(&msg->list); |
| 758 | kfree(msg); | 759 | kfree(msg); |
| 759 | } | 760 | } |
| 760 | mutex_unlock(&gsm->tx_mutex); | 761 | spin_unlock_irqrestore(&gsm->tx_lock, flags); |
| 761 | } | 762 | } |
| 762 | 763 | ||
| 763 | /** | 764 | /** |
| @@ -1028,7 +1029,7 @@ static void __gsm_data_queue(struct gsm_dlci *dlci, struct gsm_msg *msg) · 264 unmodified lines | |||
| 1028 | gsm->tx_bytes += msg->len; | 1029 | gsm->tx_bytes += msg->len; |
| 1029 | 1030 | ||
| 1030 | gsmld_write_trigger(gsm); | 1031 | gsmld_write_trigger(gsm); |
| 1031 | schedule_delayed_work(&gsm->kick_timeout, 10 * gsm->t1 * HZ / 100); | 1032 | mod_timer(&gsm->kick_timer, jiffies + 10 * gsm->t1 * HZ / 100); |
| 1032 | } | 1033 | } |
| 1033 | 1034 | ||
| 1034 | /** | 1035 | /** |
| @@ -1043,9 +1044,10 @@ static void __gsm_data_queue(struct gsm_dlci *dlci, struct gsm_msg *msg) · 8 unmodified lines | |||
| 1043 | 1044 | ||
| 1044 | static void gsm_data_queue(struct gsm_dlci *dlci, struct gsm_msg *msg) | 1045 | static void gsm_data_queue(struct gsm_dlci *dlci, struct gsm_msg *msg) |
| 1045 | { | 1046 | { |
| 1046 | mutex_lock(&dlci->gsm->tx_mutex); | 1047 | unsigned long flags; |
| 1048 | spin_lock_irqsave(&dlci->gsm->tx_lock, flags); | ||
| 1047 | __gsm_data_queue(dlci, msg); | 1049 | __gsm_data_queue(dlci, msg); |
| 1048 | mutex_unlock(&dlci->gsm->tx_mutex); | 1050 | spin_unlock_irqrestore(&dlci->gsm->tx_lock, flags); |
| 1049 | } | 1051 | } |
| 1050 | 1052 | ||
| 1051 | /** | 1053 | /** |
| @@ -1057,7 +1059,7 @@ static void gsm_data_queue(struct gsm_dlci *dlci, struct gsm_msg *msg) · 5 unmodified lines | |||
| 1057 | * is data. Keep to the MRU of the mux. This path handles the usual tty | 1059 | * is data. Keep to the MRU of the mux. This path handles the usual tty |
| 1058 | * interface which is a byte stream with optional modem data. | 1060 | * interface which is a byte stream with optional modem data. |
| 1059 | * | 1061 | * |
| 1060 | * Caller must hold the tx_mutex of the mux. | 1062 | * Caller must hold the tx_lock of the mux. |
| 1061 | */ | 1063 | */ |
| 1062 | 1064 | ||
| 1063 | static int gsm_dlci_data_output(struct gsm_mux *gsm, struct gsm_dlci *dlci) | 1065 | static int gsm_dlci_data_output(struct gsm_mux *gsm, struct gsm_dlci *dlci) |
| @@ -1117,7 +1119,7 @@ static int gsm_dlci_data_output(struct gsm_mux *gsm, struct gsm_dlci *dlci) · 53 unmodified lines | |||
| 1117 | * is data. Keep to the MRU of the mux. This path handles framed data | 1119 | * is data. Keep to the MRU of the mux. This path handles framed data |
| 1118 | * queued as skbuffs to the DLCI. | 1120 | * queued as skbuffs to the DLCI. |
| 1119 | * | 1121 | * |
| 1120 | * Caller must hold the tx_mutex of the mux. | 1122 | * Caller must hold the tx_lock of the mux. |
| 1121 | */ | 1123 | */ |
| 1122 | 1124 | ||
| 1123 | static int gsm_dlci_data_output_framed(struct gsm_mux *gsm, | 1125 | static int gsm_dlci_data_output_framed(struct gsm_mux *gsm, |
| @@ -1133,7 +1135,7 @@ static int gsm_dlci_data_output_framed(struct gsm_mux *gsm, · 9 unmodified lines | |||
| 1133 | if (dlci->adaption == 4) | 1135 | if (dlci->adaption == 4) |
| 1134 | overhead = 1; | 1136 | overhead = 1; |
| 1135 | 1137 | ||
| 1136 | /* dlci->skb is locked by tx_mutex */ | 1138 | /* dlci->skb is locked by tx_lock */ |
| 1137 | if (dlci->skb == NULL) { | 1139 | if (dlci->skb == NULL) { |
| 1138 | dlci->skb = skb_dequeue_tail(&dlci->skb_list); | 1140 | dlci->skb = skb_dequeue_tail(&dlci->skb_list); |
| 1139 | if (dlci->skb == NULL) | 1141 | if (dlci->skb == NULL) |
| @@ -1187,7 +1189,7 @@ static int gsm_dlci_data_output_framed(struct gsm_mux *gsm, · 47 unmodified lines | |||
| 1187 | * Push an empty frame in to the transmit queue to update the modem status | 1189 | * Push an empty frame in to the transmit queue to update the modem status |
| 1188 | * bits and to transmit an optional break. | 1190 | * bits and to transmit an optional break. |
| 1189 | * | 1191 | * |
| 1190 | * Caller must hold the tx_mutex of the mux. | 1192 | * Caller must hold the tx_lock of the mux. |
| 1191 | */ | 1193 | */ |
| 1192 | 1194 | ||
| 1193 | static int gsm_dlci_modem_output(struct gsm_mux *gsm, struct gsm_dlci *dlci, | 1195 | static int gsm_dlci_modem_output(struct gsm_mux *gsm, struct gsm_dlci *dlci, |
| @@ -1301,12 +1303,13 @@ static int gsm_dlci_data_sweep(struct gsm_mux *gsm) · 107 unmodified lines | |||
| 1301 | 1303 | ||
| 1302 | static void gsm_dlci_data_kick(struct gsm_dlci *dlci) | 1304 | static void gsm_dlci_data_kick(struct gsm_dlci *dlci) |
| 1303 | { | 1305 | { |
| 1306 | unsigned long flags; | ||
| 1304 | int sweep; | 1307 | int sweep; |
| 1305 | 1308 | ||
| 1306 | if (dlci->constipated) | 1309 | if (dlci->constipated) |
| 1307 | return; | 1310 | return; |
| 1308 | 1311 | ||
| 1309 | mutex_lock(&dlci->gsm->tx_mutex); | 1312 | spin_lock_irqsave(&dlci->gsm->tx_lock, flags); |
| 1310 | /* If we have nothing running then we need to fire up */ | 1313 | /* If we have nothing running then we need to fire up */ |
| 1311 | sweep = (dlci->gsm->tx_bytes < TX_THRESH_LO); | 1314 | sweep = (dlci->gsm->tx_bytes < TX_THRESH_LO); |
| 1312 | if (dlci->gsm->tx_bytes == 0) { | 1315 | if (dlci->gsm->tx_bytes == 0) { |
| @@ -1317,7 +1320,7 @@ static void gsm_dlci_data_kick(struct gsm_dlci *dlci) · 4 unmodified lines | |||
| 1317 | } | 1320 | } |
| 1318 | if (sweep) | 1321 | if (sweep) |
| 1319 | gsm_dlci_data_sweep(dlci->gsm); | 1322 | gsm_dlci_data_sweep(dlci->gsm); |
| 1320 | mutex_unlock(&dlci->gsm->tx_mutex); | 1323 | spin_unlock_irqrestore(&dlci->gsm->tx_lock, flags); |
| 1321 | } | 1324 | } |
| 1322 | 1325 | ||
| 1323 | /* | 1326 | /* |
| @@ -1708,7 +1711,7 @@ static struct gsm_control *gsm_control_send(struct gsm_mux *gsm, · 384 unmodified lines | |||
| 1708 | unsigned int command, u8 *data, int clen) | 1711 | unsigned int command, u8 *data, int clen) |
| 1709 | { | 1712 | { |
| 1710 | struct gsm_control *ctrl = kzalloc(sizeof(struct gsm_control), | 1713 | struct gsm_control *ctrl = kzalloc(sizeof(struct gsm_control), |
| 1711 | GFP_KERNEL); | 1714 | GFP_ATOMIC); |
| 1712 | unsigned long flags; | 1715 | unsigned long flags; |
| 1713 | if (ctrl == NULL) | 1716 | if (ctrl == NULL) |
| 1714 | return NULL; | 1717 | return NULL; |
| @@ -2019,23 +2022,24 @@ static void gsm_dlci_command(struct gsm_dlci *dlci, const u8 *data, int len) · 304 unmodified lines | |||
| 2019 | } | 2022 | } |
| 2020 | 2023 | ||
| 2021 | /** | 2024 | /** |
| 2022 | * gsm_kick_timeout - transmit if possible | 2025 | * gsm_kick_timer - transmit if possible |
| 2023 | * @work: work contained in our gsm object | 2026 | * @t: timer contained in our gsm object |
| 2024 | * | 2027 | * |
| 2025 | * Transmit data from DLCIs if the queue is empty. We can't rely on | 2028 | * Transmit data from DLCIs if the queue is empty. We can't rely on |
| 2026 | * a tty wakeup except when we filled the pipe so we need to fire off | 2029 | * a tty wakeup except when we filled the pipe so we need to fire off |
| 2027 | * new data ourselves in other cases. | 2030 | * new data ourselves in other cases. |
| 2028 | */ | 2031 | */ |
| 2029 | static void gsm_kick_timeout(struct work_struct *work) | 2032 | static void gsm_kick_timer(struct timer_list *t) |
| 2030 | { | 2033 | { |
| 2031 | struct gsm_mux *gsm = container_of(work, struct gsm_mux, kick_timeout.work); | 2034 | struct gsm_mux *gsm = from_timer(gsm, t, kick_timer); |
| 2035 | unsigned long flags; | ||
| 2032 | int sent = 0; | 2036 | int sent = 0; |
| 2033 | 2037 | ||
| 2034 | mutex_lock(&gsm->tx_mutex); | 2038 | spin_lock_irqsave(&gsm->tx_lock, flags); |
| 2035 | /* If we have nothing running then we need to fire up */ | 2039 | /* If we have nothing running then we need to fire up */ |
| 2036 | if (gsm->tx_bytes < TX_THRESH_LO) | 2040 | if (gsm->tx_bytes < TX_THRESH_LO) |
| 2037 | sent = gsm_dlci_data_sweep(gsm); | 2041 | sent = gsm_dlci_data_sweep(gsm); |
| 2038 | mutex_unlock(&gsm->tx_mutex); | 2042 | spin_unlock_irqrestore(&gsm->tx_lock, flags); |
| 2039 | 2043 | ||
| 2040 | if (sent && debug & DBG_DATA) | 2044 | if (sent && debug & DBG_DATA) |
| 2041 | pr_info("%s TX queue stalled\n", __func__); | 2045 | pr_info("%s TX queue stalled\n", __func__); |
| @@ -2492,7 +2496,7 @@ static void gsm_cleanup_mux(struct gsm_mux *gsm, bool disc) · 450 unmodified lines | |||
| 2492 | } | 2496 | } |
| 2493 | 2497 | ||
| 2494 | /* Finish outstanding timers, making sure they are done */ | 2498 | /* Finish outstanding timers, making sure they are done */ |
| 2495 | cancel_delayed_work_sync(&gsm->kick_timeout); | 2499 | del_timer_sync(&gsm->kick_timer); |
| 2496 | del_timer_sync(&gsm->t2_timer); | 2500 | del_timer_sync(&gsm->t2_timer); |
| 2497 | 2501 | ||
| 2498 | /* Finish writing to ldisc */ | 2502 | /* Finish writing to ldisc */ |
| @@ -2565,7 +2569,6 @@ static void gsm_free_mux(struct gsm_mux *gsm) · 66 unmodified lines | |||
| 2565 | break; | 2569 | break; |
| 2566 | } | 2570 | } |
| 2567 | } | 2571 | } |
| 2568 | mutex_destroy(&gsm->tx_mutex); | ||
| 2569 | mutex_destroy(&gsm->mutex); | 2572 | mutex_destroy(&gsm->mutex); |
| 2570 | kfree(gsm->txframe); | 2573 | kfree(gsm->txframe); |
| 2571 | kfree(gsm->buf); | 2574 | kfree(gsm->buf); |
| @@ -2637,15 +2640,15 @@ static struct gsm_mux *gsm_alloc_mux(void) · 65 unmodified lines | |||
| 2637 | } | 2640 | } |
| 2638 | spin_lock_init(&gsm->lock); | 2641 | spin_lock_init(&gsm->lock); |
| 2639 | mutex_init(&gsm->mutex); | 2642 | mutex_init(&gsm->mutex); |
| 2640 | mutex_init(&gsm->tx_mutex); | ||
| 2641 | kref_init(&gsm->ref); | 2643 | kref_init(&gsm->ref); |
| 2642 | INIT_LIST_HEAD(&gsm->tx_ctrl_list); | 2644 | INIT_LIST_HEAD(&gsm->tx_ctrl_list); |
| 2643 | INIT_LIST_HEAD(&gsm->tx_data_list); | 2645 | INIT_LIST_HEAD(&gsm->tx_data_list); |
| 2644 | INIT_DELAYED_WORK(&gsm->kick_timeout, gsm_kick_timeout); | 2646 | timer_setup(&gsm->kick_timer, gsm_kick_timer, 0); |
| 2645 | timer_setup(&gsm->t2_timer, gsm_control_retransmit, 0); | 2647 | timer_setup(&gsm->t2_timer, gsm_control_retransmit, 0); |
| 2646 | INIT_WORK(&gsm->tx_work, gsmld_write_task); | 2648 | INIT_WORK(&gsm->tx_work, gsmld_write_task); |
| 2647 | init_waitqueue_head(&gsm->event); | 2649 | init_waitqueue_head(&gsm->event); |
| 2648 | spin_lock_init(&gsm->control_lock); | 2650 | spin_lock_init(&gsm->control_lock); |
| 2651 | spin_lock_init(&gsm->tx_lock); | ||
| 2649 | 2652 | ||
| 2650 | gsm->t1 = T1; | 2653 | gsm->t1 = T1; |
| 2651 | gsm->t2 = T2; | 2654 | gsm->t2 = T2; |
| @@ -2670,7 +2673,6 @@ static struct gsm_mux *gsm_alloc_mux(void) · 18 unmodified lines | |||
| 2670 | } | 2673 | } |
| 2671 | spin_unlock(&gsm_mux_lock); | 2674 | spin_unlock(&gsm_mux_lock); |
| 2672 | if (i == MAX_MUX) { | 2675 | if (i == MAX_MUX) { |
| 2673 | mutex_destroy(&gsm->tx_mutex); | ||
| 2674 | mutex_destroy(&gsm->mutex); | 2676 | mutex_destroy(&gsm->mutex); |
| 2675 | kfree(gsm->txframe); | 2677 | kfree(gsm->txframe); |
| 2676 | kfree(gsm->buf); | 2678 | kfree(gsm->buf); |
| @@ -2826,16 +2828,17 @@ static void gsmld_write_trigger(struct gsm_mux *gsm) · 149 unmodified lines | |||
| 2826 | static void gsmld_write_task(struct work_struct *work) | 2828 | static void gsmld_write_task(struct work_struct *work) |
| 2827 | { | 2829 | { |
| 2828 | struct gsm_mux *gsm = container_of(work, struct gsm_mux, tx_work); | 2830 | struct gsm_mux *gsm = container_of(work, struct gsm_mux, tx_work); |
| 2831 | unsigned long flags; | ||
| 2829 | int i, ret; | 2832 | int i, ret; |
| 2830 | 2833 | ||
| 2831 | /* All outstanding control channel and control messages and one data | 2834 | /* All outstanding control channel and control messages and one data |
| 2832 | * frame is sent. | 2835 | * frame is sent. |
| 2833 | */ | 2836 | */ |
| 2834 | ret = -ENODEV; | 2837 | ret = -ENODEV; |
| 2835 | mutex_lock(&gsm->tx_mutex); | 2838 | spin_lock_irqsave(&gsm->tx_lock, flags); |
| 2836 | if (gsm->tty) | 2839 | if (gsm->tty) |
| 2837 | ret = gsm_data_kick(gsm); | 2840 | ret = gsm_data_kick(gsm); |
| 2838 | mutex_unlock(&gsm->tx_mutex); | 2841 | spin_unlock_irqrestore(&gsm->tx_lock, flags); |
| 2839 | 2842 | ||
| 2840 | if (ret >= 0) | 2843 | if (ret >= 0) |
| 2841 | for (i = 0; i < NUM_DLCI; i++) | 2844 | for (i = 0; i < NUM_DLCI; i++) |
| @@ -3042,6 +3045,7 @@ static ssize_t gsmld_write(struct tty_struct *tty, struct file *file, · 200 unmodified lines | |||
| 3042 | const unsigned char *buf, size_t nr) | 3045 | const unsigned char *buf, size_t nr) |
| 3043 | { | 3046 | { |
| 3044 | struct gsm_mux *gsm = tty->disc_data; | 3047 | struct gsm_mux *gsm = tty->disc_data; |
| 3048 | unsigned long flags; | ||
| 3045 | int space; | 3049 | int space; |
| 3046 | int ret; | 3050 | int ret; |
| 3047 | 3051 | ||
| @@ -3049,13 +3053,13 @@ static ssize_t gsmld_write(struct tty_struct *tty, struct file *file, · 1 unmodified line | |||
| 3049 | return -ENODEV; | 3053 | return -ENODEV; |
| 3050 | 3054 | ||
| 3051 | ret = -ENOBUFS; | 3055 | ret = -ENOBUFS; |
| 3052 | mutex_lock(&gsm->tx_mutex); | 3056 | spin_lock_irqsave(&gsm->tx_lock, flags); |
| 3053 | space = tty_write_room(tty); | 3057 | space = tty_write_room(tty); |
| 3054 | if (space >= nr) | 3058 | if (space >= nr) |
| 3055 | ret = tty->ops->write(tty, buf, nr); | 3059 | ret = tty->ops->write(tty, buf, nr); |
| 3056 | else | 3060 | else |
| 3057 | set_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); | 3061 | set_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); |
| 3058 | mutex_unlock(&gsm->tx_mutex); | 3062 | spin_unlock_irqrestore(&gsm->tx_lock, flags); |
| 3059 | 3063 | ||
| 3060 | return ret; | 3064 | return ret; |
| 3061 | } | 3065 | } |
| @@ -3352,13 +3356,14 @@ static struct tty_ldisc_ops tty_ldisc_packet = { · 290 unmodified lines | |||
| 3352 | static void gsm_modem_upd_via_data(struct gsm_dlci *dlci, u8 brk) | 3356 | static void gsm_modem_upd_via_data(struct gsm_dlci *dlci, u8 brk) |
| 3353 | { | 3357 | { |
| 3354 | struct gsm_mux *gsm = dlci->gsm; | 3358 | struct gsm_mux *gsm = dlci->gsm; |
| 3359 | unsigned long flags; | ||
| 3355 | 3360 | ||
| 3356 | if (dlci->state != DLCI_OPEN || dlci->adaption != 2) | 3361 | if (dlci->state != DLCI_OPEN || dlci->adaption != 2) |
| 3357 | return; | 3362 | return; |
| 3358 | 3363 | ||
| 3359 | mutex_lock(&gsm->tx_mutex); | 3364 | spin_lock_irqsave(&gsm->tx_lock, flags); |
| 3360 | gsm_dlci_modem_output(gsm, dlci, brk); | 3365 | gsm_dlci_modem_output(gsm, dlci, brk); |
| 3361 | mutex_unlock(&gsm->tx_mutex); | 3366 | spin_unlock_irqrestore(&gsm->tx_lock, flags); |
| 3362 | } | 3367 | } |
| 3363 | 3368 | ||
| 3364 | /** | 3369 | /** |
| @@ -174,6 +174,8 @@ static int ehl_serial_setup(struct lpss8250 *lpss, struct uart_port *port) · 173 unmodified lines | |||
| 174 | */ | 174 | */ |
| 175 | up->dma = dma; | 175 | up->dma = dma; |
| 176 | 176 | ||
| 177 | lpss->dma_maxburst = 16; | ||
| 178 | |||
| 177 | port->set_termios = dw8250_do_set_termios; | 179 | port->set_termios = dw8250_do_set_termios; |
| 178 | 180 | ||
| 179 | return 0; | 181 | return 0; |
| @@ -277,8 +279,13 @@ static int lpss8250_dma_setup(struct lpss8250 *lpss, struct uart_8250_port *port · 97 unmodified lines | |||
| 277 | struct dw_dma_slave *rx_param, *tx_param; | 279 | struct dw_dma_slave *rx_param, *tx_param; |
| 278 | struct device *dev = port->port.dev; | 280 | struct device *dev = port->port.dev; |
| 279 | 281 | ||
| 280 | if (!lpss->dma_param.dma_dev) | 282 | if (!lpss->dma_param.dma_dev) { |
| 283 | dma = port->dma; | ||
| 284 | if (dma) | ||
| 285 | goto out_configuration_only; | ||
| 286 | |||
| 281 | return 0; | 287 | return 0; |
| 288 | } | ||
| 282 | 289 | ||
| 283 | rx_param = devm_kzalloc(dev, sizeof(*rx_param), GFP_KERNEL); | 290 | rx_param = devm_kzalloc(dev, sizeof(*rx_param), GFP_KERNEL); |
| 284 | if (!rx_param) | 291 | if (!rx_param) |
| @@ -289,16 +296,18 @@ static int lpss8250_dma_setup(struct lpss8250 *lpss, struct uart_8250_port *port · 4 unmodified lines | |||
| 289 | return -ENOMEM; | 296 | return -ENOMEM; |
| 290 | 297 | ||
| 291 | *rx_param = lpss->dma_param; | 298 | *rx_param = lpss->dma_param; |
| 292 | dma->rxconf.src_maxburst = lpss->dma_maxburst; | ||
| 293 | |||
| 294 | *tx_param = lpss->dma_param; | 299 | *tx_param = lpss->dma_param; |
| 295 | dma->txconf.dst_maxburst = lpss->dma_maxburst; | ||
| 296 | 300 | ||
| 297 | dma->fn = lpss8250_dma_filter; | 301 | dma->fn = lpss8250_dma_filter; |
| 298 | dma->rx_param = rx_param; | 302 | dma->rx_param = rx_param; |
| 299 | dma->tx_param = tx_param; | 303 | dma->tx_param = tx_param; |
| 300 | 304 | ||
| 301 | port->dma = dma; | 305 | port->dma = dma; |
| 306 | |||
| 307 | out_configuration_only: | ||
| 308 | dma->rxconf.src_maxburst = lpss->dma_maxburst; | ||
| 309 | dma->txconf.dst_maxburst = lpss->dma_maxburst; | ||
| 310 | |||
| 302 | return 0; | 311 | return 0; |
| 303 | } | 312 | } |
| 304 | 313 | ||
| @@ -157,7 +157,11 @@ static u32 uart_read(struct uart_8250_port *up, u32 reg) · 156 unmodified lines | |||
| 157 | return readl(up->port.membase + (reg << up->port.regshift)); | 157 | return readl(up->port.membase + (reg << up->port.regshift)); |
| 158 | } | 158 | } |
| 159 | 159 | ||
| 160 | static void omap8250_set_mctrl(struct uart_port *port, unsigned int mctrl) | 160 | /* |
| 161 | * Called on runtime PM resume path from omap8250_restore_regs(), and | ||
| 162 | * omap8250_set_mctrl(). | ||
| 163 | */ | ||
| 164 | static void __omap8250_set_mctrl(struct uart_port *port, unsigned int mctrl) | ||
| 161 | { | 165 | { |
| 162 | struct uart_8250_port *up = up_to_u8250p(port); | 166 | struct uart_8250_port *up = up_to_u8250p(port); |
| 163 | struct omap8250_priv *priv = up->port.private_data; | 167 | struct omap8250_priv *priv = up->port.private_data; |
| @@ -181,6 +185,20 @@ static void omap8250_set_mctrl(struct uart_port *port, unsigned int mctrl) · 17 unmodified lines | |||
| 181 | } | 185 | } |
| 182 | } | 186 | } |
| 183 | 187 | ||
| 188 | static void omap8250_set_mctrl(struct uart_port *port, unsigned int mctrl) | ||
| 189 | { | ||
| 190 | int err; | ||
| 191 | |||
| 192 | err = pm_runtime_resume_and_get(port->dev); | ||
| 193 | if (err) | ||
| 194 | return; | ||
| 195 | |||
| 196 | __omap8250_set_mctrl(port, mctrl); | ||
| 197 | |||
| 198 | pm_runtime_mark_last_busy(port->dev); | ||
| 199 | pm_runtime_put_autosuspend(port->dev); | ||
| 200 | } | ||
| 201 | |||
| 184 | /* | 202 | /* |
| 185 | * Work Around for Errata i202 (2430, 3430, 3630, 4430 and 4460) | 203 | * Work Around for Errata i202 (2430, 3430, 3630, 4430 and 4460) |
| 186 | * The access to uart register after MDR1 Access | 204 | * The access to uart register after MDR1 Access |
| @@ -193,27 +211,10 @@ static void omap8250_set_mctrl(struct uart_port *port, unsigned int mctrl) · 6 unmodified lines | |||
| 193 | static void omap_8250_mdr1_errataset(struct uart_8250_port *up, | 211 | static void omap_8250_mdr1_errataset(struct uart_8250_port *up, |
| 194 | struct omap8250_priv *priv) | 212 | struct omap8250_priv *priv) |
| 195 | { | 213 | { |
| 196 | u8 timeout = 255; | ||
| 197 | |||
| 198 | serial_out(up, UART_OMAP_MDR1, priv->mdr1); | 214 | serial_out(up, UART_OMAP_MDR1, priv->mdr1); |
| 199 | udelay(2); | 215 | udelay(2); |
| 200 | serial_out(up, UART_FCR, up->fcr | UART_FCR_CLEAR_XMIT | | 216 | serial_out(up, UART_FCR, up->fcr | UART_FCR_CLEAR_XMIT | |
| 201 | UART_FCR_CLEAR_RCVR); | 217 | UART_FCR_CLEAR_RCVR); |
| 202 | /* | ||
| 203 | * Wait for FIFO to empty: when empty, RX_FIFO_E bit is 0 and | ||
| 204 | * TX_FIFO_E bit is 1. | ||
| 205 | */ | ||
| 206 | while (UART_LSR_THRE != (serial_in(up, UART_LSR) & | ||
| 207 | (UART_LSR_THRE | UART_LSR_DR))) { | ||
| 208 | timeout--; | ||
| 209 | if (!timeout) { | ||
| 210 | /* Should *never* happen. we warn and carry on */ | ||
| 211 | dev_crit(up->port.dev, "Errata i202: timedout %x\n", | ||
| 212 | serial_in(up, UART_LSR)); | ||
| 213 | break; | ||
| 214 | } | ||
| 215 | udelay(1); | ||
| 216 | } | ||
| 217 | } | 218 | } |
| 218 | 219 | ||
| 219 | static void omap_8250_get_divisor(struct uart_port *port, unsigned int baud, | 220 | static void omap_8250_get_divisor(struct uart_port *port, unsigned int baud, |
| @@ -292,6 +293,7 @@ static void omap8250_restore_regs(struct uart_8250_port *up) · 72 unmodified lines | |||
| 292 | { | 293 | { |
| 293 | struct omap8250_priv *priv = up->port.private_data; | 294 | struct omap8250_priv *priv = up->port.private_data; |
| 294 | struct uart_8250_dma *dma = up->dma; | 295 | struct uart_8250_dma *dma = up->dma; |
| 296 | u8 mcr = serial8250_in_MCR(up); | ||
| 295 | 297 | ||
| 296 | if (dma && dma->tx_running) { | 298 | if (dma && dma->tx_running) { |
| 297 | /* | 299 | /* |
| @@ -308,7 +310,7 @@ static void omap8250_restore_regs(struct uart_8250_port *up) · 10 unmodified lines | |||
| 308 | serial_out(up, UART_EFR, UART_EFR_ECB); | 310 | serial_out(up, UART_EFR, UART_EFR_ECB); |
| 309 | 311 | ||
| 310 | serial_out(up, UART_LCR, UART_LCR_CONF_MODE_A); | 312 | serial_out(up, UART_LCR, UART_LCR_CONF_MODE_A); |
| 311 | serial8250_out_MCR(up, UART_MCR_TCRTLR); | 313 | serial8250_out_MCR(up, mcr | UART_MCR_TCRTLR); |
| 312 | serial_out(up, UART_FCR, up->fcr); | 314 | serial_out(up, UART_FCR, up->fcr); |
| 313 | 315 | ||
| 314 | omap8250_update_scr(up, priv); | 316 | omap8250_update_scr(up, priv); |
| @@ -324,7 +326,8 @@ static void omap8250_restore_regs(struct uart_8250_port *up) · 9 unmodified lines | |||
| 324 | serial_out(up, UART_LCR, 0); | 326 | serial_out(up, UART_LCR, 0); |
| 325 | 327 | ||
| 326 | /* drop TCR + TLR access, we setup XON/XOFF later */ | 328 | /* drop TCR + TLR access, we setup XON/XOFF later */ |
| 327 | serial8250_out_MCR(up, up->mcr); | 329 | serial8250_out_MCR(up, mcr); |
| 330 | |||
| 328 | serial_out(up, UART_IER, up->ier); | 331 | serial_out(up, UART_IER, up->ier); |
| 329 | 332 | ||
| 330 | serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); | 333 | serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); |
| @@ -341,7 +344,7 @@ static void omap8250_restore_regs(struct uart_8250_port *up) · 10 unmodified lines | |||
| 341 | 344 | ||
| 342 | omap8250_update_mdr1(up, priv); | 345 | omap8250_update_mdr1(up, priv); |
| 343 | 346 | ||
| 344 | up->port.ops->set_mctrl(&up->port, up->port.mctrl); | 347 | __omap8250_set_mctrl(&up->port, up->port.mctrl); |
| 345 | 348 | ||
| 346 | if (up->port.rs485.flags & SER_RS485_ENABLED) | 349 | if (up->port.rs485.flags & SER_RS485_ENABLED) |
| 347 | serial8250_em485_stop_tx(up); | 350 | serial8250_em485_stop_tx(up); |
| @@ -669,7 +672,6 @@ static int omap_8250_startup(struct uart_port *port) · 321 unmodified lines | |||
| 669 | 672 | ||
| 670 | pm_runtime_get_sync(port->dev); | 673 | pm_runtime_get_sync(port->dev); |
| 671 | 674 | ||
| 672 | up->mcr = 0; | ||
| 673 | serial_out(up, UART_FCR, UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT); | 675 | serial_out(up, UART_FCR, UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT); |
| 674 | 676 | ||
| 675 | serial_out(up, UART_LCR, UART_LCR_WLEN8); | 677 | serial_out(up, UART_LCR, UART_LCR_WLEN8); |
| @@ -1458,9 +1460,15 @@ err: · 782 unmodified lines | |||
| 1458 | static int omap8250_remove(struct platform_device *pdev) | 1460 | static int omap8250_remove(struct platform_device *pdev) |
| 1459 | { | 1461 | { |
| 1460 | struct omap8250_priv *priv = platform_get_drvdata(pdev); | 1462 | struct omap8250_priv *priv = platform_get_drvdata(pdev); |
| 1463 | int err; | ||
| 1464 | |||
| 1465 | err = pm_runtime_resume_and_get(&pdev->dev); | ||
| 1466 | if (err) | ||
| 1467 | return err; | ||
| 1461 | 1468 | ||
| 1462 | pm_runtime_dont_use_autosuspend(&pdev->dev); | 1469 | pm_runtime_dont_use_autosuspend(&pdev->dev); |
| 1463 | pm_runtime_put_sync(&pdev->dev); | 1470 | pm_runtime_put_sync(&pdev->dev); |
| 1471 | flush_work(&priv->qos_work); | ||
| 1464 | pm_runtime_disable(&pdev->dev); | 1472 | pm_runtime_disable(&pdev->dev); |
| 1465 | serial8250_unregister_port(priv->line); | 1473 | serial8250_unregister_port(priv->line); |
| 1466 | cpu_latency_qos_remove_request(&priv->pm_qos_request); | 1474 | cpu_latency_qos_remove_request(&priv->pm_qos_request); |
| @@ -1897,10 +1897,13 @@ EXPORT_SYMBOL_GPL(serial8250_modem_status); · 1896 unmodified lines | |||
| 1897 | static bool handle_rx_dma(struct uart_8250_port *up, unsigned int iir) | 1897 | static bool handle_rx_dma(struct uart_8250_port *up, unsigned int iir) |
| 1898 | { | 1898 | { |
| 1899 | switch (iir & 0x3f) { | 1899 | switch (iir & 0x3f) { |
| 1900 | case UART_IIR_RX_TIMEOUT: | 1900 | case UART_IIR_RDI: |
| 1901 | serial8250_rx_dma_flush(up); | 1901 | if (!up->dma->rx_running) |
| 1902 | break; | ||
| 1902 | fallthrough; | 1903 | fallthrough; |
| 1903 | case UART_IIR_RLSI: | 1904 | case UART_IIR_RLSI: |
| 1905 | case UART_IIR_RX_TIMEOUT: | ||
| 1906 | serial8250_rx_dma_flush(up); | ||
| 1904 | return true; | 1907 | return true; |
| 1905 | } | 1908 | } |
| 1906 | return up->dma->rx_dma(up); | 1909 | return up->dma->rx_dma(up); |
| @@ -12,6 +12,7 @@ · 11 unmodified lines | |||
| 12 | #include <linux/dmaengine.h> | 12 | #include <linux/dmaengine.h> |
| 13 | #include <linux/dmapool.h> | 13 | #include <linux/dmapool.h> |
| 14 | #include <linux/io.h> | 14 | #include <linux/io.h> |
| 15 | #include <linux/iopoll.h> | ||
| 15 | #include <linux/irq.h> | 16 | #include <linux/irq.h> |
| 16 | #include <linux/module.h> | 17 | #include <linux/module.h> |
| 17 | #include <linux/of.h> | 18 | #include <linux/of.h> |
| @@ -404,33 +405,6 @@ static unsigned int lpuart_get_baud_clk_rate(struct lpuart_port *sport) · 386 unmodified lines | |||
| 404 | #define lpuart_enable_clks(x) __lpuart_enable_clks(x, true) | 405 | #define lpuart_enable_clks(x) __lpuart_enable_clks(x, true) |
| 405 | #define lpuart_disable_clks(x) __lpuart_enable_clks(x, false) | 406 | #define lpuart_disable_clks(x) __lpuart_enable_clks(x, false) |
| 406 | 407 | ||
| 407 | static int lpuart_global_reset(struct lpuart_port *sport) | ||
| 408 | { | ||
| 409 | struct uart_port *port = &sport->port; | ||
| 410 | void __iomem *global_addr; | ||
| 411 | int ret; | ||
| 412 | |||
| 413 | if (uart_console(port)) | ||
| 414 | return 0; | ||
| 415 | |||
| 416 | ret = clk_prepare_enable(sport->ipg_clk); | ||
| 417 | if (ret) { | ||
| 418 | dev_err(sport->port.dev, "failed to enable uart ipg clk: %d\n", ret); | ||
| 419 | return ret; | ||
| 420 | } | ||
| 421 | |||
| 422 | if (is_imx7ulp_lpuart(sport) || is_imx8qxp_lpuart(sport)) { | ||
| 423 | global_addr = port->membase + UART_GLOBAL - IMX_REG_OFF; | ||
| 424 | writel(UART_GLOBAL_RST, global_addr); | ||
| 425 | usleep_range(GLOBAL_RST_MIN_US, GLOBAL_RST_MAX_US); | ||
| 426 | writel(0, global_addr); | ||
| 427 | usleep_range(GLOBAL_RST_MIN_US, GLOBAL_RST_MAX_US); | ||
| 428 | } | ||
| 429 | |||
| 430 | clk_disable_unprepare(sport->ipg_clk); | ||
| 431 | return 0; | ||
| 432 | } | ||
| 433 | |||
| 434 | static void lpuart_stop_tx(struct uart_port *port) | 408 | static void lpuart_stop_tx(struct uart_port *port) |
| 435 | { | 409 | { |
| 436 | unsigned char temp; | 410 | unsigned char temp; |
| @@ -2636,6 +2610,54 @@ static const struct serial_rs485 lpuart_rs485_supported = { · 2199 unmodified lines | |||
| 2636 | /* delay_rts_* and RX_DURING_TX are not supported */ | 2610 | /* delay_rts_* and RX_DURING_TX are not supported */ |
| 2637 | }; | 2611 | }; |
| 2638 | 2612 | ||
| 2613 | static int lpuart_global_reset(struct lpuart_port *sport) | ||
| 2614 | { | ||
| 2615 | struct uart_port *port = &sport->port; | ||
| 2616 | void __iomem *global_addr; | ||
| 2617 | unsigned long ctrl, bd; | ||
| 2618 | unsigned int val = 0; | ||
| 2619 | int ret; | ||
| 2620 | |||
| 2621 | ret = clk_prepare_enable(sport->ipg_clk); | ||
| 2622 | if (ret) { | ||
| 2623 | dev_err(sport->port.dev, "failed to enable uart ipg clk: %d\n", ret); | ||
| 2624 | return ret; | ||
| 2625 | } | ||
| 2626 | |||
| 2627 | if (is_imx7ulp_lpuart(sport) || is_imx8qxp_lpuart(sport)) { | ||
| 2628 | /* | ||
| 2629 | * If the transmitter is used by earlycon, wait for transmit engine to | ||
| 2630 | * complete and then reset. | ||
| 2631 | */ | ||
| 2632 | ctrl = lpuart32_read(port, UARTCTRL); | ||
| 2633 | if (ctrl & UARTCTRL_TE) { | ||
| 2634 | bd = lpuart32_read(&sport->port, UARTBAUD); | ||
| 2635 | if (read_poll_timeout(lpuart32_tx_empty, val, val, 1, 100000, false, | ||
| 2636 | port)) { | ||
| 2637 | dev_warn(sport->port.dev, | ||
| 2638 | "timeout waiting for transmit engine to complete\n"); | ||
| 2639 | clk_disable_unprepare(sport->ipg_clk); | ||
| 2640 | return 0; | ||
| 2641 | } | ||
| 2642 | } | ||
| 2643 | |||
| 2644 | global_addr = port->membase + UART_GLOBAL - IMX_REG_OFF; | ||
| 2645 | writel(UART_GLOBAL_RST, global_addr); | ||
| 2646 | usleep_range(GLOBAL_RST_MIN_US, GLOBAL_RST_MAX_US); | ||
| 2647 | writel(0, global_addr); | ||
| 2648 | usleep_range(GLOBAL_RST_MIN_US, GLOBAL_RST_MAX_US); | ||
| 2649 | |||
| 2650 | /* Recover the transmitter for earlycon. */ | ||
| 2651 | if (ctrl & UARTCTRL_TE) { | ||
| 2652 | lpuart32_write(port, bd, UARTBAUD); | ||
| 2653 | lpuart32_write(port, ctrl, UARTCTRL); | ||
| 2654 | } | ||
| 2655 | } | ||
| 2656 | |||
| 2657 | clk_disable_unprepare(sport->ipg_clk); | ||
| 2658 | return 0; | ||
| 2659 | } | ||
| 2660 | |||
| 2639 | static int lpuart_probe(struct platform_device *pdev) | 2661 | static int lpuart_probe(struct platform_device *pdev) |
| 2640 | { | 2662 | { |
| 2641 | const struct lpuart_soc_data *sdata = of_device_get_match_data(&pdev->dev); | 2663 | const struct lpuart_soc_data *sdata = of_device_get_match_data(&pdev->dev); |
| @@ -2594,6 +2594,7 @@ static const struct dev_pm_ops imx_uart_pm_ops = { · 2593 unmodified lines | |||
| 2594 | .suspend_noirq = imx_uart_suspend_noirq, | 2594 | .suspend_noirq = imx_uart_suspend_noirq, |
| 2595 | .resume_noirq = imx_uart_resume_noirq, | 2595 | .resume_noirq = imx_uart_resume_noirq, |
| 2596 | .freeze_noirq = imx_uart_suspend_noirq, | 2596 | .freeze_noirq = imx_uart_suspend_noirq, |
| 2597 | .thaw_noirq = imx_uart_resume_noirq, | ||
| 2597 | .restore_noirq = imx_uart_resume_noirq, | 2598 | .restore_noirq = imx_uart_resume_noirq, |
| 2598 | .suspend = imx_uart_suspend, | 2599 | .suspend = imx_uart_suspend, |
| 2599 | .resume = imx_uart_resume, | 2600 | .resume = imx_uart_resume, |
| @@ -24,11 +24,37 @@ · 23 unmodified lines | |||
| 24 | #define CFG_RXDET_P3_EN BIT(15) | 24 | #define CFG_RXDET_P3_EN BIT(15) |
| 25 | #define LPM_2_STB_SWITCH_EN BIT(25) | 25 | #define LPM_2_STB_SWITCH_EN BIT(25) |
| 26 | 26 | ||
| 27 | static int xhci_cdns3_suspend_quirk(struct usb_hcd *hcd); | 27 | static void xhci_cdns3_plat_start(struct usb_hcd *hcd) |
| 28 | { | ||
| 29 | struct xhci_hcd *xhci = hcd_to_xhci(hcd); | ||
| 30 | u32 value; | ||
| 31 | |||
| 32 | /* set usbcmd.EU3S */ | ||
| 33 | value = readl(&xhci->op_regs->command); | ||
| 34 | value |= CMD_PM_INDEX; | ||
| 35 | writel(value, &xhci->op_regs->command); | ||
| 36 | |||
| 37 | if (hcd->regs) { | ||
| 38 | value = readl(hcd->regs + XECP_AUX_CTRL_REG1); | ||
| 39 | value |= CFG_RXDET_P3_EN; | ||
| 40 | writel(value, hcd->regs + XECP_AUX_CTRL_REG1); | ||
| 41 | |||
| 42 | value = readl(hcd->regs + XECP_PORT_CAP_REG); | ||
| 43 | value |= LPM_2_STB_SWITCH_EN; | ||
| 44 | writel(value, hcd->regs + XECP_PORT_CAP_REG); | ||
| 45 | } | ||
| 46 | } | ||
| 47 | |||
| 48 | static int xhci_cdns3_resume_quirk(struct usb_hcd *hcd) | ||
| 49 | { | ||
| 50 | xhci_cdns3_plat_start(hcd); | ||
| 51 | return 0; | ||
| 52 | } | ||
| 28 | 53 | ||
| 29 | static const struct xhci_plat_priv xhci_plat_cdns3_xhci = { | 54 | static const struct xhci_plat_priv xhci_plat_cdns3_xhci = { |
| 30 | .quirks = XHCI_SKIP_PHY_INIT | XHCI_AVOID_BEI, | 55 | .quirks = XHCI_SKIP_PHY_INIT | XHCI_AVOID_BEI, |
| 31 | .suspend_quirk = xhci_cdns3_suspend_quirk, | 56 | .plat_start = xhci_cdns3_plat_start, |
| 57 | .resume_quirk = xhci_cdns3_resume_quirk, | ||
| 32 | }; | 58 | }; |
| 33 | 59 | ||
| 34 | static int __cdns_host_init(struct cdns *cdns) | 60 | static int __cdns_host_init(struct cdns *cdns) |
| @@ -90,32 +116,6 @@ err1: · 55 unmodified lines | |||
| 90 | return ret; | 116 | return ret; |
| 91 | } | 117 | } |
| 92 | 118 | ||
| 93 | static int xhci_cdns3_suspend_quirk(struct usb_hcd *hcd) | ||
| 94 | { | ||
| 95 | struct xhci_hcd *xhci = hcd_to_xhci(hcd); | ||
| 96 | u32 value; | ||
| 97 | |||
| 98 | if (pm_runtime_status_suspended(hcd->self.controller)) | ||
| 99 | return 0; | ||
| 100 | |||
| 101 | /* set usbcmd.EU3S */ | ||
| 102 | value = readl(&xhci->op_regs->command); | ||
| 103 | value |= CMD_PM_INDEX; | ||
| 104 | writel(value, &xhci->op_regs->command); | ||
| 105 | |||
| 106 | if (hcd->regs) { | ||
| 107 | value = readl(hcd->regs + XECP_AUX_CTRL_REG1); | ||
| 108 | value |= CFG_RXDET_P3_EN; | ||
| 109 | writel(value, hcd->regs + XECP_AUX_CTRL_REG1); | ||
| 110 | |||
| 111 | value = readl(hcd->regs + XECP_PORT_CAP_REG); | ||
| 112 | value |= LPM_2_STB_SWITCH_EN; | ||
| 113 | writel(value, hcd->regs + XECP_PORT_CAP_REG); | ||
| 114 | } | ||
| 115 | |||
| 116 | return 0; | ||
| 117 | } | ||
| 118 | |||
| 119 | static void cdns_host_exit(struct cdns *cdns) | 119 | static void cdns_host_exit(struct cdns *cdns) |
| 120 | { | 120 | { |
| 121 | kfree(cdns->xhci_plat_data); | 121 | kfree(cdns->xhci_plat_data); |
| @@ -256,8 +256,10 @@ static void ci_otg_del_timer(struct ci_hdrc *ci, enum otg_fsm_timer t) · 255 unmodified lines | |||
| 256 | ci->enabled_otg_timer_bits &= ~(1 << t); | 256 | ci->enabled_otg_timer_bits &= ~(1 << t); |
| 257 | if (ci->next_otg_timer == t) { | 257 | if (ci->next_otg_timer == t) { |
| 258 | if (ci->enabled_otg_timer_bits == 0) { | 258 | if (ci->enabled_otg_timer_bits == 0) { |
| 259 | spin_unlock_irqrestore(&ci->lock, flags); | ||
| 259 | /* No enabled timers after delete it */ | 260 | /* No enabled timers after delete it */ |
| 260 | hrtimer_cancel(&ci->otg_fsm_hrtimer); | 261 | hrtimer_cancel(&ci->otg_fsm_hrtimer); |
| 262 | spin_lock_irqsave(&ci->lock, flags); | ||
| 261 | ci->next_otg_timer = NUM_OTG_FSM_TIMERS; | 263 | ci->next_otg_timer = NUM_OTG_FSM_TIMERS; |
| 262 | } else { | 264 | } else { |
| 263 | /* Find the next timer */ | 265 | /* Find the next timer */ |
| @@ -362,6 +362,9 @@ static const struct usb_device_id usb_quirk_list[] = { · 361 unmodified lines | |||
| 362 | { USB_DEVICE(0x0781, 0x5583), .driver_info = USB_QUIRK_NO_LPM }, | 362 | { USB_DEVICE(0x0781, 0x5583), .driver_info = USB_QUIRK_NO_LPM }, |
| 363 | { USB_DEVICE(0x0781, 0x5591), .driver_info = USB_QUIRK_NO_LPM }, | 363 | { USB_DEVICE(0x0781, 0x5591), .driver_info = USB_QUIRK_NO_LPM }, |
| 364 | 364 | ||
| 365 | /* Realforce 87U Keyboard */ | ||
| 366 | { USB_DEVICE(0x0853, 0x011b), .driver_info = USB_QUIRK_NO_LPM }, | ||
| 367 | |||
| 365 | /* M-Systems Flash Disk Pioneers */ | 368 | /* M-Systems Flash Disk Pioneers */ |
| 366 | { USB_DEVICE(0x08ec, 0x1000), .driver_info = USB_QUIRK_RESET_RESUME }, | 369 | { USB_DEVICE(0x08ec, 0x1000), .driver_info = USB_QUIRK_RESET_RESUME }, |
| 367 | 370 | ||
| @@ -1710,6 +1710,16 @@ static struct extcon_dev *dwc3_get_extcon(struct dwc3 *dwc) · 1709 unmodified lines | |||
| 1710 | if (device_property_read_string(dev, "linux,extcon-name", &name) == 0) | 1710 | if (device_property_read_string(dev, "linux,extcon-name", &name) == 0) |
| 1711 | return extcon_get_extcon_dev(name); | 1711 | return extcon_get_extcon_dev(name); |
| 1712 | 1712 | ||
| 1713 | /* | ||
| 1714 | * Check explicitly if "usb-role-switch" is used since | ||
| 1715 | * extcon_find_edev_by_node() can not be used to check the absence of | ||
| 1716 | * an extcon device. In the absence of an device it will always return | ||
| 1717 | * EPROBE_DEFER. | ||
| 1718 | */ | ||
| 1719 | if (IS_ENABLED(CONFIG_USB_ROLE_SWITCH) && | ||
| 1720 | device_property_read_bool(dev, "usb-role-switch")) | ||
| 1721 | return NULL; | ||
| 1722 | |||
| 1713 | /* | 1723 | /* |
| 1714 | * Try to get an extcon device from the USB PHY controller's "port" | 1724 | * Try to get an extcon device from the USB PHY controller's "port" |
| 1715 | * node. Check if it has the "port" node first, to avoid printing the | 1725 | * node. Check if it has the "port" node first, to avoid printing the |
| @@ -1029,7 +1029,7 @@ static int __dwc3_gadget_ep_disable(struct dwc3_ep *dep) · 1028 unmodified lines | |||
| 1029 | dep->endpoint.desc = NULL; | 1029 | dep->endpoint.desc = NULL; |
| 1030 | } | 1030 | } |
| 1031 | 1031 | ||
| 1032 | dwc3_remove_requests(dwc, dep, -ECONNRESET); | 1032 | dwc3_remove_requests(dwc, dep, -ESHUTDOWN); |
| 1033 | 1033 | ||
| 1034 | dep->stream_capable = false; | 1034 | dep->stream_capable = false; |
| 1035 | dep->type = 0; | 1035 | dep->type = 0; |
| @@ -11,13 +11,8 @@ · 10 unmodified lines | |||
| 11 | #include <linux/of.h> | 11 | #include <linux/of.h> |
| 12 | #include <linux/platform_device.h> | 12 | #include <linux/platform_device.h> |
| 13 | 13 | ||
| 14 | #include "../host/xhci-plat.h" | ||
| 15 | #include "core.h" | 14 | #include "core.h" |
| 16 | 15 | ||
| 17 | static const struct xhci_plat_priv dwc3_xhci_plat_priv = { | ||
| 18 | .quirks = XHCI_SKIP_PHY_INIT, | ||
| 19 | }; | ||
| 20 | |||
| 21 | static void dwc3_host_fill_xhci_irq_res(struct dwc3 *dwc, | 16 | static void dwc3_host_fill_xhci_irq_res(struct dwc3 *dwc, |
| 22 | int irq, char *name) | 17 | int irq, char *name) |
| 23 | { | 18 | { |
| @@ -97,11 +92,6 @@ int dwc3_host_init(struct dwc3 *dwc) · 73 unmodified lines | |||
| 97 | goto err; | 92 | goto err; |
| 98 | } | 93 | } |
| 99 | 94 | ||
| 100 | ret = platform_device_add_data(xhci, &dwc3_xhci_plat_priv, | ||
| 101 | sizeof(dwc3_xhci_plat_priv)); | ||
| 102 | if (ret) | ||
| 103 | goto err; | ||
| 104 | |||
| 105 | memset(props, 0, sizeof(struct property_entry) * ARRAY_SIZE(props)); | 95 | memset(props, 0, sizeof(struct property_entry) * ARRAY_SIZE(props)); |
| 106 | 96 | ||
| 107 | if (dwc->usb3_lpm_capable) | 97 | if (dwc->usb3_lpm_capable) |
| @@ -285,7 +285,7 @@ static void bcma_hci_platform_power_gpio(struct bcma_device *dev, bool val) · 284 unmodified lines | |||
| 285 | { | 285 | { |
| 286 | struct bcma_hcd_device *usb_dev = bcma_get_drvdata(dev); | 286 | struct bcma_hcd_device *usb_dev = bcma_get_drvdata(dev); |
| 287 | 287 | ||
| 288 | if (IS_ERR_OR_NULL(usb_dev->gpio_desc)) | 288 | if (!usb_dev->gpio_desc) |
| 289 | return; | 289 | return; |
| 290 | 290 | ||
| 291 | gpiod_set_value(usb_dev->gpio_desc, val); | 291 | gpiod_set_value(usb_dev->gpio_desc, val); |
| @@ -406,9 +406,11 @@ static int bcma_hcd_probe(struct bcma_device *core) · 114 unmodified lines | |||
| 406 | return -ENOMEM; | 406 | return -ENOMEM; |
| 407 | usb_dev->core = core; | 407 | usb_dev->core = core; |
| 408 | 408 | ||
| 409 | if (core->dev.of_node) | 409 | usb_dev->gpio_desc = devm_gpiod_get_optional(&core->dev, "vcc", |
| 410 | usb_dev->gpio_desc = devm_gpiod_get(&core->dev, "vcc", | 410 | GPIOD_OUT_HIGH); |
| 411 | GPIOD_OUT_HIGH); | 411 | if (IS_ERR(usb_dev->gpio_desc)) |
| 412 | return dev_err_probe(&core->dev, PTR_ERR(usb_dev->gpio_desc), | ||
| 413 | "error obtaining VCC GPIO"); | ||
| 412 | 414 | ||
| 413 | switch (core->id.id) { | 415 | switch (core->id.id) { |
| 414 | case BCMA_CORE_USB20_HOST: | 416 | case BCMA_CORE_USB20_HOST: |
| @@ -162,6 +162,8 @@ static void option_instat_callback(struct urb *urb); · 161 unmodified lines | |||
| 162 | #define NOVATELWIRELESS_PRODUCT_G2 0xA010 | 162 | #define NOVATELWIRELESS_PRODUCT_G2 0xA010 |
| 163 | #define NOVATELWIRELESS_PRODUCT_MC551 0xB001 | 163 | #define NOVATELWIRELESS_PRODUCT_MC551 0xB001 |
| 164 | 164 | ||
| 165 | #define UBLOX_VENDOR_ID 0x1546 | ||
| 166 | |||
| 165 | /* AMOI PRODUCTS */ | 167 | /* AMOI PRODUCTS */ |
| 166 | #define AMOI_VENDOR_ID 0x1614 | 168 | #define AMOI_VENDOR_ID 0x1614 |
| 167 | #define AMOI_PRODUCT_H01 0x0800 | 169 | #define AMOI_PRODUCT_H01 0x0800 |
| @@ -240,7 +242,6 @@ static void option_instat_callback(struct urb *urb); · 72 unmodified lines | |||
| 240 | #define QUECTEL_PRODUCT_UC15 0x9090 | 242 | #define QUECTEL_PRODUCT_UC15 0x9090 |
| 241 | /* These u-blox products use Qualcomm's vendor ID */ | 243 | /* These u-blox products use Qualcomm's vendor ID */ |
| 242 | #define UBLOX_PRODUCT_R410M 0x90b2 | 244 | #define UBLOX_PRODUCT_R410M 0x90b2 |
| 243 | #define UBLOX_PRODUCT_R6XX 0x90fa | ||
| 244 | /* These Yuga products use Qualcomm's vendor ID */ | 245 | /* These Yuga products use Qualcomm's vendor ID */ |
| 245 | #define YUGA_PRODUCT_CLM920_NC5 0x9625 | 246 | #define YUGA_PRODUCT_CLM920_NC5 0x9625 |
| 246 | 247 | ||
| @@ -581,6 +582,9 @@ static void option_instat_callback(struct urb *urb); · 334 unmodified lines | |||
| 581 | #define OPPO_VENDOR_ID 0x22d9 | 582 | #define OPPO_VENDOR_ID 0x22d9 |
| 582 | #define OPPO_PRODUCT_R11 0x276c | 583 | #define OPPO_PRODUCT_R11 0x276c |
| 583 | 584 | ||
| 585 | /* Sierra Wireless products */ | ||
| 586 | #define SIERRA_VENDOR_ID 0x1199 | ||
| 587 | #define SIERRA_PRODUCT_EM9191 0x90d3 | ||
| 584 | 588 | ||
| 585 | /* Device flags */ | 589 | /* Device flags */ |
| 586 | 590 | ||
| @@ -1124,8 +1128,16 @@ static const struct usb_device_id option_ids[] = { · 537 unmodified lines | |||
| 1124 | /* u-blox products using Qualcomm vendor ID */ | 1128 | /* u-blox products using Qualcomm vendor ID */ |
| 1125 | { USB_DEVICE(QUALCOMM_VENDOR_ID, UBLOX_PRODUCT_R410M), | 1129 | { USB_DEVICE(QUALCOMM_VENDOR_ID, UBLOX_PRODUCT_R410M), |
| 1126 | .driver_info = RSVD(1) | RSVD(3) }, | 1130 | .driver_info = RSVD(1) | RSVD(3) }, |
| 1127 | { USB_DEVICE(QUALCOMM_VENDOR_ID, UBLOX_PRODUCT_R6XX), | 1131 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x908b), /* u-blox LARA-R6 00B */ |
| 1132 | .driver_info = RSVD(4) }, | ||
| 1133 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x90fa), | ||
| 1128 | .driver_info = RSVD(3) }, | 1134 | .driver_info = RSVD(3) }, |
| 1135 | /* u-blox products */ | ||
| 1136 | { USB_DEVICE(UBLOX_VENDOR_ID, 0x1341) }, /* u-blox LARA-L6 */ | ||
| 1137 | { USB_DEVICE(UBLOX_VENDOR_ID, 0x1342), /* u-blox LARA-L6 (RMNET) */ | ||
| 1138 | .driver_info = RSVD(4) }, | ||
| 1139 | { USB_DEVICE(UBLOX_VENDOR_ID, 0x1343), /* u-blox LARA-L6 (ECM) */ | ||
| 1140 | .driver_info = RSVD(4) }, | ||
| 1129 | /* Quectel products using Quectel vendor ID */ | 1141 | /* Quectel products using Quectel vendor ID */ |
| 1130 | { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC21, 0xff, 0xff, 0xff), | 1142 | { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC21, 0xff, 0xff, 0xff), |
| 1131 | .driver_info = NUMEP2 }, | 1143 | .driver_info = NUMEP2 }, |
| @@ -2167,6 +2179,7 @@ static const struct usb_device_id option_ids[] = { · 1035 unmodified lines | |||
| 2167 | { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x010a, 0xff) }, /* Fibocom MA510 (ECM mode) */ | 2179 | { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x010a, 0xff) }, /* Fibocom MA510 (ECM mode) */ |
| 2168 | { USB_DEVICE_AND_INTERFACE_INFO(0x2cb7, 0x010b, 0xff, 0xff, 0x30) }, /* Fibocom FG150 Diag */ | 2180 | { USB_DEVICE_AND_INTERFACE_INFO(0x2cb7, 0x010b, 0xff, 0xff, 0x30) }, /* Fibocom FG150 Diag */ |
| 2169 | { USB_DEVICE_AND_INTERFACE_INFO(0x2cb7, 0x010b, 0xff, 0, 0) }, /* Fibocom FG150 AT */ | 2181 | { USB_DEVICE_AND_INTERFACE_INFO(0x2cb7, 0x010b, 0xff, 0, 0) }, /* Fibocom FG150 AT */ |
| 2182 | { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x0111, 0xff) }, /* Fibocom FM160 (MBIM mode) */ | ||
| 2170 | { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a0, 0xff) }, /* Fibocom NL668-AM/NL652-EU (laptop MBIM) */ | 2183 | { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a0, 0xff) }, /* Fibocom NL668-AM/NL652-EU (laptop MBIM) */ |
| 2171 | { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a2, 0xff) }, /* Fibocom FM101-GL (laptop MBIM) */ | 2184 | { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a2, 0xff) }, /* Fibocom FM101-GL (laptop MBIM) */ |
| 2172 | { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a4, 0xff), /* Fibocom FM101-GL (laptop MBIM) */ | 2185 | { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a4, 0xff), /* Fibocom FM101-GL (laptop MBIM) */ |
| @@ -2176,6 +2189,8 @@ static const struct usb_device_id option_ids[] = { · 3 unmodified lines | |||
| 2176 | { USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1405, 0xff) }, /* GosunCn GM500 MBIM */ | 2189 | { USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1405, 0xff) }, /* GosunCn GM500 MBIM */ |
| 2177 | { USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1406, 0xff) }, /* GosunCn GM500 ECM/NCM */ | 2190 | { USB_DEVICE_INTERFACE_CLASS(0x305a, 0x1406, 0xff) }, /* GosunCn GM500 ECM/NCM */ |
| 2178 | { USB_DEVICE_AND_INTERFACE_INFO(OPPO_VENDOR_ID, OPPO_PRODUCT_R11, 0xff, 0xff, 0x30) }, | 2191 | { USB_DEVICE_AND_INTERFACE_INFO(OPPO_VENDOR_ID, OPPO_PRODUCT_R11, 0xff, 0xff, 0x30) }, |
| 2192 | { USB_DEVICE_AND_INTERFACE_INFO(SIERRA_VENDOR_ID, SIERRA_PRODUCT_EM9191, 0xff, 0xff, 0x30) }, | ||
| 2193 | { USB_DEVICE_AND_INTERFACE_INFO(SIERRA_VENDOR_ID, SIERRA_PRODUCT_EM9191, 0xff, 0, 0) }, | ||
| 2179 | { } /* Terminating entry */ | 2194 | { } /* Terminating entry */ |
| 2180 | }; | 2195 | }; |
| 2181 | MODULE_DEVICE_TABLE(usb, option_ids); | 2196 | MODULE_DEVICE_TABLE(usb, option_ids); |
| @@ -369,13 +369,24 @@ pmc_usb_mux_usb4(struct pmc_usb_port *port, struct typec_mux_state *state) · 368 unmodified lines | |||
| 369 | return pmc_usb_command(port, (void *)&req, sizeof(req)); | 369 | return pmc_usb_command(port, (void *)&req, sizeof(req)); |
| 370 | } | 370 | } |
| 371 | 371 | ||
| 372 | static int pmc_usb_mux_safe_state(struct pmc_usb_port *port) | 372 | static int pmc_usb_mux_safe_state(struct pmc_usb_port *port, |
| 373 | struct typec_mux_state *state) | ||
| 373 | { | 374 | { |
| 374 | u8 msg; | 375 | u8 msg; |
| 375 | 376 | ||
| 376 | if (IOM_PORT_ACTIVITY_IS(port->iom_status, SAFE_MODE)) | 377 | if (IOM_PORT_ACTIVITY_IS(port->iom_status, SAFE_MODE)) |
| 377 | return 0; | 378 | return 0; |
| 378 | 379 | ||
| 380 | if ((IOM_PORT_ACTIVITY_IS(port->iom_status, DP) || | ||
| 381 | IOM_PORT_ACTIVITY_IS(port->iom_status, DP_MFD)) && | ||
| 382 | state->alt && state->alt->svid == USB_TYPEC_DP_SID) | ||
| 383 | return 0; | ||
| 384 | |||
| 385 | if ((IOM_PORT_ACTIVITY_IS(port->iom_status, TBT) || | ||
| 386 | IOM_PORT_ACTIVITY_IS(port->iom_status, ALT_MODE_TBT_USB)) && | ||
| 387 | state->alt && state->alt->svid == USB_TYPEC_TBT_SID) | ||
| 388 | return 0; | ||
| 389 | |||
| 379 | msg = PMC_USB_SAFE_MODE; | 390 | msg = PMC_USB_SAFE_MODE; |
| 380 | msg |= port->usb3_port << PMC_USB_MSG_USB3_PORT_SHIFT; | 391 | msg |= port->usb3_port << PMC_USB_MSG_USB3_PORT_SHIFT; |
| 381 | 392 | ||
| @@ -443,7 +454,7 @@ pmc_usb_mux_set(struct typec_mux_dev *mux, struct typec_mux_state *state) · 61 unmodified lines | |||
| 443 | return 0; | 454 | return 0; |
| 444 | 455 | ||
| 445 | if (state->mode == TYPEC_STATE_SAFE) | 456 | if (state->mode == TYPEC_STATE_SAFE) |
| 446 | return pmc_usb_mux_safe_state(port); | 457 | return pmc_usb_mux_safe_state(port, state); |
| 447 | if (state->mode == TYPEC_STATE_USB) | 458 | if (state->mode == TYPEC_STATE_USB) |
| 448 | return pmc_usb_connect(port, port->role); | 459 | return pmc_usb_connect(port, port->role); |
| 449 | 460 | ||
| @@ -474,7 +474,7 @@ static void tps6598x_handle_plug_event(struct tps6598x *tps, u32 status) · 473 unmodified lines | |||
| 474 | static irqreturn_t cd321x_interrupt(int irq, void *data) | 474 | static irqreturn_t cd321x_interrupt(int irq, void *data) |
| 475 | { | 475 | { |
| 476 | struct tps6598x *tps = data; | 476 | struct tps6598x *tps = data; |
| 477 | u64 event; | 477 | u64 event = 0; |
| 478 | u32 status; | 478 | u32 status; |
| 479 | int ret; | 479 | int ret; |
| 480 | 480 | ||
| @@ -519,8 +519,8 @@ err_unlock: · 38 unmodified lines | |||
| 519 | static irqreturn_t tps6598x_interrupt(int irq, void *data) | 519 | static irqreturn_t tps6598x_interrupt(int irq, void *data) |
| 520 | { | 520 | { |
| 521 | struct tps6598x *tps = data; | 521 | struct tps6598x *tps = data; |
| 522 | u64 event1; | 522 | u64 event1 = 0; |
| 523 | u64 event2; | 523 | u64 event2 = 0; |
| 524 | u32 status; | 524 | u32 status; |
| 525 | int ret; | 525 | int ret; |
| 526 | 526 | ||
| @@ -2488,12 +2488,12 @@ static bool vfio_pci_dev_set_needs_reset(struct vfio_device_set *dev_set) · 2487 unmodified lines | |||
| 2488 | struct vfio_pci_core_device *cur; | 2488 | struct vfio_pci_core_device *cur; |
| 2489 | bool needs_reset = false; | 2489 | bool needs_reset = false; |
| 2490 | 2490 | ||
| 2491 | list_for_each_entry(cur, &dev_set->device_list, vdev.dev_set_list) { | 2491 | /* No other VFIO device in the set can be open. */ |
| 2492 | /* No VFIO device in the set can have an open device FD */ | 2492 | if (vfio_device_set_open_count(dev_set) > 1) |
| 2493 | if (cur->vdev.open_count) | 2493 | return false; |
| 2494 | return false; | 2494 | |
| 2495 | list_for_each_entry(cur, &dev_set->device_list, vdev.dev_set_list) | ||
| 2495 | needs_reset |= cur->needs_reset; | 2496 | needs_reset |= cur->needs_reset; |
| 2496 | } | ||
| 2497 | return needs_reset; | 2497 | return needs_reset; |
| 2498 | } | 2498 | } |
| 2499 | 2499 | ||
| @@ -125,6 +125,19 @@ static void vfio_release_device_set(struct vfio_device *device) · 124 unmodified lines | |||
| 125 | xa_unlock(&vfio_device_set_xa); | 125 | xa_unlock(&vfio_device_set_xa); |
| 126 | } | 126 | } |
| 127 | 127 | ||
| 128 | unsigned int vfio_device_set_open_count(struct vfio_device_set *dev_set) | ||
| 129 | { | ||
| 130 | struct vfio_device *cur; | ||
| 131 | unsigned int open_count = 0; | ||
| 132 | |||
| 133 | lockdep_assert_held(&dev_set->lock); | ||
| 134 | |||
| 135 | list_for_each_entry(cur, &dev_set->device_list, dev_set_list) | ||
| 136 | open_count += cur->open_count; | ||
| 137 | return open_count; | ||
| 138 | } | ||
| 139 | EXPORT_SYMBOL_GPL(vfio_device_set_open_count); | ||
| 140 | |||
| 128 | /* | 141 | /* |
| 129 | * Group objects - create, release, get, put, search | 142 | * Group objects - create, release, get, put, search |
| 130 | */ | 143 | */ |
| @@ -801,8 +814,9 @@ static struct file *vfio_device_open(struct vfio_device *device) · 670 unmodified lines | |||
| 801 | err_close_device: | 814 | err_close_device: |
| 802 | mutex_lock(&device->dev_set->lock); | 815 | mutex_lock(&device->dev_set->lock); |
| 803 | mutex_lock(&device->group->group_lock); | 816 | mutex_lock(&device->group->group_lock); |
| 804 | if (device->open_count == 1 && device->ops->close_device) { | 817 | if (device->open_count == 1) { |
| 805 | device->ops->close_device(device); | 818 | if (device->ops->close_device) |
| 819 | device->ops->close_device(device); | ||
| 806 | 820 | ||
| 807 | vfio_device_container_unregister(device); | 821 | vfio_device_container_unregister(device); |
| 808 | } | 822 | } |
| @@ -1017,10 +1031,12 @@ static int vfio_device_fops_release(struct inode *inode, struct file *filep) · 208 unmodified lines | |||
| 1017 | mutex_lock(&device->dev_set->lock); | 1031 | mutex_lock(&device->dev_set->lock); |
| 1018 | vfio_assert_device_open(device); | 1032 | vfio_assert_device_open(device); |
| 1019 | mutex_lock(&device->group->group_lock); | 1033 | mutex_lock(&device->group->group_lock); |
| 1020 | if (device->open_count == 1 && device->ops->close_device) | 1034 | if (device->open_count == 1) { |
| 1021 | device->ops->close_device(device); | 1035 | if (device->ops->close_device) |
| 1036 | device->ops->close_device(device); | ||
| 1022 | 1037 | ||
| 1023 | vfio_device_container_unregister(device); | 1038 | vfio_device_container_unregister(device); |
| 1039 | } | ||
| 1024 | mutex_unlock(&device->group->group_lock); | 1040 | mutex_unlock(&device->group->group_lock); |
| 1025 | device->open_count--; | 1041 | device->open_count--; |
| 1026 | if (device->open_count == 0) | 1042 | if (device->open_count == 0) |
| @@ -228,7 +228,7 @@ static int register_pcpu(struct pcpu *pcpu) · 227 unmodified lines | |||
| 228 | 228 | ||
| 229 | err = device_register(dev); | 229 | err = device_register(dev); |
| 230 | if (err) { | 230 | if (err) { |
| 231 | pcpu_release(dev); | 231 | put_device(dev); |
| 232 | return err; | 232 | return err; |
| 233 | } | 233 | } |
| 234 | 234 | ||
| @@ -54,7 +54,8 @@ static uint64_t get_callback_via(struct pci_dev *pdev) · 53 unmodified lines | |||
| 54 | pin = pdev->pin; | 54 | pin = pdev->pin; |
| 55 | 55 | ||
| 56 | /* We don't know the GSI. Specify the PCI INTx line instead. */ | 56 | /* We don't know the GSI. Specify the PCI INTx line instead. */ |
| 57 | return ((uint64_t)0x01 << HVM_CALLBACK_VIA_TYPE_SHIFT) | /* PCI INTx identifier */ | 57 | return ((uint64_t)HVM_PARAM_CALLBACK_TYPE_PCI_INTX << |
| 58 | HVM_CALLBACK_VIA_TYPE_SHIFT) | | ||
| 58 | ((uint64_t)pci_domain_nr(pdev->bus) << 32) | | 59 | ((uint64_t)pci_domain_nr(pdev->bus) << 32) | |
| 59 | ((uint64_t)pdev->bus->number << 16) | | 60 | ((uint64_t)pdev->bus->number << 16) | |
| 60 | ((uint64_t)(pdev->devfn & 0xff) << 8) | | 61 | ((uint64_t)(pdev->devfn & 0xff) << 8) | |
| @@ -144,7 +145,7 @@ static int platform_pci_probe(struct pci_dev *pdev, · 83 unmodified lines | |||
| 144 | if (ret) { | 145 | if (ret) { |
| 145 | dev_warn(&pdev->dev, "Unable to set the evtchn callback " | 146 | dev_warn(&pdev->dev, "Unable to set the evtchn callback " |
| 146 | "err=%d\n", ret); | 147 | "err=%d\n", ret); |
| 147 | goto out; | 148 | goto irq_out; |
| 148 | } | 149 | } |
| 149 | } | 150 | } |
| 150 | 151 | ||
| @@ -152,13 +153,16 @@ static int platform_pci_probe(struct pci_dev *pdev, · 1 unmodified line | |||
| 152 | grant_frames = alloc_xen_mmio(PAGE_SIZE * max_nr_gframes); | 153 | grant_frames = alloc_xen_mmio(PAGE_SIZE * max_nr_gframes); |
| 153 | ret = gnttab_setup_auto_xlat_frames(grant_frames); | 154 | ret = gnttab_setup_auto_xlat_frames(grant_frames); |
| 154 | if (ret) | 155 | if (ret) |
| 155 | goto out; | 156 | goto irq_out; |
| 156 | ret = gnttab_init(); | 157 | ret = gnttab_init(); |
| 157 | if (ret) | 158 | if (ret) |
| 158 | goto grant_out; | 159 | goto grant_out; |
| 159 | return 0; | 160 | return 0; |
| 160 | grant_out: | 161 | grant_out: |
| 161 | gnttab_free_auto_xlat_frames(); | 162 | gnttab_free_auto_xlat_frames(); |
| 163 | irq_out: | ||
| 164 | if (!xen_have_vector_callback) | ||
| 165 | free_irq(pdev->irq, pdev); | ||
| 162 | out: | 166 | out: |
| 163 | pci_release_region(pdev, 0); | 167 | pci_release_region(pdev, 0); |
| 164 | mem_out: | 168 | mem_out: |
| @@ -190,13 +190,16 @@ static const struct config_field caplist_pm[] = { · 189 unmodified lines | |||
| 190 | }; | 190 | }; |
| 191 | 191 | ||
| 192 | static struct msi_msix_field_config { | 192 | static struct msi_msix_field_config { |
| 193 | u16 enable_bit; /* bit for enabling MSI/MSI-X */ | 193 | u16 enable_bit; /* bit for enabling MSI/MSI-X */ |
| 194 | unsigned int int_type; /* interrupt type for exclusiveness check */ | 194 | u16 allowed_bits; /* bits allowed to be changed */ |
| 195 | unsigned int int_type; /* interrupt type for exclusiveness check */ | ||
| 195 | } msi_field_config = { | 196 | } msi_field_config = { |
| 196 | .enable_bit = PCI_MSI_FLAGS_ENABLE, | 197 | .enable_bit = PCI_MSI_FLAGS_ENABLE, |
| 198 | .allowed_bits = PCI_MSI_FLAGS_ENABLE, | ||
| 197 | .int_type = INTERRUPT_TYPE_MSI, | 199 | .int_type = INTERRUPT_TYPE_MSI, |
| 198 | }, msix_field_config = { | 200 | }, msix_field_config = { |
| 199 | .enable_bit = PCI_MSIX_FLAGS_ENABLE, | 201 | .enable_bit = PCI_MSIX_FLAGS_ENABLE, |
| 202 | .allowed_bits = PCI_MSIX_FLAGS_ENABLE | PCI_MSIX_FLAGS_MASKALL, | ||
| 200 | .int_type = INTERRUPT_TYPE_MSIX, | 203 | .int_type = INTERRUPT_TYPE_MSIX, |
| 201 | }; | 204 | }; |
| 202 | 205 | ||
| @@ -229,7 +232,7 @@ static int msi_msix_flags_write(struct pci_dev *dev, int offset, u16 new_value, · 26 unmodified lines | |||
| 229 | return 0; | 232 | return 0; |
| 230 | 233 | ||
| 231 | if (!dev_data->allow_interrupt_control || | 234 | if (!dev_data->allow_interrupt_control || |
| 232 | (new_value ^ old_value) & ~field_config->enable_bit) | 235 | (new_value ^ old_value) & ~field_config->allowed_bits) |
| 233 | return PCIBIOS_SET_FAILED; | 236 | return PCIBIOS_SET_FAILED; |
| 234 | 237 | ||
| 235 | if (new_value & field_config->enable_bit) { | 238 | if (new_value & field_config->enable_bit) { |
| @@ -2248,7 +2248,6 @@ static int flush_mdlog_and_wait_inode_unsafe_requests(struct inode *inode) · 2247 unmodified lines | |||
| 2248 | struct ceph_mds_client *mdsc = ceph_sb_to_client(inode->i_sb)->mdsc; | 2248 | struct ceph_mds_client *mdsc = ceph_sb_to_client(inode->i_sb)->mdsc; |
| 2249 | struct ceph_inode_info *ci = ceph_inode(inode); | 2249 | struct ceph_inode_info *ci = ceph_inode(inode); |
| 2250 | struct ceph_mds_request *req1 = NULL, *req2 = NULL; | 2250 | struct ceph_mds_request *req1 = NULL, *req2 = NULL; |
| 2251 | unsigned int max_sessions; | ||
| 2252 | int ret, err = 0; | 2251 | int ret, err = 0; |
| 2253 | 2252 | ||
| 2254 | spin_lock(&ci->i_unsafe_lock); | 2253 | spin_lock(&ci->i_unsafe_lock); |
| @@ -2266,28 +2265,24 @@ static int flush_mdlog_and_wait_inode_unsafe_requests(struct inode *inode) · 11 unmodified lines | |||
| 2266 | } | 2265 | } |
| 2267 | spin_unlock(&ci->i_unsafe_lock); | 2266 | spin_unlock(&ci->i_unsafe_lock); |
| 2268 | 2267 | ||
| 2269 | /* | ||
| 2270 | * The mdsc->max_sessions is unlikely to be changed | ||
| 2271 | * mostly, here we will retry it by reallocating the | ||
| 2272 | * sessions array memory to get rid of the mdsc->mutex | ||
| 2273 | * lock. | ||
| 2274 | */ | ||
| 2275 | retry: | ||
| 2276 | max_sessions = mdsc->max_sessions; | ||
| 2277 | |||
| 2278 | /* | 2268 | /* |
| 2279 | * Trigger to flush the journal logs in all the relevant MDSes | 2269 | * Trigger to flush the journal logs in all the relevant MDSes |
| 2280 | * manually, or in the worst case we must wait at most 5 seconds | 2270 | * manually, or in the worst case we must wait at most 5 seconds |
| 2281 | * to wait the journal logs to be flushed by the MDSes periodically. | 2271 | * to wait the journal logs to be flushed by the MDSes periodically. |
| 2282 | */ | 2272 | */ |
| 2283 | if ((req1 || req2) && likely(max_sessions)) { | 2273 | if (req1 || req2) { |
| 2284 | struct ceph_mds_session **sessions = NULL; | ||
| 2285 | struct ceph_mds_session *s; | ||
| 2286 | struct ceph_mds_request *req; | 2274 | struct ceph_mds_request *req; |
| 2275 | struct ceph_mds_session **sessions; | ||
| 2276 | struct ceph_mds_session *s; | ||
| 2277 | unsigned int max_sessions; | ||
| 2287 | int i; | 2278 | int i; |
| 2288 | 2279 | ||
| 2280 | mutex_lock(&mdsc->mutex); | ||
| 2281 | max_sessions = mdsc->max_sessions; | ||
| 2282 | |||
| 2289 | sessions = kcalloc(max_sessions, sizeof(s), GFP_KERNEL); | 2283 | sessions = kcalloc(max_sessions, sizeof(s), GFP_KERNEL); |
| 2290 | if (!sessions) { | 2284 | if (!sessions) { |
| 2285 | mutex_unlock(&mdsc->mutex); | ||
| 2291 | err = -ENOMEM; | 2286 | err = -ENOMEM; |
| 2292 | goto out; | 2287 | goto out; |
| 2293 | } | 2288 | } |
| @@ -2299,16 +2294,6 @@ retry: · 5 unmodified lines | |||
| 2299 | s = req->r_session; | 2294 | s = req->r_session; |
| 2300 | if (!s) | 2295 | if (!s) |
| 2301 | continue; | 2296 | continue; |
| 2302 | if (unlikely(s->s_mds >= max_sessions)) { | ||
| 2303 | spin_unlock(&ci->i_unsafe_lock); | ||
| 2304 | for (i = 0; i < max_sessions; i++) { | ||
| 2305 | s = sessions[i]; | ||
| 2306 | if (s) | ||
| 2307 | ceph_put_mds_session(s); | ||
| 2308 | } | ||
| 2309 | kfree(sessions); | ||
| 2310 | goto retry; | ||
| 2311 | } | ||
| 2312 | if (!sessions[s->s_mds]) { | 2297 | if (!sessions[s->s_mds]) { |
| 2313 | s = ceph_get_mds_session(s); | 2298 | s = ceph_get_mds_session(s); |
| 2314 | sessions[s->s_mds] = s; | 2299 | sessions[s->s_mds] = s; |
| @@ -2321,16 +2306,6 @@ retry: · 6 unmodified lines | |||
| 2321 | s = req->r_session; | 2306 | s = req->r_session; |
| 2322 | if (!s) | 2307 | if (!s) |
| 2323 | continue; | 2308 | continue; |
| 2324 | if (unlikely(s->s_mds >= max_sessions)) { | ||
| 2325 | spin_unlock(&ci->i_unsafe_lock); | ||
| 2326 | for (i = 0; i < max_sessions; i++) { | ||
| 2327 | s = sessions[i]; | ||
| 2328 | if (s) | ||
| 2329 | ceph_put_mds_session(s); | ||
| 2330 | } | ||
| 2331 | kfree(sessions); | ||
| 2332 | goto retry; | ||
| 2333 | } | ||
| 2334 | if (!sessions[s->s_mds]) { | 2309 | if (!sessions[s->s_mds]) { |
| 2335 | s = ceph_get_mds_session(s); | 2310 | s = ceph_get_mds_session(s); |
| 2336 | sessions[s->s_mds] = s; | 2311 | sessions[s->s_mds] = s; |
| @@ -2342,11 +2317,12 @@ retry: · 5 unmodified lines | |||
| 2342 | /* the auth MDS */ | 2317 | /* the auth MDS */ |
| 2343 | spin_lock(&ci->i_ceph_lock); | 2318 | spin_lock(&ci->i_ceph_lock); |
| 2344 | if (ci->i_auth_cap) { | 2319 | if (ci->i_auth_cap) { |
| 2345 | s = ci->i_auth_cap->session; | 2320 | s = ci->i_auth_cap->session; |
| 2346 | if (!sessions[s->s_mds]) | 2321 | if (!sessions[s->s_mds]) |
| 2347 | sessions[s->s_mds] = ceph_get_mds_session(s); | 2322 | sessions[s->s_mds] = ceph_get_mds_session(s); |
| 2348 | } | 2323 | } |
| 2349 | spin_unlock(&ci->i_ceph_lock); | 2324 | spin_unlock(&ci->i_ceph_lock); |
| 2325 | mutex_unlock(&mdsc->mutex); | ||
| 2350 | 2326 | ||
| 2351 | /* send flush mdlog request to MDSes */ | 2327 | /* send flush mdlog request to MDSes */ |
| 2352 | for (i = 0; i < max_sessions; i++) { | 2328 | for (i = 0; i < max_sessions; i++) { |
| @@ -2492,7 +2492,7 @@ int ceph_getattr(struct user_namespace *mnt_userns, const struct path *path, · 2491 unmodified lines | |||
| 2492 | struct inode *parent; | 2492 | struct inode *parent; |
| 2493 | 2493 | ||
| 2494 | parent = ceph_lookup_inode(sb, ceph_ino(inode)); | 2494 | parent = ceph_lookup_inode(sb, ceph_ino(inode)); |
| 2495 | if (!parent) | 2495 | if (IS_ERR(parent)) |
| 2496 | return PTR_ERR(parent); | 2496 | return PTR_ERR(parent); |
| 2497 | 2497 | ||
| 2498 | pci = ceph_inode(parent); | 2498 | pci = ceph_inode(parent); |
| @@ -763,7 +763,7 @@ int ceph_update_snap_trace(struct ceph_mds_client *mdsc, · 762 unmodified lines | |||
| 763 | struct ceph_mds_snap_realm *ri; /* encoded */ | 763 | struct ceph_mds_snap_realm *ri; /* encoded */ |
| 764 | __le64 *snaps; /* encoded */ | 764 | __le64 *snaps; /* encoded */ |
| 765 | __le64 *prior_parent_snaps; /* encoded */ | 765 | __le64 *prior_parent_snaps; /* encoded */ |
| 766 | struct ceph_snap_realm *realm = NULL; | 766 | struct ceph_snap_realm *realm; |
| 767 | struct ceph_snap_realm *first_realm = NULL; | 767 | struct ceph_snap_realm *first_realm = NULL; |
| 768 | struct ceph_snap_realm *realm_to_rebuild = NULL; | 768 | struct ceph_snap_realm *realm_to_rebuild = NULL; |
| 769 | int rebuild_snapcs; | 769 | int rebuild_snapcs; |
| @@ -774,6 +774,7 @@ int ceph_update_snap_trace(struct ceph_mds_client *mdsc, · 4 unmodified lines | |||
| 774 | 774 | ||
| 775 | dout("%s deletion=%d\n", __func__, deletion); | 775 | dout("%s deletion=%d\n", __func__, deletion); |
| 776 | more: | 776 | more: |
| 777 | realm = NULL; | ||
| 777 | rebuild_snapcs = 0; | 778 | rebuild_snapcs = 0; |
| 778 | ceph_decode_need(&p, e, sizeof(*ri), bad); | 779 | ceph_decode_need(&p, e, sizeof(*ri), bad); |
| 779 | ri = p; | 780 | ri = p; |
| @@ -3855,9 +3855,13 @@ int cifs_mount(struct cifs_sb_info *cifs_sb, struct smb3_fs_context *ctx) · 3854 unmodified lines | |||
| 3855 | uuid_copy(&cifs_sb->dfs_mount_id, &mnt_ctx.mount_id); | 3855 | uuid_copy(&cifs_sb->dfs_mount_id, &mnt_ctx.mount_id); |
| 3856 | 3856 | ||
| 3857 | out: | 3857 | out: |
| 3858 | free_xid(mnt_ctx.xid); | ||
| 3859 | cifs_try_adding_channels(cifs_sb, mnt_ctx.ses); | 3858 | cifs_try_adding_channels(cifs_sb, mnt_ctx.ses); |
| 3860 | return mount_setup_tlink(cifs_sb, mnt_ctx.ses, mnt_ctx.tcon); | 3859 | rc = mount_setup_tlink(cifs_sb, mnt_ctx.ses, mnt_ctx.tcon); |
| 3860 | if (rc) | ||
| 3861 | goto error; | ||
| 3862 | |||
| 3863 | free_xid(mnt_ctx.xid); | ||
| 3864 | return rc; | ||
| 3861 | 3865 | ||
| 3862 | error: | 3866 | error: |
| 3863 | dfs_cache_put_refsrv_sessions(&mnt_ctx.mount_id); | 3867 | dfs_cache_put_refsrv_sessions(&mnt_ctx.mount_id); |
| @@ -3884,8 +3888,12 @@ int cifs_mount(struct cifs_sb_info *cifs_sb, struct smb3_fs_context *ctx) · 20 unmodified lines | |||
| 3884 | goto error; | 3888 | goto error; |
| 3885 | } | 3889 | } |
| 3886 | 3890 | ||
| 3891 | rc = mount_setup_tlink(cifs_sb, mnt_ctx.ses, mnt_ctx.tcon); | ||
| 3892 | if (rc) | ||
| 3893 | goto error; | ||
| 3894 | |||
| 3887 | free_xid(mnt_ctx.xid); | 3895 | free_xid(mnt_ctx.xid); |
| 3888 | return mount_setup_tlink(cifs_sb, mnt_ctx.ses, mnt_ctx.tcon); | 3896 | return rc; |
| 3889 | 3897 | ||
| 3890 | error: | 3898 | error: |
| 3891 | mount_put_conns(&mnt_ctx); | 3899 | mount_put_conns(&mnt_ctx); |
| @@ -343,7 +343,7 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg) · 342 unmodified lines | |||
| 343 | rc = put_user(ExtAttrBits & | 343 | rc = put_user(ExtAttrBits & |
| 344 | FS_FL_USER_VISIBLE, | 344 | FS_FL_USER_VISIBLE, |
| 345 | (int __user *)arg); | 345 | (int __user *)arg); |
| 346 | if (rc != EOPNOTSUPP) | 346 | if (rc != -EOPNOTSUPP) |
| 347 | break; | 347 | break; |
| 348 | } | 348 | } |
| 349 | #endif /* CONFIG_CIFS_ALLOW_INSECURE_LEGACY */ | 349 | #endif /* CONFIG_CIFS_ALLOW_INSECURE_LEGACY */ |
| @@ -373,7 +373,7 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg) · 23 unmodified lines | |||
| 373 | * pSMBFile->fid.netfid, | 373 | * pSMBFile->fid.netfid, |
| 374 | * extAttrBits, | 374 | * extAttrBits, |
| 375 | * &ExtAttrMask); | 375 | * &ExtAttrMask); |
| 376 | * if (rc != EOPNOTSUPP) | 376 | * if (rc != -EOPNOTSUPP) |
| 377 | * break; | 377 | * break; |
| 378 | */ | 378 | */ |
| 379 | 379 | ||
| @@ -1116,6 +1116,8 @@ smb2_set_ea(const unsigned int xid, struct cifs_tcon *tcon, · 1115 unmodified lines | |||
| 1116 | COMPOUND_FID, current->tgid, | 1116 | COMPOUND_FID, current->tgid, |
| 1117 | FILE_FULL_EA_INFORMATION, | 1117 | FILE_FULL_EA_INFORMATION, |
| 1118 | SMB2_O_INFO_FILE, 0, data, size); | 1118 | SMB2_O_INFO_FILE, 0, data, size); |
| 1119 | if (rc) | ||
| 1120 | goto sea_exit; | ||
| 1119 | smb2_set_next_command(tcon, &rqst[1]); | 1121 | smb2_set_next_command(tcon, &rqst[1]); |
| 1120 | smb2_set_related(&rqst[1]); | 1122 | smb2_set_related(&rqst[1]); |
| 1121 | 1123 | ||
| @@ -1126,6 +1128,8 @@ smb2_set_ea(const unsigned int xid, struct cifs_tcon *tcon, · 4 unmodified lines | |||
| 1126 | rqst[2].rq_nvec = 1; | 1128 | rqst[2].rq_nvec = 1; |
| 1127 | rc = SMB2_close_init(tcon, server, | 1129 | rc = SMB2_close_init(tcon, server, |
| 1128 | &rqst[2], COMPOUND_FID, COMPOUND_FID, false); | 1130 | &rqst[2], COMPOUND_FID, COMPOUND_FID, false); |
| 1131 | if (rc) | ||
| 1132 | goto sea_exit; | ||
| 1129 | smb2_set_related(&rqst[2]); | 1133 | smb2_set_related(&rqst[2]); |
| 1130 | 1134 | ||
| 1131 | rc = compound_send_recv(xid, ses, server, | 1135 | rc = compound_send_recv(xid, ses, server, |
| @@ -75,11 +75,15 @@ static void erofs_fscache_rreq_unlock_folios(struct netfs_io_request *rreq) · 74 unmodified lines | |||
| 75 | 75 | ||
| 76 | rcu_read_lock(); | 76 | rcu_read_lock(); |
| 77 | xas_for_each(&xas, folio, last_page) { | 77 | xas_for_each(&xas, folio, last_page) { |
| 78 | unsigned int pgpos = | 78 | unsigned int pgpos, pgend; |
| 79 | (folio_index(folio) - start_page) * PAGE_SIZE; | ||
| 80 | unsigned int pgend = pgpos + folio_size(folio); | ||
| 81 | bool pg_failed = false; | 79 | bool pg_failed = false; |
| 82 | 80 | ||
| 81 | if (xas_retry(&xas, folio)) | ||
| 82 | continue; | ||
| 83 | |||
| 84 | pgpos = (folio_index(folio) - start_page) * PAGE_SIZE; | ||
| 85 | pgend = pgpos + folio_size(folio); | ||
| 86 | |||
| 83 | for (;;) { | 87 | for (;;) { |
| 84 | if (!subreq) { | 88 | if (!subreq) { |
| 85 | pg_failed = true; | 89 | pg_failed = true; |
| @@ -287,22 +291,25 @@ static int erofs_fscache_data_read(struct address_space *mapping, · 201 unmodified lines | |||
| 287 | return PTR_ERR(src); | 291 | return PTR_ERR(src); |
| 288 | 292 | ||
| 289 | iov_iter_xarray(&iter, READ, &mapping->i_pages, pos, PAGE_SIZE); | 293 | iov_iter_xarray(&iter, READ, &mapping->i_pages, pos, PAGE_SIZE); |
| 290 | if (copy_to_iter(src + offset, size, &iter) != size) | 294 | if (copy_to_iter(src + offset, size, &iter) != size) { |
| 295 | erofs_put_metabuf(&buf); | ||
| 291 | return -EFAULT; | 296 | return -EFAULT; |
| 297 | } | ||
| 292 | iov_iter_zero(PAGE_SIZE - size, &iter); | 298 | iov_iter_zero(PAGE_SIZE - size, &iter); |
| 293 | erofs_put_metabuf(&buf); | 299 | erofs_put_metabuf(&buf); |
| 294 | return PAGE_SIZE; | 300 | return PAGE_SIZE; |
| 295 | } | 301 | } |
| 296 | 302 | ||
| 297 | count = min_t(size_t, map.m_llen - (pos - map.m_la), len); | ||
| 298 | DBG_BUGON(!count || count % PAGE_SIZE); | ||
| 299 | |||
| 300 | if (!(map.m_flags & EROFS_MAP_MAPPED)) { | 303 | if (!(map.m_flags & EROFS_MAP_MAPPED)) { |
| 304 | count = len; | ||
| 301 | iov_iter_xarray(&iter, READ, &mapping->i_pages, pos, count); | 305 | iov_iter_xarray(&iter, READ, &mapping->i_pages, pos, count); |
| 302 | iov_iter_zero(count, &iter); | 306 | iov_iter_zero(count, &iter); |
| 303 | return count; | 307 | return count; |
| 304 | } | 308 | } |
| 305 | 309 | ||
| 310 | count = min_t(size_t, map.m_llen - (pos - map.m_la), len); | ||
| 311 | DBG_BUGON(!count || count % PAGE_SIZE); | ||
| 312 | |||
| 306 | mdev = (struct erofs_map_dev) { | 313 | mdev = (struct erofs_map_dev) { |
| 307 | .m_deviceid = map.m_deviceid, | 314 | .m_deviceid = map.m_deviceid, |
| 308 | .m_pa = map.m_pa, | 315 | .m_pa = map.m_pa, |
| @@ -403,13 +410,13 @@ static void erofs_fscache_domain_put(struct erofs_domain *domain) · 94 unmodified lines | |||
| 403 | static int erofs_fscache_register_volume(struct super_block *sb) | 410 | static int erofs_fscache_register_volume(struct super_block *sb) |
| 404 | { | 411 | { |
| 405 | struct erofs_sb_info *sbi = EROFS_SB(sb); | 412 | struct erofs_sb_info *sbi = EROFS_SB(sb); |
| 406 | char *domain_id = sbi->opt.domain_id; | 413 | char *domain_id = sbi->domain_id; |
| 407 | struct fscache_volume *volume; | 414 | struct fscache_volume *volume; |
| 408 | char *name; | 415 | char *name; |
| 409 | int ret = 0; | 416 | int ret = 0; |
| 410 | 417 | ||
| 411 | name = kasprintf(GFP_KERNEL, "erofs,%s", | 418 | name = kasprintf(GFP_KERNEL, "erofs,%s", |
| 412 | domain_id ? domain_id : sbi->opt.fsid); | 419 | domain_id ? domain_id : sbi->fsid); |
| 413 | if (!name) | 420 | if (!name) |
| 414 | return -ENOMEM; | 421 | return -ENOMEM; |
| 415 | 422 | ||
| @@ -435,7 +442,7 @@ static int erofs_fscache_init_domain(struct super_block *sb) · 19 unmodified lines | |||
| 435 | if (!domain) | 442 | if (!domain) |
| 436 | return -ENOMEM; | 443 | return -ENOMEM; |
| 437 | 444 | ||
| 438 | domain->domain_id = kstrdup(sbi->opt.domain_id, GFP_KERNEL); | 445 | domain->domain_id = kstrdup(sbi->domain_id, GFP_KERNEL); |
| 439 | if (!domain->domain_id) { | 446 | if (!domain->domain_id) { |
| 440 | kfree(domain); | 447 | kfree(domain); |
| 441 | return -ENOMEM; | 448 | return -ENOMEM; |
| @@ -472,7 +479,7 @@ static int erofs_fscache_register_domain(struct super_block *sb) · 30 unmodified lines | |||
| 472 | 479 | ||
| 473 | mutex_lock(&erofs_domain_list_lock); | 480 | mutex_lock(&erofs_domain_list_lock); |
| 474 | list_for_each_entry(domain, &erofs_domain_list, list) { | 481 | list_for_each_entry(domain, &erofs_domain_list, list) { |
| 475 | if (!strcmp(domain->domain_id, sbi->opt.domain_id)) { | 482 | if (!strcmp(domain->domain_id, sbi->domain_id)) { |
| 476 | sbi->domain = domain; | 483 | sbi->domain = domain; |
| 477 | sbi->volume = domain->volume; | 484 | sbi->volume = domain->volume; |
| 478 | refcount_inc(&domain->ref); | 485 | refcount_inc(&domain->ref); |
| @@ -609,7 +616,7 @@ struct erofs_fscache *erofs_domain_register_cookie(struct super_block *sb, · 130 unmodified lines | |||
| 609 | struct erofs_fscache *erofs_fscache_register_cookie(struct super_block *sb, | 616 | struct erofs_fscache *erofs_fscache_register_cookie(struct super_block *sb, |
| 610 | char *name, bool need_inode) | 617 | char *name, bool need_inode) |
| 611 | { | 618 | { |
| 612 | if (EROFS_SB(sb)->opt.domain_id) | 619 | if (EROFS_SB(sb)->domain_id) |
| 613 | return erofs_domain_register_cookie(sb, name, need_inode); | 620 | return erofs_domain_register_cookie(sb, name, need_inode); |
| 614 | return erofs_fscache_acquire_cookie(sb, name, need_inode); | 621 | return erofs_fscache_acquire_cookie(sb, name, need_inode); |
| 615 | } | 622 | } |
| @@ -641,7 +648,7 @@ int erofs_fscache_register_fs(struct super_block *sb) · 25 unmodified lines | |||
| 641 | struct erofs_sb_info *sbi = EROFS_SB(sb); | 648 | struct erofs_sb_info *sbi = EROFS_SB(sb); |
| 642 | struct erofs_fscache *fscache; | 649 | struct erofs_fscache *fscache; |
| 643 | 650 | ||
| 644 | if (sbi->opt.domain_id) | 651 | if (sbi->domain_id) |
| 645 | ret = erofs_fscache_register_domain(sb); | 652 | ret = erofs_fscache_register_domain(sb); |
| 646 | else | 653 | else |
| 647 | ret = erofs_fscache_register_volume(sb); | 654 | ret = erofs_fscache_register_volume(sb); |
| @@ -649,7 +656,7 @@ int erofs_fscache_register_fs(struct super_block *sb) · 1 unmodified line | |||
| 649 | return ret; | 656 | return ret; |
| 650 | 657 | ||
| 651 | /* acquired domain/volume will be relinquished in kill_sb() on error */ | 658 | /* acquired domain/volume will be relinquished in kill_sb() on error */ |
| 652 | fscache = erofs_fscache_register_cookie(sb, sbi->opt.fsid, true); | 659 | fscache = erofs_fscache_register_cookie(sb, sbi->fsid, true); |
| 653 | if (IS_ERR(fscache)) | 660 | if (IS_ERR(fscache)) |
| 654 | return PTR_ERR(fscache); | 661 | return PTR_ERR(fscache); |
| 655 | 662 | ||
| @@ -75,8 +75,6 @@ struct erofs_mount_opts { · 74 unmodified lines | |||
| 75 | unsigned int max_sync_decompress_pages; | 75 | unsigned int max_sync_decompress_pages; |
| 76 | #endif | 76 | #endif |
| 77 | unsigned int mount_opt; | 77 | unsigned int mount_opt; |
| 78 | char *fsid; | ||
| 79 | char *domain_id; | ||
| 80 | }; | 78 | }; |
| 81 | 79 | ||
| 82 | struct erofs_dev_context { | 80 | struct erofs_dev_context { |
| @@ -89,6 +87,8 @@ struct erofs_dev_context { · 6 unmodified lines | |||
| 89 | struct erofs_fs_context { | 87 | struct erofs_fs_context { |
| 90 | struct erofs_mount_opts opt; | 88 | struct erofs_mount_opts opt; |
| 91 | struct erofs_dev_context *devs; | 89 | struct erofs_dev_context *devs; |
| 90 | char *fsid; | ||
| 91 | char *domain_id; | ||
| 92 | }; | 92 | }; |
| 93 | 93 | ||
| 94 | /* all filesystem-wide lz4 configurations */ | 94 | /* all filesystem-wide lz4 configurations */ |
| @@ -170,6 +170,8 @@ struct erofs_sb_info { · 75 unmodified lines | |||
| 170 | struct fscache_volume *volume; | 170 | struct fscache_volume *volume; |
| 171 | struct erofs_fscache *s_fscache; | 171 | struct erofs_fscache *s_fscache; |
| 172 | struct erofs_domain *domain; | 172 | struct erofs_domain *domain; |
| 173 | char *fsid; | ||
| 174 | char *domain_id; | ||
| 173 | }; | 175 | }; |
| 174 | 176 | ||
| 175 | #define EROFS_SB(sb) ((struct erofs_sb_info *)(sb)->s_fs_info) | 177 | #define EROFS_SB(sb) ((struct erofs_sb_info *)(sb)->s_fs_info) |
| @@ -579,9 +579,9 @@ static int erofs_fc_parse_param(struct fs_context *fc, · 578 unmodified lines | |||
| 579 | break; | 579 | break; |
| 580 | case Opt_fsid: | 580 | case Opt_fsid: |
| 581 | #ifdef CONFIG_EROFS_FS_ONDEMAND | 581 | #ifdef CONFIG_EROFS_FS_ONDEMAND |
| 582 | kfree(ctx->opt.fsid); | 582 | kfree(ctx->fsid); |
| 583 | ctx->opt.fsid = kstrdup(param->string, GFP_KERNEL); | 583 | ctx->fsid = kstrdup(param->string, GFP_KERNEL); |
| 584 | if (!ctx->opt.fsid) | 584 | if (!ctx->fsid) |
| 585 | return -ENOMEM; | 585 | return -ENOMEM; |
| 586 | #else | 586 | #else |
| 587 | errorfc(fc, "fsid option not supported"); | 587 | errorfc(fc, "fsid option not supported"); |
| @@ -589,9 +589,9 @@ static int erofs_fc_parse_param(struct fs_context *fc, · 1 unmodified line | |||
| 589 | break; | 589 | break; |
| 590 | case Opt_domain_id: | 590 | case Opt_domain_id: |
| 591 | #ifdef CONFIG_EROFS_FS_ONDEMAND | 591 | #ifdef CONFIG_EROFS_FS_ONDEMAND |
| 592 | kfree(ctx->opt.domain_id); | 592 | kfree(ctx->domain_id); |
| 593 | ctx->opt.domain_id = kstrdup(param->string, GFP_KERNEL); | 593 | ctx->domain_id = kstrdup(param->string, GFP_KERNEL); |
| 594 | if (!ctx->opt.domain_id) | 594 | if (!ctx->domain_id) |
| 595 | return -ENOMEM; | 595 | return -ENOMEM; |
| 596 | #else | 596 | #else |
| 597 | errorfc(fc, "domain_id option not supported"); | 597 | errorfc(fc, "domain_id option not supported"); |
| @@ -728,10 +728,12 @@ static int erofs_fc_fill_super(struct super_block *sb, struct fs_context *fc) · 130 unmodified lines | |||
| 728 | 728 | ||
| 729 | sb->s_fs_info = sbi; | 729 | sb->s_fs_info = sbi; |
| 730 | sbi->opt = ctx->opt; | 730 | sbi->opt = ctx->opt; |
| 731 | ctx->opt.fsid = NULL; | ||
| 732 | ctx->opt.domain_id = NULL; | ||
| 733 | sbi->devs = ctx->devs; | 731 | sbi->devs = ctx->devs; |
| 734 | ctx->devs = NULL; | 732 | ctx->devs = NULL; |
| 733 | sbi->fsid = ctx->fsid; | ||
| 734 | ctx->fsid = NULL; | ||
| 735 | sbi->domain_id = ctx->domain_id; | ||
| 736 | ctx->domain_id = NULL; | ||
| 735 | 737 | ||
| 736 | if (erofs_is_fscache_mode(sb)) { | 738 | if (erofs_is_fscache_mode(sb)) { |
| 737 | sb->s_blocksize = EROFS_BLKSIZ; | 739 | sb->s_blocksize = EROFS_BLKSIZ; |
| @@ -820,7 +822,7 @@ static int erofs_fc_get_tree(struct fs_context *fc) · 82 unmodified lines | |||
| 820 | { | 822 | { |
| 821 | struct erofs_fs_context *ctx = fc->fs_private; | 823 | struct erofs_fs_context *ctx = fc->fs_private; |
| 822 | 824 | ||
| 823 | if (IS_ENABLED(CONFIG_EROFS_FS_ONDEMAND) && ctx->opt.fsid) | 825 | if (IS_ENABLED(CONFIG_EROFS_FS_ONDEMAND) && ctx->fsid) |
| 824 | return get_tree_nodev(fc, erofs_fc_fill_super); | 826 | return get_tree_nodev(fc, erofs_fc_fill_super); |
| 825 | 827 | ||
| 826 | return get_tree_bdev(fc, erofs_fc_fill_super); | 828 | return get_tree_bdev(fc, erofs_fc_fill_super); |
| @@ -834,6 +836,9 @@ static int erofs_fc_reconfigure(struct fs_context *fc) · 7 unmodified lines | |||
| 834 | 836 | ||
| 835 | DBG_BUGON(!sb_rdonly(sb)); | 837 | DBG_BUGON(!sb_rdonly(sb)); |
| 836 | 838 | ||
| 839 | if (ctx->fsid || ctx->domain_id) | ||
| 840 | erofs_info(sb, "ignoring reconfiguration for fsid|domain_id."); | ||
| 841 | |||
| 837 | if (test_opt(&ctx->opt, POSIX_ACL)) | 842 | if (test_opt(&ctx->opt, POSIX_ACL)) |
| 838 | fc->sb_flags |= SB_POSIXACL; | 843 | fc->sb_flags |= SB_POSIXACL; |
| 839 | else | 844 | else |
| @@ -873,8 +878,8 @@ static void erofs_fc_free(struct fs_context *fc) · 33 unmodified lines | |||
| 873 | struct erofs_fs_context *ctx = fc->fs_private; | 878 | struct erofs_fs_context *ctx = fc->fs_private; |
| 874 | 879 | ||
| 875 | erofs_free_dev_context(ctx->devs); | 880 | erofs_free_dev_context(ctx->devs); |
| 876 | kfree(ctx->opt.fsid); | 881 | kfree(ctx->fsid); |
| 877 | kfree(ctx->opt.domain_id); | 882 | kfree(ctx->domain_id); |
| 878 | kfree(ctx); | 883 | kfree(ctx); |
| 879 | } | 884 | } |
| 880 | 885 | ||
| @@ -944,8 +949,8 @@ static void erofs_kill_sb(struct super_block *sb) · 63 unmodified lines | |||
| 944 | erofs_free_dev_context(sbi->devs); | 949 | erofs_free_dev_context(sbi->devs); |
| 945 | fs_put_dax(sbi->dax_dev, NULL); | 950 | fs_put_dax(sbi->dax_dev, NULL); |
| 946 | erofs_fscache_unregister_fs(sb); | 951 | erofs_fscache_unregister_fs(sb); |
| 947 | kfree(sbi->opt.fsid); | 952 | kfree(sbi->fsid); |
| 948 | kfree(sbi->opt.domain_id); | 953 | kfree(sbi->domain_id); |
| 949 | kfree(sbi); | 954 | kfree(sbi); |
| 950 | sb->s_fs_info = NULL; | 955 | sb->s_fs_info = NULL; |
| 951 | } | 956 | } |
| @@ -1098,10 +1103,10 @@ static int erofs_show_options(struct seq_file *seq, struct dentry *root) · 146 unmodified lines | |||
| 1098 | if (test_opt(opt, DAX_NEVER)) | 1103 | if (test_opt(opt, DAX_NEVER)) |
| 1099 | seq_puts(seq, ",dax=never"); | 1104 | seq_puts(seq, ",dax=never"); |
| 1100 | #ifdef CONFIG_EROFS_FS_ONDEMAND | 1105 | #ifdef CONFIG_EROFS_FS_ONDEMAND |
| 1101 | if (opt->fsid) | 1106 | if (sbi->fsid) |
| 1102 | seq_printf(seq, ",fsid=%s", opt->fsid); | 1107 | seq_printf(seq, ",fsid=%s", sbi->fsid); |
| 1103 | if (opt->domain_id) | 1108 | if (sbi->domain_id) |
| 1104 | seq_printf(seq, ",domain_id=%s", opt->domain_id); | 1109 | seq_printf(seq, ",domain_id=%s", sbi->domain_id); |
| 1105 | #endif | 1110 | #endif |
| 1106 | return 0; | 1111 | return 0; |
| 1107 | } | 1112 | } |
| @@ -210,14 +210,14 @@ int erofs_register_sysfs(struct super_block *sb) · 209 unmodified lines | |||
| 210 | int err; | 210 | int err; |
| 211 | 211 | ||
| 212 | if (erofs_is_fscache_mode(sb)) { | 212 | if (erofs_is_fscache_mode(sb)) { |
| 213 | if (sbi->opt.domain_id) { | 213 | if (sbi->domain_id) { |
| 214 | str = kasprintf(GFP_KERNEL, "%s,%s", sbi->opt.domain_id, | 214 | str = kasprintf(GFP_KERNEL, "%s,%s", sbi->domain_id, |
| 215 | sbi->opt.fsid); | 215 | sbi->fsid); |
| 216 | if (!str) | 216 | if (!str) |
| 217 | return -ENOMEM; | 217 | return -ENOMEM; |
| 218 | name = str; | 218 | name = str; |
| 219 | } else { | 219 | } else { |
| 220 | name = sbi->opt.fsid; | 220 | name = sbi->fsid; |
| 221 | } | 221 | } |
| 222 | } else { | 222 | } else { |
| 223 | name = sb->s_id; | 223 | name = sb->s_id; |
| @@ -660,6 +660,9 @@ static int z_erofs_read_fragment(struct inode *inode, erofs_off_t pos, · 659 unmodified lines | |||
| 660 | u8 *src, *dst; | 660 | u8 *src, *dst; |
| 661 | unsigned int i, cnt; | 661 | unsigned int i, cnt; |
| 662 | 662 | ||
| 663 | if (!packed_inode) | ||
| 664 | return -EFSCORRUPTED; | ||
| 665 | |||
| 663 | pos += EROFS_I(inode)->z_fragmentoff; | 666 | pos += EROFS_I(inode)->z_fragmentoff; |
| 664 | for (i = 0; i < len; i += cnt) { | 667 | for (i = 0; i < len; i += cnt) { |
| 665 | cnt = min_t(unsigned int, len - i, | 668 | cnt = min_t(unsigned int, len - i, |
| @@ -31,10 +31,15 @@ static DEFINE_SPINLOCK(kernfs_idr_lock); /* root->ino_idr */ · 30 unmodified lines | |||
| 31 | 31 | ||
| 32 | #define rb_to_kn(X) rb_entry((X), struct kernfs_node, rb) | 32 | #define rb_to_kn(X) rb_entry((X), struct kernfs_node, rb) |
| 33 | 33 | ||
| 34 | static bool __kernfs_active(struct kernfs_node *kn) | ||
| 35 | { | ||
| 36 | return atomic_read(&kn->active) >= 0; | ||
| 37 | } | ||
| 38 | |||
| 34 | static bool kernfs_active(struct kernfs_node *kn) | 39 | static bool kernfs_active(struct kernfs_node *kn) |
| 35 | { | 40 | { |
| 36 | lockdep_assert_held(&kernfs_root(kn)->kernfs_rwsem); | 41 | lockdep_assert_held(&kernfs_root(kn)->kernfs_rwsem); |
| 37 | return atomic_read(&kn->active) >= 0; | 42 | return __kernfs_active(kn); |
| 38 | } | 43 | } |
| 39 | 44 | ||
| 40 | static bool kernfs_lockdep(struct kernfs_node *kn) | 45 | static bool kernfs_lockdep(struct kernfs_node *kn) |
| @@ -705,7 +710,12 @@ struct kernfs_node *kernfs_find_and_get_node_by_id(struct kernfs_root *root, · 664 unmodified lines | |||
| 705 | goto err_unlock; | 710 | goto err_unlock; |
| 706 | } | 711 | } |
| 707 | 712 | ||
| 708 | if (unlikely(!kernfs_active(kn) || !atomic_inc_not_zero(&kn->count))) | 713 | /* |
| 714 | * We should fail if @kn has never been activated and guarantee success | ||
| 715 | * if the caller knows that @kn is active. Both can be achieved by | ||
| 716 | * __kernfs_active() which tests @kn->active without kernfs_rwsem. | ||
| 717 | */ | ||
| 718 | if (unlikely(!__kernfs_active(kn) || !atomic_inc_not_zero(&kn->count))) | ||
| 709 | goto err_unlock; | 719 | goto err_unlock; |
| 710 | 720 | ||
| 711 | spin_unlock(&kernfs_idr_lock); | 721 | spin_unlock(&kernfs_idr_lock); |
| @@ -17,9 +17,9 @@ void netfs_rreq_unlock_folios(struct netfs_io_request *rreq) · 16 unmodified lines | |||
| 17 | { | 17 | { |
| 18 | struct netfs_io_subrequest *subreq; | 18 | struct netfs_io_subrequest *subreq; |
| 19 | struct folio *folio; | 19 | struct folio *folio; |
| 20 | unsigned int iopos, account = 0; | ||
| 21 | pgoff_t start_page = rreq->start / PAGE_SIZE; | 20 | pgoff_t start_page = rreq->start / PAGE_SIZE; |
| 22 | pgoff_t last_page = ((rreq->start + rreq->len) / PAGE_SIZE) - 1; | 21 | pgoff_t last_page = ((rreq->start + rreq->len) / PAGE_SIZE) - 1; |
| 22 | size_t account = 0; | ||
| 23 | bool subreq_failed = false; | 23 | bool subreq_failed = false; |
| 24 | 24 | ||
| 25 | XA_STATE(xas, &rreq->mapping->i_pages, start_page); | 25 | XA_STATE(xas, &rreq->mapping->i_pages, start_page); |
| @@ -39,18 +39,23 @@ void netfs_rreq_unlock_folios(struct netfs_io_request *rreq) · 13 unmodified lines | |||
| 39 | */ | 39 | */ |
| 40 | subreq = list_first_entry(&rreq->subrequests, | 40 | subreq = list_first_entry(&rreq->subrequests, |
| 41 | struct netfs_io_subrequest, rreq_link); | 41 | struct netfs_io_subrequest, rreq_link); |
| 42 | iopos = 0; | ||
| 43 | subreq_failed = (subreq->error < 0); | 42 | subreq_failed = (subreq->error < 0); |
| 44 | 43 | ||
| 45 | trace_netfs_rreq(rreq, netfs_rreq_trace_unlock); | 44 | trace_netfs_rreq(rreq, netfs_rreq_trace_unlock); |
| 46 | 45 | ||
| 47 | rcu_read_lock(); | 46 | rcu_read_lock(); |
| 48 | xas_for_each(&xas, folio, last_page) { | 47 | xas_for_each(&xas, folio, last_page) { |
| 49 | unsigned int pgpos = (folio_index(folio) - start_page) * PAGE_SIZE; | 48 | loff_t pg_end; |
| 50 | unsigned int pgend = pgpos + folio_size(folio); | ||
| 51 | bool pg_failed = false; | 49 | bool pg_failed = false; |
| 52 | 50 | ||
| 51 | if (xas_retry(&xas, folio)) | ||
| 52 | continue; | ||
| 53 | |||
| 54 | pg_end = folio_pos(folio) + folio_size(folio) - 1; | ||
| 55 | |||
| 53 | for (;;) { | 56 | for (;;) { |
| 57 | loff_t sreq_end; | ||
| 58 | |||
| 54 | if (!subreq) { | 59 | if (!subreq) { |
| 55 | pg_failed = true; | 60 | pg_failed = true; |
| 56 | break; | 61 | break; |
| @@ -58,11 +63,11 @@ void netfs_rreq_unlock_folios(struct netfs_io_request *rreq) · 1 unmodified line | |||
| 58 | if (test_bit(NETFS_SREQ_COPY_TO_CACHE, &subreq->flags)) | 63 | if (test_bit(NETFS_SREQ_COPY_TO_CACHE, &subreq->flags)) |
| 59 | folio_start_fscache(folio); | 64 | folio_start_fscache(folio); |
| 60 | pg_failed |= subreq_failed; | 65 | pg_failed |= subreq_failed; |
| 61 | if (pgend < iopos + subreq->len) | 66 | sreq_end = subreq->start + subreq->len - 1; |
| 67 | if (pg_end < sreq_end) | ||
| 62 | break; | 68 | break; |
| 63 | 69 | ||
| 64 | account += subreq->transferred; | 70 | account += subreq->transferred; |
| 65 | iopos += subreq->len; | ||
| 66 | if (!list_is_last(&subreq->rreq_link, &rreq->subrequests)) { | 71 | if (!list_is_last(&subreq->rreq_link, &rreq->subrequests)) { |
| 67 | subreq = list_next_entry(subreq, rreq_link); | 72 | subreq = list_next_entry(subreq, rreq_link); |
| 68 | subreq_failed = (subreq->error < 0); | 73 | subreq_failed = (subreq->error < 0); |
| @@ -70,7 +75,8 @@ void netfs_rreq_unlock_folios(struct netfs_io_request *rreq) · 1 unmodified line | |||
| 70 | subreq = NULL; | 75 | subreq = NULL; |
| 71 | subreq_failed = false; | 76 | subreq_failed = false; |
| 72 | } | 77 | } |
| 73 | if (pgend == iopos) | 78 | |
| 79 | if (pg_end == sreq_end) | ||
| 74 | break; | 80 | break; |
| 75 | } | 81 | } |
| 76 | 82 | ||
| @@ -121,6 +121,9 @@ static void netfs_rreq_unmark_after_write(struct netfs_io_request *rreq, · 120 unmodified lines | |||
| 121 | XA_STATE(xas, &rreq->mapping->i_pages, subreq->start / PAGE_SIZE); | 121 | XA_STATE(xas, &rreq->mapping->i_pages, subreq->start / PAGE_SIZE); |
| 122 | 122 | ||
| 123 | xas_for_each(&xas, folio, (subreq->start + subreq->len - 1) / PAGE_SIZE) { | 123 | xas_for_each(&xas, folio, (subreq->start + subreq->len - 1) / PAGE_SIZE) { |
| 124 | if (xas_retry(&xas, folio)) | ||
| 125 | continue; | ||
| 126 | |||
| 124 | /* We might have multiple writes from the same huge | 127 | /* We might have multiple writes from the same huge |
| 125 | * folio, but we mustn't unlock a folio more than once. | 128 | * folio, but we mustn't unlock a folio more than once. |
| 126 | */ | 129 | */ |
| @@ -254,7 +254,10 @@ TRACE_EVENT_CONDITION(nfsd_fh_verify_err, · 253 unmodified lines | |||
| 254 | rqstp->rq_xprt->xpt_remotelen); | 254 | rqstp->rq_xprt->xpt_remotelen); |
| 255 | __entry->xid = be32_to_cpu(rqstp->rq_xid); | 255 | __entry->xid = be32_to_cpu(rqstp->rq_xid); |
| 256 | __entry->fh_hash = knfsd_fh_hash(&fhp->fh_handle); | 256 | __entry->fh_hash = knfsd_fh_hash(&fhp->fh_handle); |
| 257 | __entry->inode = d_inode(fhp->fh_dentry); | 257 | if (fhp->fh_dentry) |
| 258 | __entry->inode = d_inode(fhp->fh_dentry); | ||
| 259 | else | ||
| 260 | __entry->inode = NULL; | ||
| 258 | __entry->type = type; | 261 | __entry->type = type; |
| 259 | __entry->access = access; | 262 | __entry->access = access; |
| 260 | __entry->error = be32_to_cpu(error); | 263 | __entry->error = be32_to_cpu(error); |
| @@ -478,14 +478,22 @@ static void __zonefs_io_error(struct inode *inode, bool write) · 477 unmodified lines | |||
| 478 | struct super_block *sb = inode->i_sb; | 478 | struct super_block *sb = inode->i_sb; |
| 479 | struct zonefs_sb_info *sbi = ZONEFS_SB(sb); | 479 | struct zonefs_sb_info *sbi = ZONEFS_SB(sb); |
| 480 | unsigned int noio_flag; | 480 | unsigned int noio_flag; |
| 481 | unsigned int nr_zones = | 481 | unsigned int nr_zones = 1; |
| 482 | zi->i_zone_size >> (sbi->s_zone_sectors_shift + SECTOR_SHIFT); | ||
| 483 | struct zonefs_ioerr_data err = { | 482 | struct zonefs_ioerr_data err = { |
| 484 | .inode = inode, | 483 | .inode = inode, |
| 485 | .write = write, | 484 | .write = write, |
| 486 | }; | 485 | }; |
| 487 | int ret; | 486 | int ret; |
| 488 | 487 | ||
| 488 | /* | ||
| 489 | * The only files that have more than one zone are conventional zone | ||
| 490 | * files with aggregated conventional zones, for which the inode zone | ||
| 491 | * size is always larger than the device zone size. | ||
| 492 | */ | ||
| 493 | if (zi->i_zone_size > bdev_zone_sectors(sb->s_bdev)) | ||
| 494 | nr_zones = zi->i_zone_size >> | ||
| 495 | (sbi->s_zone_sectors_shift + SECTOR_SHIFT); | ||
| 496 | |||
| 489 | /* | 497 | /* |
| 490 | * Memory allocations in blkdev_report_zones() can trigger a memory | 498 | * Memory allocations in blkdev_report_zones() can trigger a memory |
| 491 | * reclaim which may in turn cause a recursion into zonefs as well as | 499 | * reclaim which may in turn cause a recursion into zonefs as well as |
| @@ -1407,6 +1415,14 @@ static int zonefs_init_file_inode(struct inode *inode, struct blk_zone *zone, · 915 unmodified lines | |||
| 1407 | zi->i_ztype = type; | 1415 | zi->i_ztype = type; |
| 1408 | zi->i_zsector = zone->start; | 1416 | zi->i_zsector = zone->start; |
| 1409 | zi->i_zone_size = zone->len << SECTOR_SHIFT; | 1417 | zi->i_zone_size = zone->len << SECTOR_SHIFT; |
| 1418 | if (zi->i_zone_size > bdev_zone_sectors(sb->s_bdev) << SECTOR_SHIFT && | ||
| 1419 | !(sbi->s_features & ZONEFS_F_AGGRCNV)) { | ||
| 1420 | zonefs_err(sb, | ||
| 1421 | "zone size %llu doesn't match device's zone sectors %llu\n", | ||
| 1422 | zi->i_zone_size, | ||
| 1423 | bdev_zone_sectors(sb->s_bdev) << SECTOR_SHIFT); | ||
| 1424 | return -EINVAL; | ||
| 1425 | } | ||
| 1410 | 1426 | ||
| 1411 | zi->i_max_size = min_t(loff_t, MAX_LFS_FILESIZE, | 1427 | zi->i_max_size = min_t(loff_t, MAX_LFS_FILESIZE, |
| 1412 | zone->capacity << SECTOR_SHIFT); | 1428 | zone->capacity << SECTOR_SHIFT); |
| @@ -1456,11 +1472,11 @@ static struct dentry *zonefs_create_inode(struct dentry *parent, · 43 unmodified lines | |||
| 1456 | struct inode *dir = d_inode(parent); | 1472 | struct inode *dir = d_inode(parent); |
| 1457 | struct dentry *dentry; | 1473 | struct dentry *dentry; |
| 1458 | struct inode *inode; | 1474 | struct inode *inode; |
| 1459 | int ret; | 1475 | int ret = -ENOMEM; |
| 1460 | 1476 | ||
| 1461 | dentry = d_alloc_name(parent, name); | 1477 | dentry = d_alloc_name(parent, name); |
| 1462 | if (!dentry) | 1478 | if (!dentry) |
| 1463 | return NULL; | 1479 | return ERR_PTR(ret); |
| 1464 | 1480 | ||
| 1465 | inode = new_inode(parent->d_sb); | 1481 | inode = new_inode(parent->d_sb); |
| 1466 | if (!inode) | 1482 | if (!inode) |
| @@ -1485,7 +1501,7 @@ static struct dentry *zonefs_create_inode(struct dentry *parent, · 18 unmodified lines | |||
| 1485 | dput: | 1501 | dput: |
| 1486 | dput(dentry); | 1502 | dput(dentry); |
| 1487 | 1503 | ||
| 1488 | return NULL; | 1504 | return ERR_PTR(ret); |
| 1489 | } | 1505 | } |
| 1490 | 1506 | ||
| 1491 | struct zonefs_zone_data { | 1507 | struct zonefs_zone_data { |
| @@ -1505,7 +1521,7 @@ static int zonefs_create_zgroup(struct zonefs_zone_data *zd, · 13 unmodified lines | |||
| 1505 | struct blk_zone *zone, *next, *end; | 1521 | struct blk_zone *zone, *next, *end; |
| 1506 | const char *zgroup_name; | 1522 | const char *zgroup_name; |
| 1507 | char *file_name; | 1523 | char *file_name; |
| 1508 | struct dentry *dir; | 1524 | struct dentry *dir, *dent; |
| 1509 | unsigned int n = 0; | 1525 | unsigned int n = 0; |
| 1510 | int ret; | 1526 | int ret; |
| 1511 | 1527 | ||
| @@ -1523,8 +1539,8 @@ static int zonefs_create_zgroup(struct zonefs_zone_data *zd, · 11 unmodified lines | |||
| 1523 | zgroup_name = "seq"; | 1539 | zgroup_name = "seq"; |
| 1524 | 1540 | ||
| 1525 | dir = zonefs_create_inode(sb->s_root, zgroup_name, NULL, type); | 1541 | dir = zonefs_create_inode(sb->s_root, zgroup_name, NULL, type); |
| 1526 | if (!dir) { | 1542 | if (IS_ERR(dir)) { |
| 1527 | ret = -ENOMEM; | 1543 | ret = PTR_ERR(dir); |
| 1528 | goto free; | 1544 | goto free; |
| 1529 | } | 1545 | } |
| 1530 | 1546 | ||
| @@ -1570,8 +1586,9 @@ static int zonefs_create_zgroup(struct zonefs_zone_data *zd, · 39 unmodified lines | |||
| 1570 | * Use the file number within its group as file name. | 1586 | * Use the file number within its group as file name. |
| 1571 | */ | 1587 | */ |
| 1572 | snprintf(file_name, ZONEFS_NAME_MAX - 1, "%u", n); | 1588 | snprintf(file_name, ZONEFS_NAME_MAX - 1, "%u", n); |
| 1573 | if (!zonefs_create_inode(dir, file_name, zone, type)) { | 1589 | dent = zonefs_create_inode(dir, file_name, zone, type); |
| 1574 | ret = -ENOMEM; | 1590 | if (IS_ERR(dent)) { |
| 1591 | ret = PTR_ERR(dent); | ||
| 1575 | goto free; | 1592 | goto free; |
| 1576 | } | 1593 | } |
| 1577 | 1594 | ||
| @@ -15,11 +15,6 @@ struct zonefs_sysfs_attr { · 14 unmodified lines | |||
| 15 | ssize_t (*show)(struct zonefs_sb_info *sbi, char *buf); | 15 | ssize_t (*show)(struct zonefs_sb_info *sbi, char *buf); |
| 16 | }; | 16 | }; |
| 17 | 17 | ||
| 18 | static inline struct zonefs_sysfs_attr *to_attr(struct attribute *attr) | ||
| 19 | { | ||
| 20 | return container_of(attr, struct zonefs_sysfs_attr, attr); | ||
| 21 | } | ||
| 22 | |||
| 23 | #define ZONEFS_SYSFS_ATTR_RO(name) \ | 18 | #define ZONEFS_SYSFS_ATTR_RO(name) \ |
| 24 | static struct zonefs_sysfs_attr zonefs_sysfs_attr_##name = __ATTR_RO(name) | 19 | static struct zonefs_sysfs_attr zonefs_sysfs_attr_##name = __ATTR_RO(name) |
| 25 | 20 | ||
| @@ -311,6 +311,13 @@ struct queue_limits { · 310 unmodified lines | |||
| 311 | unsigned char discard_misaligned; | 311 | unsigned char discard_misaligned; |
| 312 | unsigned char raid_partial_stripes_expensive; | 312 | unsigned char raid_partial_stripes_expensive; |
| 313 | enum blk_zoned_model zoned; | 313 | enum blk_zoned_model zoned; |
| 314 | |||
| 315 | /* | ||
| 316 | * Drivers that set dma_alignment to less than 511 must be prepared to | ||
| 317 | * handle individual bvec's that are not a multiple of a SECTOR_SIZE | ||
| 318 | * due to possible offsets. | ||
| 319 | */ | ||
| 320 | unsigned int dma_alignment; | ||
| 314 | }; | 321 | }; |
| 315 | 322 | ||
| 316 | typedef int (*report_zones_cb)(struct blk_zone *zone, unsigned int idx, | 323 | typedef int (*report_zones_cb)(struct blk_zone *zone, unsigned int idx, |
| @@ -456,12 +463,6 @@ struct request_queue { · 139 unmodified lines | |||
| 456 | unsigned long nr_requests; /* Max # of requests */ | 463 | unsigned long nr_requests; /* Max # of requests */ |
| 457 | 464 | ||
| 458 | unsigned int dma_pad_mask; | 465 | unsigned int dma_pad_mask; |
| 459 | /* | ||
| 460 | * Drivers that set dma_alignment to less than 511 must be prepared to | ||
| 461 | * handle individual bvec's that are not a multiple of a SECTOR_SIZE | ||
| 462 | * due to possible offsets. | ||
| 463 | */ | ||
| 464 | unsigned int dma_alignment; | ||
| 465 | 466 | ||
| 466 | #ifdef CONFIG_BLK_INLINE_ENCRYPTION | 467 | #ifdef CONFIG_BLK_INLINE_ENCRYPTION |
| 467 | struct blk_crypto_profile *crypto_profile; | 468 | struct blk_crypto_profile *crypto_profile; |
| @@ -944,7 +945,6 @@ extern void blk_queue_io_min(struct request_queue *q, unsigned int min); · 476 unmodified lines | |||
| 944 | extern void blk_limits_io_opt(struct queue_limits *limits, unsigned int opt); | 945 | extern void blk_limits_io_opt(struct queue_limits *limits, unsigned int opt); |
| 945 | extern void blk_queue_io_opt(struct request_queue *q, unsigned int opt); | 946 | extern void blk_queue_io_opt(struct request_queue *q, unsigned int opt); |
| 946 | extern void blk_set_queue_depth(struct request_queue *q, unsigned int depth); | 947 | extern void blk_set_queue_depth(struct request_queue *q, unsigned int depth); |
| 947 | extern void blk_set_default_limits(struct queue_limits *lim); | ||
| 948 | extern void blk_set_stacking_limits(struct queue_limits *lim); | 948 | extern void blk_set_stacking_limits(struct queue_limits *lim); |
| 949 | extern int blk_stack_limits(struct queue_limits *t, struct queue_limits *b, | 949 | extern int blk_stack_limits(struct queue_limits *t, struct queue_limits *b, |
| 950 | sector_t offset); | 950 | sector_t offset); |
| @@ -1324,7 +1324,7 @@ static inline sector_t bdev_zone_sectors(struct block_device *bdev) · 373 unmodified lines | |||
| 1324 | 1324 | ||
| 1325 | static inline int queue_dma_alignment(const struct request_queue *q) | 1325 | static inline int queue_dma_alignment(const struct request_queue *q) |
| 1326 | { | 1326 | { |
| 1327 | return q ? q->dma_alignment : 511; | 1327 | return q ? q->limits.dma_alignment : 511; |
| 1328 | } | 1328 | } |
| 1329 | 1329 | ||
| 1330 | static inline unsigned int bdev_dma_alignment(struct block_device *bdev) | 1330 | static inline unsigned int bdev_dma_alignment(struct block_device *bdev) |
| @@ -27,7 +27,7 @@ · 26 unmodified lines | |||
| 27 | #include <linux/bpfptr.h> | 27 | #include <linux/bpfptr.h> |
| 28 | #include <linux/btf.h> | 28 | #include <linux/btf.h> |
| 29 | #include <linux/rcupdate_trace.h> | 29 | #include <linux/rcupdate_trace.h> |
| 30 | #include <linux/init.h> | 30 | #include <linux/static_call.h> |
| 31 | 31 | ||
| 32 | struct bpf_verifier_env; | 32 | struct bpf_verifier_env; |
| 33 | struct bpf_verifier_log; | 33 | struct bpf_verifier_log; |
| @@ -315,7 +315,7 @@ static inline void __copy_map_value(struct bpf_map *map, void *dst, void *src, b · 281 unmodified lines | |||
| 315 | u32 next_off = map->off_arr->field_off[i]; | 315 | u32 next_off = map->off_arr->field_off[i]; |
| 316 | 316 | ||
| 317 | memcpy(dst + curr_off, src + curr_off, next_off - curr_off); | 317 | memcpy(dst + curr_off, src + curr_off, next_off - curr_off); |
| 318 | curr_off += map->off_arr->field_sz[i]; | 318 | curr_off = next_off + map->off_arr->field_sz[i]; |
| 319 | } | 319 | } |
| 320 | memcpy(dst + curr_off, src + curr_off, map->value_size - curr_off); | 320 | memcpy(dst + curr_off, src + curr_off, map->value_size - curr_off); |
| 321 | } | 321 | } |
| @@ -344,7 +344,7 @@ static inline void zero_map_value(struct bpf_map *map, void *dst) · 22 unmodified lines | |||
| 344 | u32 next_off = map->off_arr->field_off[i]; | 344 | u32 next_off = map->off_arr->field_off[i]; |
| 345 | 345 | ||
| 346 | memset(dst + curr_off, 0, next_off - curr_off); | 346 | memset(dst + curr_off, 0, next_off - curr_off); |
| 347 | curr_off += map->off_arr->field_sz[i]; | 347 | curr_off = next_off + map->off_arr->field_sz[i]; |
| 348 | } | 348 | } |
| 349 | memset(dst + curr_off, 0, map->value_size - curr_off); | 349 | memset(dst + curr_off, 0, map->value_size - curr_off); |
| 350 | } | 350 | } |
| @@ -954,6 +954,10 @@ struct bpf_dispatcher { · 603 unmodified lines | |||
| 954 | void *rw_image; | 954 | void *rw_image; |
| 955 | u32 image_off; | 955 | u32 image_off; |
| 956 | struct bpf_ksym ksym; | 956 | struct bpf_ksym ksym; |
| 957 | #ifdef CONFIG_HAVE_STATIC_CALL | ||
| 958 | struct static_call_key *sc_key; | ||
| 959 | void *sc_tramp; | ||
| 960 | #endif | ||
| 957 | }; | 961 | }; |
| 958 | 962 | ||
| 959 | static __always_inline __nocfi unsigned int bpf_dispatcher_nop_func( | 963 | static __always_inline __nocfi unsigned int bpf_dispatcher_nop_func( |
| @@ -971,7 +975,33 @@ struct bpf_trampoline *bpf_trampoline_get(u64 key, · 11 unmodified lines | |||
| 971 | struct bpf_attach_target_info *tgt_info); | 975 | struct bpf_attach_target_info *tgt_info); |
| 972 | void bpf_trampoline_put(struct bpf_trampoline *tr); | 976 | void bpf_trampoline_put(struct bpf_trampoline *tr); |
| 973 | int arch_prepare_bpf_dispatcher(void *image, void *buf, s64 *funcs, int num_funcs); | 977 | int arch_prepare_bpf_dispatcher(void *image, void *buf, s64 *funcs, int num_funcs); |
| 974 | int __init bpf_arch_init_dispatcher_early(void *ip); | 978 | |
| 979 | /* | ||
| 980 | * When the architecture supports STATIC_CALL replace the bpf_dispatcher_fn | ||
| 981 | * indirection with a direct call to the bpf program. If the architecture does | ||
| 982 | * not have STATIC_CALL, avoid a double-indirection. | ||
| 983 | */ | ||
| 984 | #ifdef CONFIG_HAVE_STATIC_CALL | ||
| 985 | |||
| 986 | #define __BPF_DISPATCHER_SC_INIT(_name) \ | ||
| 987 | .sc_key = &STATIC_CALL_KEY(_name), \ | ||
| 988 | .sc_tramp = STATIC_CALL_TRAMP_ADDR(_name), | ||
| 989 | |||
| 990 | #define __BPF_DISPATCHER_SC(name) \ | ||
| 991 | DEFINE_STATIC_CALL(bpf_dispatcher_##name##_call, bpf_dispatcher_nop_func) | ||
| 992 | |||
| 993 | #define __BPF_DISPATCHER_CALL(name) \ | ||
| 994 | static_call(bpf_dispatcher_##name##_call)(ctx, insnsi, bpf_func) | ||
| 995 | |||
| 996 | #define __BPF_DISPATCHER_UPDATE(_d, _new) \ | ||
| 997 | __static_call_update((_d)->sc_key, (_d)->sc_tramp, (_new)) | ||
| 998 | |||
| 999 | #else | ||
| 1000 | #define __BPF_DISPATCHER_SC_INIT(name) | ||
| 1001 | #define __BPF_DISPATCHER_SC(name) | ||
| 1002 | #define __BPF_DISPATCHER_CALL(name) bpf_func(ctx, insnsi) | ||
| 1003 | #define __BPF_DISPATCHER_UPDATE(_d, _new) | ||
| 1004 | #endif | ||
| 975 | 1005 | ||
| 976 | #define BPF_DISPATCHER_INIT(_name) { \ | 1006 | #define BPF_DISPATCHER_INIT(_name) { \ |
| 977 | .mutex = __MUTEX_INITIALIZER(_name.mutex), \ | 1007 | .mutex = __MUTEX_INITIALIZER(_name.mutex), \ |
| @@ -984,34 +1014,21 @@ int __init bpf_arch_init_dispatcher_early(void *ip); · 6 unmodified lines | |||
| 984 | .name = #_name, \ | 1014 | .name = #_name, \ |
| 985 | .lnode = LIST_HEAD_INIT(_name.ksym.lnode), \ | 1015 | .lnode = LIST_HEAD_INIT(_name.ksym.lnode), \ |
| 986 | }, \ | 1016 | }, \ |
| 1017 | __BPF_DISPATCHER_SC_INIT(_name##_call) \ | ||
| 987 | } | 1018 | } |
| 988 | 1019 | ||
| 989 | #define BPF_DISPATCHER_INIT_CALL(_name) \ | ||
| 990 | static int __init _name##_init(void) \ | ||
| 991 | { \ | ||
| 992 | return bpf_arch_init_dispatcher_early(_name##_func); \ | ||
| 993 | } \ | ||
| 994 | early_initcall(_name##_init) | ||
| 995 | |||
| 996 | #ifdef CONFIG_X86_64 | ||
| 997 | #define BPF_DISPATCHER_ATTRIBUTES __attribute__((patchable_function_entry(5))) | ||
| 998 | #else | ||
| 999 | #define BPF_DISPATCHER_ATTRIBUTES | ||
| 1000 | #endif | ||
| 1001 | |||
| 1002 | #define DEFINE_BPF_DISPATCHER(name) \ | 1020 | #define DEFINE_BPF_DISPATCHER(name) \ |
| 1003 | notrace BPF_DISPATCHER_ATTRIBUTES \ | 1021 | __BPF_DISPATCHER_SC(name); \ |
| 1004 | noinline __nocfi unsigned int bpf_dispatcher_##name##_func( \ | 1022 | noinline __nocfi unsigned int bpf_dispatcher_##name##_func( \ |
| 1005 | const void *ctx, \ | 1023 | const void *ctx, \ |
| 1006 | const struct bpf_insn *insnsi, \ | 1024 | const struct bpf_insn *insnsi, \ |
| 1007 | bpf_func_t bpf_func) \ | 1025 | bpf_func_t bpf_func) \ |
| 1008 | { \ | 1026 | { \ |
| 1009 | return bpf_func(ctx, insnsi); \ | 1027 | return __BPF_DISPATCHER_CALL(name); \ |
| 1010 | } \ | 1028 | } \ |
| 1011 | EXPORT_SYMBOL(bpf_dispatcher_##name##_func); \ | 1029 | EXPORT_SYMBOL(bpf_dispatcher_##name##_func); \ |
| 1012 | struct bpf_dispatcher bpf_dispatcher_##name = \ | 1030 | struct bpf_dispatcher bpf_dispatcher_##name = \ |
| 1013 | BPF_DISPATCHER_INIT(bpf_dispatcher_##name); \ | 1031 | BPF_DISPATCHER_INIT(bpf_dispatcher_##name); |
| 1014 | BPF_DISPATCHER_INIT_CALL(bpf_dispatcher_##name); | ||
| 1015 | 1032 | ||
| 1016 | #define DECLARE_BPF_DISPATCHER(name) \ | 1033 | #define DECLARE_BPF_DISPATCHER(name) \ |
| 1017 | unsigned int bpf_dispatcher_##name##_func( \ | 1034 | unsigned int bpf_dispatcher_##name##_func( \ |
| @@ -1019,6 +1036,7 @@ int __init bpf_arch_init_dispatcher_early(void *ip); · 1 unmodified line | |||
| 1019 | const struct bpf_insn *insnsi, \ | 1036 | const struct bpf_insn *insnsi, \ |
| 1020 | bpf_func_t bpf_func); \ | 1037 | bpf_func_t bpf_func); \ |
| 1021 | extern struct bpf_dispatcher bpf_dispatcher_##name; | 1038 | extern struct bpf_dispatcher bpf_dispatcher_##name; |
| 1039 | |||
| 1022 | #define BPF_DISPATCHER_FUNC(name) bpf_dispatcher_##name##_func | 1040 | #define BPF_DISPATCHER_FUNC(name) bpf_dispatcher_##name##_func |
| 1023 | #define BPF_DISPATCHER_PTR(name) (&bpf_dispatcher_##name) | 1041 | #define BPF_DISPATCHER_PTR(name) (&bpf_dispatcher_##name) |
| 1024 | void bpf_dispatcher_change_prog(struct bpf_dispatcher *d, struct bpf_prog *from, | 1042 | void bpf_dispatcher_change_prog(struct bpf_dispatcher *d, struct bpf_prog *from, |
| @@ -16,6 +16,9 @@ enum io_uring_cmd_flags { · 15 unmodified lines | |||
| 16 | IO_URING_F_SQE128 = 4, | 16 | IO_URING_F_SQE128 = 4, |
| 17 | IO_URING_F_CQE32 = 8, | 17 | IO_URING_F_CQE32 = 8, |
| 18 | IO_URING_F_IOPOLL = 16, | 18 | IO_URING_F_IOPOLL = 16, |
| 19 | |||
| 20 | /* the request is executed from poll, it should not be freed */ | ||
| 21 | IO_URING_F_MULTISHOT = 32, | ||
| 19 | }; | 22 | }; |
| 20 | 23 | ||
| 21 | struct io_uring_cmd { | 24 | struct io_uring_cmd { |
| @@ -100,7 +100,7 @@ __ring_buffer_alloc(unsigned long size, unsigned flags, struct lock_class_key *k · 99 unmodified lines | |||
| 100 | 100 | ||
| 101 | int ring_buffer_wait(struct trace_buffer *buffer, int cpu, int full); | 101 | int ring_buffer_wait(struct trace_buffer *buffer, int cpu, int full); |
| 102 | __poll_t ring_buffer_poll_wait(struct trace_buffer *buffer, int cpu, | 102 | __poll_t ring_buffer_poll_wait(struct trace_buffer *buffer, int cpu, |
| 103 | struct file *filp, poll_table *poll_table); | 103 | struct file *filp, poll_table *poll_table, int full); |
| 104 | void ring_buffer_wake_waiters(struct trace_buffer *buffer, int cpu); | 104 | void ring_buffer_wake_waiters(struct trace_buffer *buffer, int cpu); |
| 105 | 105 | ||
| 106 | #define RING_BUFFER_ALL_CPUS -1 | 106 | #define RING_BUFFER_ALL_CPUS -1 |
| @@ -26,13 +26,13 @@ struct trace_export { · 25 unmodified lines | |||
| 26 | int flags; | 26 | int flags; |
| 27 | }; | 27 | }; |
| 28 | 28 | ||
| 29 | struct trace_array; | ||
| 30 | |||
| 29 | #ifdef CONFIG_TRACING | 31 | #ifdef CONFIG_TRACING |
| 30 | 32 | ||
| 31 | int register_ftrace_export(struct trace_export *export); | 33 | int register_ftrace_export(struct trace_export *export); |
| 32 | int unregister_ftrace_export(struct trace_export *export); | 34 | int unregister_ftrace_export(struct trace_export *export); |
| 33 | 35 | ||
| 34 | struct trace_array; | ||
| 35 | |||
| 36 | void trace_printk_init_buffers(void); | 36 | void trace_printk_init_buffers(void); |
| 37 | __printf(3, 4) | 37 | __printf(3, 4) |
| 38 | int trace_array_printk(struct trace_array *tr, unsigned long ip, | 38 | int trace_array_printk(struct trace_array *tr, unsigned long ip, |
| @@ -189,6 +189,7 @@ int vfio_register_emulated_iommu_dev(struct vfio_device *device); · 188 unmodified lines | |||
| 189 | void vfio_unregister_group_dev(struct vfio_device *device); | 189 | void vfio_unregister_group_dev(struct vfio_device *device); |
| 190 | 190 | ||
| 191 | int vfio_assign_device_set(struct vfio_device *device, void *set_id); | 191 | int vfio_assign_device_set(struct vfio_device *device, void *set_id); |
| 192 | unsigned int vfio_device_set_open_count(struct vfio_device_set *dev_set); | ||
| 192 | 193 | ||
| 193 | int vfio_mig_get_next_state(struct vfio_device *device, | 194 | int vfio_mig_get_next_state(struct vfio_device *device, |
| 194 | enum vfio_device_mig_state cur_fsm, | 195 | enum vfio_device_mig_state cur_fsm, |
| @@ -563,7 +563,7 @@ static inline void iph_to_flow_copy_v4addrs(struct flow_keys *flow, · 562 unmodified lines | |||
| 563 | BUILD_BUG_ON(offsetof(typeof(flow->addrs), v4addrs.dst) != | 563 | BUILD_BUG_ON(offsetof(typeof(flow->addrs), v4addrs.dst) != |
| 564 | offsetof(typeof(flow->addrs), v4addrs.src) + | 564 | offsetof(typeof(flow->addrs), v4addrs.src) + |
| 565 | sizeof(flow->addrs.v4addrs.src)); | 565 | sizeof(flow->addrs.v4addrs.src)); |
| 566 | memcpy(&flow->addrs.v4addrs, &iph->saddr, sizeof(flow->addrs.v4addrs)); | 566 | memcpy(&flow->addrs.v4addrs, &iph->addrs, sizeof(flow->addrs.v4addrs)); |
| 567 | flow->control.addr_type = FLOW_DISSECTOR_KEY_IPV4_ADDRS; | 567 | flow->control.addr_type = FLOW_DISSECTOR_KEY_IPV4_ADDRS; |
| 568 | } | 568 | } |
| 569 | 569 | ||
| @@ -897,7 +897,7 @@ static inline void iph_to_flow_copy_v6addrs(struct flow_keys *flow, · 896 unmodified lines | |||
| 897 | BUILD_BUG_ON(offsetof(typeof(flow->addrs), v6addrs.dst) != | 897 | BUILD_BUG_ON(offsetof(typeof(flow->addrs), v6addrs.dst) != |
| 898 | offsetof(typeof(flow->addrs), v6addrs.src) + | 898 | offsetof(typeof(flow->addrs), v6addrs.src) + |
| 899 | sizeof(flow->addrs.v6addrs.src)); | 899 | sizeof(flow->addrs.v6addrs.src)); |
| 900 | memcpy(&flow->addrs.v6addrs, &iph->saddr, sizeof(flow->addrs.v6addrs)); | 900 | memcpy(&flow->addrs.v6addrs, &iph->addrs, sizeof(flow->addrs.v6addrs)); |
| 901 | flow->control.addr_type = FLOW_DISSECTOR_KEY_IPV6_ADDRS; | 901 | flow->control.addr_type = FLOW_DISSECTOR_KEY_IPV6_ADDRS; |
| 902 | } | 902 | } |
| 903 | 903 | ||
| @@ -323,7 +323,7 @@ struct sk_filter; · 322 unmodified lines | |||
| 323 | * @sk_tskey: counter to disambiguate concurrent tstamp requests | 323 | * @sk_tskey: counter to disambiguate concurrent tstamp requests |
| 324 | * @sk_zckey: counter to order MSG_ZEROCOPY notifications | 324 | * @sk_zckey: counter to order MSG_ZEROCOPY notifications |
| 325 | * @sk_socket: Identd and reporting IO signals | 325 | * @sk_socket: Identd and reporting IO signals |
| 326 | * @sk_user_data: RPC layer private data | 326 | * @sk_user_data: RPC layer private data. Write-protected by @sk_callback_lock. |
| 327 | * @sk_frag: cached page frag | 327 | * @sk_frag: cached page frag |
| 328 | * @sk_peek_off: current peek_offset value | 328 | * @sk_peek_off: current peek_offset value |
| 329 | * @sk_send_head: front of stuff to transmit | 329 | * @sk_send_head: front of stuff to transmit |
| @@ -26,7 +26,10 @@ · 25 unmodified lines | |||
| 26 | #define DDR3PHY_PGSR (0x0C) /* DDR3PHY PHY General Status Register */ | 26 | #define DDR3PHY_PGSR (0x0C) /* DDR3PHY PHY General Status Register */ |
| 27 | #define DDR3PHY_PGSR_IDONE (1 << 0) /* Initialization Done */ | 27 | #define DDR3PHY_PGSR_IDONE (1 << 0) /* Initialization Done */ |
| 28 | 28 | ||
| 29 | #define DDR3PHY_ACIOCR (0x24) /* DDR3PHY AC I/O Configuration Register */ | 29 | #define DDR3PHY_ACDLLCR (0x14) /* DDR3PHY AC DLL Control Register */ |
| 30 | #define DDR3PHY_ACDLLCR_DLLSRST (1 << 30) /* DLL Soft Reset */ | ||
| 31 | |||
| 32 | #define DDR3PHY_ACIOCR (0x24) /* DDR3PHY AC I/O Configuration Register */ | ||
| 30 | #define DDR3PHY_ACIOCR_CSPDD_CS0 (1 << 18) /* CS#[0] Power Down Driver */ | 33 | #define DDR3PHY_ACIOCR_CSPDD_CS0 (1 << 18) /* CS#[0] Power Down Driver */ |
| 31 | #define DDR3PHY_ACIOCR_CKPDD_CK0 (1 << 8) /* CK[0] Power Down Driver */ | 34 | #define DDR3PHY_ACIOCR_CKPDD_CK0 (1 << 8) /* CK[0] Power Down Driver */ |
| 32 | #define DDR3PHY_ACIORC_ACPDD (1 << 3) /* AC Power Down Driver */ | 35 | #define DDR3PHY_ACIORC_ACPDD (1 << 3) /* AC Power Down Driver */ |
| @@ -124,7 +124,11 @@ struct hdmi_codec_ops { · 123 unmodified lines | |||
| 124 | struct hdmi_codec_pdata { | 124 | struct hdmi_codec_pdata { |
| 125 | const struct hdmi_codec_ops *ops; | 125 | const struct hdmi_codec_ops *ops; |
| 126 | uint i2s:1; | 126 | uint i2s:1; |
| 127 | uint no_i2s_playback:1; | ||
| 128 | uint no_i2s_capture:1; | ||
| 127 | uint spdif:1; | 129 | uint spdif:1; |
| 130 | uint no_spdif_playback:1; | ||
| 131 | uint no_spdif_capture:1; | ||
| 128 | int max_i2s_channels; | 132 | int max_i2s_channels; |
| 129 | void *data; | 133 | void *data; |
| 130 | }; | 134 | }; |
| @@ -100,8 +100,10 @@ struct iphdr { · 99 unmodified lines | |||
| 100 | __u8 ttl; | 100 | __u8 ttl; |
| 101 | __u8 protocol; | 101 | __u8 protocol; |
| 102 | __sum16 check; | 102 | __sum16 check; |
| 103 | __be32 saddr; | 103 | __struct_group(/* no tag */, addrs, /* no attrs */, |
| 104 | __be32 daddr; | 104 | __be32 saddr; |
| 105 | __be32 daddr; | ||
| 106 | ); | ||
| 105 | /*The options start here. */ | 107 | /*The options start here. */ |
| 106 | }; | 108 | }; |
| 107 | 109 | ||
| @@ -130,8 +130,10 @@ struct ipv6hdr { · 129 unmodified lines | |||
| 130 | __u8 nexthdr; | 130 | __u8 nexthdr; |
| 131 | __u8 hop_limit; | 131 | __u8 hop_limit; |
| 132 | 132 | ||
| 133 | struct in6_addr saddr; | 133 | __struct_group(/* no tag */, addrs, /* no attrs */, |
| 134 | struct in6_addr daddr; | 134 | struct in6_addr saddr; |
| 135 | struct in6_addr daddr; | ||
| 136 | ); | ||
| 135 | }; | 137 | }; |
| 136 | 138 | ||
| 137 | 139 | ||
| @@ -1768,7 +1768,7 @@ int io_poll_issue(struct io_kiocb *req, bool *locked) · 1767 unmodified lines | |||
| 1768 | io_tw_lock(req->ctx, locked); | 1768 | io_tw_lock(req->ctx, locked); |
| 1769 | if (unlikely(req->task->flags & PF_EXITING)) | 1769 | if (unlikely(req->task->flags & PF_EXITING)) |
| 1770 | return -EFAULT; | 1770 | return -EFAULT; |
| 1771 | return io_issue_sqe(req, IO_URING_F_NONBLOCK); | 1771 | return io_issue_sqe(req, IO_URING_F_NONBLOCK|IO_URING_F_MULTISHOT); |
| 1772 | } | 1772 | } |
| 1773 | 1773 | ||
| 1774 | struct io_wq_work *io_wq_free_work(struct io_wq_work *work) | 1774 | struct io_wq_work *io_wq_free_work(struct io_wq_work *work) |
| @@ -17,8 +17,8 @@ enum { · 16 unmodified lines | |||
| 17 | IOU_ISSUE_SKIP_COMPLETE = -EIOCBQUEUED, | 17 | IOU_ISSUE_SKIP_COMPLETE = -EIOCBQUEUED, |
| 18 | 18 | ||
| 19 | /* | 19 | /* |
| 20 | * Intended only when both REQ_F_POLLED and REQ_F_APOLL_MULTISHOT | 20 | * Intended only when both IO_URING_F_MULTISHOT is passed |
| 21 | * are set to indicate to the poll runner that multishot should be | 21 | * to indicate to the poll runner that multishot should be |
| 22 | * removed and the result is set on req->cqe.res. | 22 | * removed and the result is set on req->cqe.res. |
| 23 | */ | 23 | */ |
| 24 | IOU_STOP_MULTISHOT = -ECANCELED, | 24 | IOU_STOP_MULTISHOT = -ECANCELED, |
| @@ -67,8 +67,6 @@ struct io_sr_msg { · 66 unmodified lines | |||
| 67 | struct io_kiocb *notif; | 67 | struct io_kiocb *notif; |
| 68 | }; | 68 | }; |
| 69 | 69 | ||
| 70 | #define IO_APOLL_MULTI_POLLED (REQ_F_APOLL_MULTISHOT | REQ_F_POLLED) | ||
| 71 | |||
| 72 | int io_shutdown_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe) | 70 | int io_shutdown_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe) |
| 73 | { | 71 | { |
| 74 | struct io_shutdown *shutdown = io_kiocb_to_cmd(req, struct io_shutdown); | 72 | struct io_shutdown *shutdown = io_kiocb_to_cmd(req, struct io_shutdown); |
| @@ -591,7 +589,8 @@ static inline void io_recv_prep_retry(struct io_kiocb *req) · 516 unmodified lines | |||
| 591 | * again (for multishot). | 589 | * again (for multishot). |
| 592 | */ | 590 | */ |
| 593 | static inline bool io_recv_finish(struct io_kiocb *req, int *ret, | 591 | static inline bool io_recv_finish(struct io_kiocb *req, int *ret, |
| 594 | unsigned int cflags, bool mshot_finished) | 592 | unsigned int cflags, bool mshot_finished, |
| 593 | unsigned issue_flags) | ||
| 595 | { | 594 | { |
| 596 | if (!(req->flags & REQ_F_APOLL_MULTISHOT)) { | 595 | if (!(req->flags & REQ_F_APOLL_MULTISHOT)) { |
| 597 | io_req_set_res(req, *ret, cflags); | 596 | io_req_set_res(req, *ret, cflags); |
| @@ -614,7 +613,7 @@ static inline bool io_recv_finish(struct io_kiocb *req, int *ret, · 16 unmodified lines | |||
| 614 | 613 | ||
| 615 | io_req_set_res(req, *ret, cflags); | 614 | io_req_set_res(req, *ret, cflags); |
| 616 | 615 | ||
| 617 | if (req->flags & REQ_F_POLLED) | 616 | if (issue_flags & IO_URING_F_MULTISHOT) |
| 618 | *ret = IOU_STOP_MULTISHOT; | 617 | *ret = IOU_STOP_MULTISHOT; |
| 619 | else | 618 | else |
| 620 | *ret = IOU_OK; | 619 | *ret = IOU_OK; |
| @@ -773,8 +772,7 @@ retry_multishot: · 152 unmodified lines | |||
| 773 | if (ret < min_ret) { | 772 | if (ret < min_ret) { |
| 774 | if (ret == -EAGAIN && force_nonblock) { | 773 | if (ret == -EAGAIN && force_nonblock) { |
| 775 | ret = io_setup_async_msg(req, kmsg, issue_flags); | 774 | ret = io_setup_async_msg(req, kmsg, issue_flags); |
| 776 | if (ret == -EAGAIN && (req->flags & IO_APOLL_MULTI_POLLED) == | 775 | if (ret == -EAGAIN && (issue_flags & IO_URING_F_MULTISHOT)) { |
| 777 | IO_APOLL_MULTI_POLLED) { | ||
| 778 | io_kbuf_recycle(req, issue_flags); | 776 | io_kbuf_recycle(req, issue_flags); |
| 779 | return IOU_ISSUE_SKIP_COMPLETE; | 777 | return IOU_ISSUE_SKIP_COMPLETE; |
| 780 | } | 778 | } |
| @@ -803,7 +801,7 @@ retry_multishot: · 22 unmodified lines | |||
| 803 | if (kmsg->msg.msg_inq) | 801 | if (kmsg->msg.msg_inq) |
| 804 | cflags |= IORING_CQE_F_SOCK_NONEMPTY; | 802 | cflags |= IORING_CQE_F_SOCK_NONEMPTY; |
| 805 | 803 | ||
| 806 | if (!io_recv_finish(req, &ret, cflags, mshot_finished)) | 804 | if (!io_recv_finish(req, &ret, cflags, mshot_finished, issue_flags)) |
| 807 | goto retry_multishot; | 805 | goto retry_multishot; |
| 808 | 806 | ||
| 809 | if (mshot_finished) { | 807 | if (mshot_finished) { |
| @@ -869,7 +867,7 @@ retry_multishot: · 59 unmodified lines | |||
| 869 | ret = sock_recvmsg(sock, &msg, flags); | 867 | ret = sock_recvmsg(sock, &msg, flags); |
| 870 | if (ret < min_ret) { | 868 | if (ret < min_ret) { |
| 871 | if (ret == -EAGAIN && force_nonblock) { | 869 | if (ret == -EAGAIN && force_nonblock) { |
| 872 | if ((req->flags & IO_APOLL_MULTI_POLLED) == IO_APOLL_MULTI_POLLED) { | 870 | if (issue_flags & IO_URING_F_MULTISHOT) { |
| 873 | io_kbuf_recycle(req, issue_flags); | 871 | io_kbuf_recycle(req, issue_flags); |
| 874 | return IOU_ISSUE_SKIP_COMPLETE; | 872 | return IOU_ISSUE_SKIP_COMPLETE; |
| 875 | } | 873 | } |
| @@ -902,7 +900,7 @@ out_free: · 26 unmodified lines | |||
| 902 | if (msg.msg_inq) | 900 | if (msg.msg_inq) |
| 903 | cflags |= IORING_CQE_F_SOCK_NONEMPTY; | 901 | cflags |= IORING_CQE_F_SOCK_NONEMPTY; |
| 904 | 902 | ||
| 905 | if (!io_recv_finish(req, &ret, cflags, ret <= 0)) | 903 | if (!io_recv_finish(req, &ret, cflags, ret <= 0, issue_flags)) |
| 906 | goto retry_multishot; | 904 | goto retry_multishot; |
| 907 | 905 | ||
| 908 | return ret; | 906 | return ret; |
| @@ -1289,8 +1287,7 @@ retry: · 380 unmodified lines | |||
| 1289 | * return EAGAIN to arm the poll infra since it | 1287 | * return EAGAIN to arm the poll infra since it |
| 1290 | * has already been done | 1288 | * has already been done |
| 1291 | */ | 1289 | */ |
| 1292 | if ((req->flags & IO_APOLL_MULTI_POLLED) == | 1290 | if (issue_flags & IO_URING_F_MULTISHOT) |
| 1293 | IO_APOLL_MULTI_POLLED) | ||
| 1294 | ret = IOU_ISSUE_SKIP_COMPLETE; | 1291 | ret = IOU_ISSUE_SKIP_COMPLETE; |
| 1295 | return ret; | 1292 | return ret; |
| 1296 | } | 1293 | } |
| @@ -1315,9 +1312,7 @@ retry: · 18 unmodified lines | |||
| 1315 | goto retry; | 1312 | goto retry; |
| 1316 | 1313 | ||
| 1317 | io_req_set_res(req, ret, 0); | 1314 | io_req_set_res(req, ret, 0); |
| 1318 | if (req->flags & REQ_F_POLLED) | 1315 | return (issue_flags & IO_URING_F_MULTISHOT) ? IOU_STOP_MULTISHOT : IOU_OK; |
| 1319 | return IOU_STOP_MULTISHOT; | ||
| 1320 | return IOU_OK; | ||
| 1321 | } | 1316 | } |
| 1322 | 1317 | ||
| 1323 | int io_socket_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe) | 1318 | int io_socket_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe) |
| @@ -228,6 +228,13 @@ static int io_poll_check_events(struct io_kiocb *req, bool *locked) · 227 unmodified lines | |||
| 228 | return IOU_POLL_DONE; | 228 | return IOU_POLL_DONE; |
| 229 | if (v & IO_POLL_CANCEL_FLAG) | 229 | if (v & IO_POLL_CANCEL_FLAG) |
| 230 | return -ECANCELED; | 230 | return -ECANCELED; |
| 231 | /* | ||
| 232 | * cqe.res contains only events of the first wake up | ||
| 233 | * and all others are be lost. Redo vfs_poll() to get | ||
| 234 | * up to date state. | ||
| 235 | */ | ||
| 236 | if ((v & IO_POLL_REF_MASK) != 1) | ||
| 237 | req->cqe.res = 0; | ||
| 231 | 238 | ||
| 232 | /* the mask was stashed in __io_poll_execute */ | 239 | /* the mask was stashed in __io_poll_execute */ |
| 233 | if (!req->cqe.res) { | 240 | if (!req->cqe.res) { |
| @@ -239,6 +246,8 @@ static int io_poll_check_events(struct io_kiocb *req, bool *locked) · 5 unmodified lines | |||
| 239 | continue; | 246 | continue; |
| 240 | if (req->apoll_events & EPOLLONESHOT) | 247 | if (req->apoll_events & EPOLLONESHOT) |
| 241 | return IOU_POLL_DONE; | 248 | return IOU_POLL_DONE; |
| 249 | if (io_is_uring_fops(req->file)) | ||
| 250 | return IOU_POLL_DONE; | ||
| 242 | 251 | ||
| 243 | /* multishot, just fill a CQE and proceed */ | 252 | /* multishot, just fill a CQE and proceed */ |
| 244 | if (!(req->flags & REQ_F_APOLL_MULTISHOT)) { | 253 | if (!(req->flags & REQ_F_APOLL_MULTISHOT)) { |
| @@ -258,6 +267,9 @@ static int io_poll_check_events(struct io_kiocb *req, bool *locked) · 13 unmodified lines | |||
| 258 | return ret; | 267 | return ret; |
| 259 | } | 268 | } |
| 260 | 269 | ||
| 270 | /* force the next iteration to vfs_poll() */ | ||
| 271 | req->cqe.res = 0; | ||
| 272 | |||
| 261 | /* | 273 | /* |
| 262 | * Release all references, retry if someone tried to restart | 274 | * Release all references, retry if someone tried to restart |
| 263 | * task_work while we were executing it. | 275 | * task_work while we were executing it. |
| @@ -4,7 +4,7 @@ · 3 unmodified lines | |||
| 4 | #include <linux/hash.h> | 4 | #include <linux/hash.h> |
| 5 | #include <linux/bpf.h> | 5 | #include <linux/bpf.h> |
| 6 | #include <linux/filter.h> | 6 | #include <linux/filter.h> |
| 7 | #include <linux/init.h> | 7 | #include <linux/static_call.h> |
| 8 | 8 | ||
| 9 | /* The BPF dispatcher is a multiway branch code generator. The | 9 | /* The BPF dispatcher is a multiway branch code generator. The |
| 10 | * dispatcher is a mechanism to avoid the performance penalty of an | 10 | * dispatcher is a mechanism to avoid the performance penalty of an |
| @@ -91,11 +91,6 @@ int __weak arch_prepare_bpf_dispatcher(void *image, void *buf, s64 *funcs, int n · 80 unmodified lines | |||
| 91 | return -ENOTSUPP; | 91 | return -ENOTSUPP; |
| 92 | } | 92 | } |
| 93 | 93 | ||
| 94 | int __weak __init bpf_arch_init_dispatcher_early(void *ip) | ||
| 95 | { | ||
| 96 | return -ENOTSUPP; | ||
| 97 | } | ||
| 98 | |||
| 99 | static int bpf_dispatcher_prepare(struct bpf_dispatcher *d, void *image, void *buf) | 94 | static int bpf_dispatcher_prepare(struct bpf_dispatcher *d, void *image, void *buf) |
| 100 | { | 95 | { |
| 101 | s64 ips[BPF_DISPATCHER_MAX] = {}, *ipsp = &ips[0]; | 96 | s64 ips[BPF_DISPATCHER_MAX] = {}, *ipsp = &ips[0]; |
| @@ -110,17 +105,11 @@ static int bpf_dispatcher_prepare(struct bpf_dispatcher *d, void *image, void *b · 8 unmodified lines | |||
| 110 | 105 | ||
| 111 | static void bpf_dispatcher_update(struct bpf_dispatcher *d, int prev_num_progs) | 106 | static void bpf_dispatcher_update(struct bpf_dispatcher *d, int prev_num_progs) |
| 112 | { | 107 | { |
| 113 | void *old, *new, *tmp; | 108 | void *new, *tmp; |
| 114 | u32 noff; | 109 | u32 noff = 0; |
| 115 | int err; | 110 | |
| 116 | 111 | if (prev_num_progs) | |
| 117 | if (!prev_num_progs) { | ||
| 118 | old = NULL; | ||
| 119 | noff = 0; | ||
| 120 | } else { | ||
| 121 | old = d->image + d->image_off; | ||
| 122 | noff = d->image_off ^ (PAGE_SIZE / 2); | 112 | noff = d->image_off ^ (PAGE_SIZE / 2); |
| 123 | } | ||
| 124 | 113 | ||
| 125 | new = d->num_progs ? d->image + noff : NULL; | 114 | new = d->num_progs ? d->image + noff : NULL; |
| 126 | tmp = d->num_progs ? d->rw_image + noff : NULL; | 115 | tmp = d->num_progs ? d->rw_image + noff : NULL; |
| @@ -134,11 +123,10 @@ static void bpf_dispatcher_update(struct bpf_dispatcher *d, int prev_num_progs) · 7 unmodified lines | |||
| 134 | return; | 123 | return; |
| 135 | } | 124 | } |
| 136 | 125 | ||
| 137 | err = bpf_arch_text_poke(d->func, BPF_MOD_JUMP, old, new); | 126 | __BPF_DISPATCHER_UPDATE(d, new ?: (void *)&bpf_dispatcher_nop_func); |
| 138 | if (err || !new) | ||
| 139 | return; | ||
| 140 | 127 | ||
| 141 | d->image_off = noff; | 128 | if (new) |
| 129 | d->image_off = noff; | ||
| 142 | } | 130 | } |
| 143 | 131 | ||
| 144 | void bpf_dispatcher_change_prog(struct bpf_dispatcher *d, struct bpf_prog *from, | 132 | void bpf_dispatcher_change_prog(struct bpf_dispatcher *d, struct bpf_prog *from, |
| @@ -100,22 +100,21 @@ void pcpu_freelist_populate(struct pcpu_freelist *s, void *buf, u32 elem_size, · 99 unmodified lines | |||
| 100 | u32 nr_elems) | 100 | u32 nr_elems) |
| 101 | { | 101 | { |
| 102 | struct pcpu_freelist_head *head; | 102 | struct pcpu_freelist_head *head; |
| 103 | int i, cpu, pcpu_entries; | 103 | unsigned int cpu, cpu_idx, i, j, n, m; |
| 104 | 104 | ||
| 105 | pcpu_entries = nr_elems / num_possible_cpus() + 1; | 105 | n = nr_elems / num_possible_cpus(); |
| 106 | i = 0; | 106 | m = nr_elems % num_possible_cpus(); |
| 107 | 107 | ||
| 108 | cpu_idx = 0; | ||
| 108 | for_each_possible_cpu(cpu) { | 109 | for_each_possible_cpu(cpu) { |
| 109 | again: | ||
| 110 | head = per_cpu_ptr(s->freelist, cpu); | 110 | head = per_cpu_ptr(s->freelist, cpu); |
| 111 | /* No locking required as this is not visible yet. */ | 111 | j = n + (cpu_idx < m ? 1 : 0); |
| 112 | pcpu_freelist_push_node(head, buf); | 112 | for (i = 0; i < j; i++) { |
| 113 | i++; | 113 | /* No locking required as this is not visible yet. */ |
| 114 | buf += elem_size; | 114 | pcpu_freelist_push_node(head, buf); |
| 115 | if (i == nr_elems) | 115 | buf += elem_size; |
| 116 | break; | 116 | } |
| 117 | if (i % pcpu_entries) | 117 | cpu_idx++; |
| 118 | goto again; | ||
| 119 | } | 118 | } |
| 120 | } | 119 | } |
| 121 | 120 | ||
| @@ -6745,11 +6745,11 @@ static int __check_func_call(struct bpf_verifier_env *env, struct bpf_insn *insn · 6744 unmodified lines | |||
| 6745 | /* Transfer references to the callee */ | 6745 | /* Transfer references to the callee */ |
| 6746 | err = copy_reference_state(callee, caller); | 6746 | err = copy_reference_state(callee, caller); |
| 6747 | if (err) | 6747 | if (err) |
| 6748 | return err; | 6748 | goto err_out; |
| 6749 | 6749 | ||
| 6750 | err = set_callee_state_cb(env, caller, callee, *insn_idx); | 6750 | err = set_callee_state_cb(env, caller, callee, *insn_idx); |
| 6751 | if (err) | 6751 | if (err) |
| 6752 | return err; | 6752 | goto err_out; |
| 6753 | 6753 | ||
| 6754 | clear_caller_saved_regs(env, caller->regs); | 6754 | clear_caller_saved_regs(env, caller->regs); |
| 6755 | 6755 | ||
| @@ -6766,6 +6766,11 @@ static int __check_func_call(struct bpf_verifier_env *env, struct bpf_insn *insn · 10 unmodified lines | |||
| 6766 | print_verifier_state(env, callee, true); | 6766 | print_verifier_state(env, callee, true); |
| 6767 | } | 6767 | } |
| 6768 | return 0; | 6768 | return 0; |
| 6769 | |||
| 6770 | err_out: | ||
| 6771 | free_func_state(callee); | ||
| 6772 | state->frame[state->curframe + 1] = NULL; | ||
| 6773 | return err; | ||
| 6769 | } | 6774 | } |
| 6770 | 6775 | ||
| 6771 | int map_set_for_each_callback_args(struct bpf_verifier_env *env, | 6776 | int map_set_for_each_callback_args(struct bpf_verifier_env *env, |
| @@ -6979,8 +6984,7 @@ static int prepare_func_exit(struct bpf_verifier_env *env, int *insn_idx) · 207 unmodified lines | |||
| 6979 | return -EINVAL; | 6984 | return -EINVAL; |
| 6980 | } | 6985 | } |
| 6981 | 6986 | ||
| 6982 | state->curframe--; | 6987 | caller = state->frame[state->curframe - 1]; |
| 6983 | caller = state->frame[state->curframe]; | ||
| 6984 | if (callee->in_callback_fn) { | 6988 | if (callee->in_callback_fn) { |
| 6985 | /* enforce R0 return value range [0, 1]. */ | 6989 | /* enforce R0 return value range [0, 1]. */ |
| 6986 | struct tnum range = callee->callback_ret_range; | 6990 | struct tnum range = callee->callback_ret_range; |
| @@ -7019,7 +7023,7 @@ static int prepare_func_exit(struct bpf_verifier_env *env, int *insn_idx) · 32 unmodified lines | |||
| 7019 | } | 7023 | } |
| 7020 | /* clear everything in the callee */ | 7024 | /* clear everything in the callee */ |
| 7021 | free_func_state(callee); | 7025 | free_func_state(callee); |
| 7022 | state->frame[state->curframe + 1] = NULL; | 7026 | state->frame[state->curframe--] = NULL; |
| 7023 | return 0; | 7027 | return 0; |
| 7024 | } | 7028 | } |
| 7025 | 7029 | ||
| @@ -9306,14 +9306,27 @@ static int __perf_event_overflow(struct perf_event *event, · 9305 unmodified lines | |||
| 9306 | } | 9306 | } |
| 9307 | 9307 | ||
| 9308 | if (event->attr.sigtrap) { | 9308 | if (event->attr.sigtrap) { |
| 9309 | /* | 9309 | unsigned int pending_id = 1; |
| 9310 | * Should not be able to return to user space without processing | 9310 | |
| 9311 | * pending_sigtrap (kernel events can overflow multiple times). | 9311 | if (regs) |
| 9312 | */ | 9312 | pending_id = hash32_ptr((void *)instruction_pointer(regs)) ?: 1; |
| 9313 | WARN_ON_ONCE(event->pending_sigtrap && event->attr.exclude_kernel); | ||
| 9314 | if (!event->pending_sigtrap) { | 9313 | if (!event->pending_sigtrap) { |
| 9315 | event->pending_sigtrap = 1; | 9314 | event->pending_sigtrap = pending_id; |
| 9316 | local_inc(&event->ctx->nr_pending); | 9315 | local_inc(&event->ctx->nr_pending); |
| 9316 | } else if (event->attr.exclude_kernel) { | ||
| 9317 | /* | ||
| 9318 | * Should not be able to return to user space without | ||
| 9319 | * consuming pending_sigtrap; with exceptions: | ||
| 9320 | * | ||
| 9321 | * 1. Where !exclude_kernel, events can overflow again | ||
| 9322 | * in the kernel without returning to user space. | ||
| 9323 | * | ||
| 9324 | * 2. Events that can overflow again before the IRQ- | ||
| 9325 | * work without user space progress (e.g. hrtimer). | ||
| 9326 | * To approximate progress (with false negatives), | ||
| 9327 | * check 32-bit hash of the current IP. | ||
| 9328 | */ | ||
| 9329 | WARN_ON_ONCE(event->pending_sigtrap != pending_id); | ||
| 9317 | } | 9330 | } |
| 9318 | event->pending_addr = data->addr; | 9331 | event->pending_addr = data->addr; |
| 9319 | irq_work_queue(&event->pending_irq); | 9332 | irq_work_queue(&event->pending_irq); |
| @@ -1766,7 +1766,13 @@ static int __unregister_kprobe_top(struct kprobe *p) · 1765 unmodified lines | |||
| 1766 | if ((list_p != p) && (list_p->post_handler)) | 1766 | if ((list_p != p) && (list_p->post_handler)) |
| 1767 | goto noclean; | 1767 | goto noclean; |
| 1768 | } | 1768 | } |
| 1769 | ap->post_handler = NULL; | 1769 | /* |
| 1770 | * For the kprobe-on-ftrace case, we keep the | ||
| 1771 | * post_handler setting to identify this aggrprobe | ||
| 1772 | * armed with kprobe_ipmodify_ops. | ||
| 1773 | */ | ||
| 1774 | if (!kprobe_ftrace(ap)) | ||
| 1775 | ap->post_handler = NULL; | ||
| 1770 | } | 1776 | } |
| 1771 | noclean: | 1777 | noclean: |
| 1772 | /* | 1778 | /* |
| @@ -171,12 +171,27 @@ static int rseq_get_rseq_cs(struct task_struct *t, struct rseq_cs *rseq_cs) · 170 unmodified lines | |||
| 171 | return 0; | 171 | return 0; |
| 172 | } | 172 | } |
| 173 | 173 | ||
| 174 | static bool rseq_warn_flags(const char *str, u32 flags) | ||
| 175 | { | ||
| 176 | u32 test_flags; | ||
| 177 | |||
| 178 | if (!flags) | ||
| 179 | return false; | ||
| 180 | test_flags = flags & RSEQ_CS_NO_RESTART_FLAGS; | ||
| 181 | if (test_flags) | ||
| 182 | pr_warn_once("Deprecated flags (%u) in %s ABI structure", test_flags, str); | ||
| 183 | test_flags = flags & ~RSEQ_CS_NO_RESTART_FLAGS; | ||
| 184 | if (test_flags) | ||
| 185 | pr_warn_once("Unknown flags (%u) in %s ABI structure", test_flags, str); | ||
| 186 | return true; | ||
| 187 | } | ||
| 188 | |||
| 174 | static int rseq_need_restart(struct task_struct *t, u32 cs_flags) | 189 | static int rseq_need_restart(struct task_struct *t, u32 cs_flags) |
| 175 | { | 190 | { |
| 176 | u32 flags, event_mask; | 191 | u32 flags, event_mask; |
| 177 | int ret; | 192 | int ret; |
| 178 | 193 | ||
| 179 | if (WARN_ON_ONCE(cs_flags & RSEQ_CS_NO_RESTART_FLAGS) || cs_flags) | 194 | if (rseq_warn_flags("rseq_cs", cs_flags)) |
| 180 | return -EINVAL; | 195 | return -EINVAL; |
| 181 | 196 | ||
| 182 | /* Get thread flags. */ | 197 | /* Get thread flags. */ |
| @@ -184,7 +199,7 @@ static int rseq_need_restart(struct task_struct *t, u32 cs_flags) · 1 unmodified line | |||
| 184 | if (ret) | 199 | if (ret) |
| 185 | return ret; | 200 | return ret; |
| 186 | 201 | ||
| 187 | if (WARN_ON_ONCE(flags & RSEQ_CS_NO_RESTART_FLAGS) || flags) | 202 | if (rseq_warn_flags("rseq", flags)) |
| 188 | return -EINVAL; | 203 | return -EINVAL; |
| 189 | 204 | ||
| 190 | /* | 205 | /* |
| @@ -4200,6 +4200,40 @@ out: · 4199 unmodified lines | |||
| 4200 | return success; | 4200 | return success; |
| 4201 | } | 4201 | } |
| 4202 | 4202 | ||
| 4203 | static bool __task_needs_rq_lock(struct task_struct *p) | ||
| 4204 | { | ||
| 4205 | unsigned int state = READ_ONCE(p->__state); | ||
| 4206 | |||
| 4207 | /* | ||
| 4208 | * Since pi->lock blocks try_to_wake_up(), we don't need rq->lock when | ||
| 4209 | * the task is blocked. Make sure to check @state since ttwu() can drop | ||
| 4210 | * locks at the end, see ttwu_queue_wakelist(). | ||
| 4211 | */ | ||
| 4212 | if (state == TASK_RUNNING || state == TASK_WAKING) | ||
| 4213 | return true; | ||
| 4214 | |||
| 4215 | /* | ||
| 4216 | * Ensure we load p->on_rq after p->__state, otherwise it would be | ||
| 4217 | * possible to, falsely, observe p->on_rq == 0. | ||
| 4218 | * | ||
| 4219 | * See try_to_wake_up() for a longer comment. | ||
| 4220 | */ | ||
| 4221 | smp_rmb(); | ||
| 4222 | if (p->on_rq) | ||
| 4223 | return true; | ||
| 4224 | |||
| 4225 | #ifdef CONFIG_SMP | ||
| 4226 | /* | ||
| 4227 | * Ensure the task has finished __schedule() and will not be referenced | ||
| 4228 | * anymore. Again, see try_to_wake_up() for a longer comment. | ||
| 4229 | */ | ||
| 4230 | smp_rmb(); | ||
| 4231 | smp_cond_load_acquire(&p->on_cpu, !VAL); | ||
| 4232 | #endif | ||
| 4233 | |||
| 4234 | return false; | ||
| 4235 | } | ||
| 4236 | |||
| 4203 | /** | 4237 | /** |
| 4204 | * task_call_func - Invoke a function on task in fixed state | 4238 | * task_call_func - Invoke a function on task in fixed state |
| 4205 | * @p: Process for which the function is to be invoked, can be @current. | 4239 | * @p: Process for which the function is to be invoked, can be @current. |
| @@ -4217,28 +4251,12 @@ out: · 11 unmodified lines | |||
| 4217 | int task_call_func(struct task_struct *p, task_call_f func, void *arg) | 4251 | int task_call_func(struct task_struct *p, task_call_f func, void *arg) |
| 4218 | { | 4252 | { |
| 4219 | struct rq *rq = NULL; | 4253 | struct rq *rq = NULL; |
| 4220 | unsigned int state; | ||
| 4221 | struct rq_flags rf; | 4254 | struct rq_flags rf; |
| 4222 | int ret; | 4255 | int ret; |
| 4223 | 4256 | ||
| 4224 | raw_spin_lock_irqsave(&p->pi_lock, rf.flags); | 4257 | raw_spin_lock_irqsave(&p->pi_lock, rf.flags); |
| 4225 | 4258 | ||
| 4226 | state = READ_ONCE(p->__state); | 4259 | if (__task_needs_rq_lock(p)) |
| 4227 | |||
| 4228 | /* | ||
| 4229 | * Ensure we load p->on_rq after p->__state, otherwise it would be | ||
| 4230 | * possible to, falsely, observe p->on_rq == 0. | ||
| 4231 | * | ||
| 4232 | * See try_to_wake_up() for a longer comment. | ||
| 4233 | */ | ||
| 4234 | smp_rmb(); | ||
| 4235 | |||
| 4236 | /* | ||
| 4237 | * Since pi->lock blocks try_to_wake_up(), we don't need rq->lock when | ||
| 4238 | * the task is blocked. Make sure to check @state since ttwu() can drop | ||
| 4239 | * locks at the end, see ttwu_queue_wakelist(). | ||
| 4240 | */ | ||
| 4241 | if (state == TASK_RUNNING || state == TASK_WAKING || p->on_rq) | ||
| 4242 | rq = __task_rq_lock(p, &rf); | 4260 | rq = __task_rq_lock(p, &rf); |
| 4243 | 4261 | ||
| 4244 | /* | 4262 | /* |
| @@ -1289,6 +1289,7 @@ static int ftrace_add_mod(struct trace_array *tr, · 1288 unmodified lines | |||
| 1289 | if (!ftrace_mod) | 1289 | if (!ftrace_mod) |
| 1290 | return -ENOMEM; | 1290 | return -ENOMEM; |
| 1291 | 1291 | ||
| 1292 | INIT_LIST_HEAD(&ftrace_mod->list); | ||
| 1292 | ftrace_mod->func = kstrdup(func, GFP_KERNEL); | 1293 | ftrace_mod->func = kstrdup(func, GFP_KERNEL); |
| 1293 | ftrace_mod->module = kstrdup(module, GFP_KERNEL); | 1294 | ftrace_mod->module = kstrdup(module, GFP_KERNEL); |
| 1294 | ftrace_mod->enable = enable; | 1295 | ftrace_mod->enable = enable; |
| @@ -3190,7 +3191,7 @@ static int ftrace_allocate_records(struct ftrace_page *pg, int count) · 1895 unmodified lines | |||
| 3190 | /* if we can't allocate this size, try something smaller */ | 3191 | /* if we can't allocate this size, try something smaller */ |
| 3191 | if (!order) | 3192 | if (!order) |
| 3192 | return -ENOMEM; | 3193 | return -ENOMEM; |
| 3193 | order >>= 1; | 3194 | order--; |
| 3194 | goto again; | 3195 | goto again; |
| 3195 | } | 3196 | } |
| 3196 | 3197 | ||
| @@ -7391,7 +7392,7 @@ void __init ftrace_init(void) · 4194 unmodified lines | |||
| 7391 | } | 7392 | } |
| 7392 | 7393 | ||
| 7393 | pr_info("ftrace: allocating %ld entries in %ld pages\n", | 7394 | pr_info("ftrace: allocating %ld entries in %ld pages\n", |
| 7394 | count, count / ENTRIES_PER_PAGE + 1); | 7395 | count, DIV_ROUND_UP(count, ENTRIES_PER_PAGE)); |
| 7395 | 7396 | ||
| 7396 | ret = ftrace_process_locs(NULL, | 7397 | ret = ftrace_process_locs(NULL, |
| 7397 | __start_mcount_loc, | 7398 | __start_mcount_loc, |
| @@ -73,6 +73,10 @@ static struct trace_event_file *gen_kretprobe_test; · 72 unmodified lines | |||
| 73 | #define KPROBE_GEN_TEST_ARG3 NULL | 73 | #define KPROBE_GEN_TEST_ARG3 NULL |
| 74 | #endif | 74 | #endif |
| 75 | 75 | ||
| 76 | static bool trace_event_file_is_valid(struct trace_event_file *input) | ||
| 77 | { | ||
| 78 | return input && !IS_ERR(input); | ||
| 79 | } | ||
| 76 | 80 | ||
| 77 | /* | 81 | /* |
| 78 | * Test to make sure we can create a kprobe event, then add more | 82 | * Test to make sure we can create a kprobe event, then add more |
| @@ -139,6 +143,8 @@ static int __init test_gen_kprobe_cmd(void) · 60 unmodified lines | |||
| 139 | kfree(buf); | 143 | kfree(buf); |
| 140 | return ret; | 144 | return ret; |
| 141 | delete: | 145 | delete: |
| 146 | if (trace_event_file_is_valid(gen_kprobe_test)) | ||
| 147 | gen_kprobe_test = NULL; | ||
| 142 | /* We got an error after creating the event, delete it */ | 148 | /* We got an error after creating the event, delete it */ |
| 143 | ret = kprobe_event_delete("gen_kprobe_test"); | 149 | ret = kprobe_event_delete("gen_kprobe_test"); |
| 144 | goto out; | 150 | goto out; |
| @@ -202,6 +208,8 @@ static int __init test_gen_kretprobe_cmd(void) · 57 unmodified lines | |||
| 202 | kfree(buf); | 208 | kfree(buf); |
| 203 | return ret; | 209 | return ret; |
| 204 | delete: | 210 | delete: |
| 211 | if (trace_event_file_is_valid(gen_kretprobe_test)) | ||
| 212 | gen_kretprobe_test = NULL; | ||
| 205 | /* We got an error after creating the event, delete it */ | 213 | /* We got an error after creating the event, delete it */ |
| 206 | ret = kprobe_event_delete("gen_kretprobe_test"); | 214 | ret = kprobe_event_delete("gen_kretprobe_test"); |
| 207 | goto out; | 215 | goto out; |
| @@ -217,10 +225,12 @@ static int __init kprobe_event_gen_test_init(void) · 9 unmodified lines | |||
| 217 | 225 | ||
| 218 | ret = test_gen_kretprobe_cmd(); | 226 | ret = test_gen_kretprobe_cmd(); |
| 219 | if (ret) { | 227 | if (ret) { |
| 220 | WARN_ON(trace_array_set_clr_event(gen_kretprobe_test->tr, | 228 | if (trace_event_file_is_valid(gen_kretprobe_test)) { |
| 221 | "kprobes", | 229 | WARN_ON(trace_array_set_clr_event(gen_kretprobe_test->tr, |
| 222 | "gen_kretprobe_test", false)); | 230 | "kprobes", |
| 223 | trace_put_event_file(gen_kretprobe_test); | 231 | "gen_kretprobe_test", false)); |
| 232 | trace_put_event_file(gen_kretprobe_test); | ||
| 233 | } | ||
| 224 | WARN_ON(kprobe_event_delete("gen_kretprobe_test")); | 234 | WARN_ON(kprobe_event_delete("gen_kretprobe_test")); |
| 225 | } | 235 | } |
| 226 | 236 | ||
| @@ -229,24 +239,30 @@ static int __init kprobe_event_gen_test_init(void) · 2 unmodified lines | |||
| 229 | 239 | ||
| 230 | static void __exit kprobe_event_gen_test_exit(void) | 240 | static void __exit kprobe_event_gen_test_exit(void) |
| 231 | { | 241 | { |
| 232 | /* Disable the event or you can't remove it */ | 242 | if (trace_event_file_is_valid(gen_kprobe_test)) { |
| 233 | WARN_ON(trace_array_set_clr_event(gen_kprobe_test->tr, | 243 | /* Disable the event or you can't remove it */ |
| 234 | "kprobes", | 244 | WARN_ON(trace_array_set_clr_event(gen_kprobe_test->tr, |
| 235 | "gen_kprobe_test", false)); | 245 | "kprobes", |
| 246 | "gen_kprobe_test", false)); | ||
| 247 | |||
| 248 | /* Now give the file and instance back */ | ||
| 249 | trace_put_event_file(gen_kprobe_test); | ||
| 250 | } | ||
| 236 | 251 | ||
| 237 | /* Now give the file and instance back */ | ||
| 238 | trace_put_event_file(gen_kprobe_test); | ||
| 239 | 252 | ||
| 240 | /* Now unregister and free the event */ | 253 | /* Now unregister and free the event */ |
| 241 | WARN_ON(kprobe_event_delete("gen_kprobe_test")); | 254 | WARN_ON(kprobe_event_delete("gen_kprobe_test")); |
| 242 | 255 | ||
| 243 | /* Disable the event or you can't remove it */ | 256 | if (trace_event_file_is_valid(gen_kretprobe_test)) { |
| 244 | WARN_ON(trace_array_set_clr_event(gen_kretprobe_test->tr, | 257 | /* Disable the event or you can't remove it */ |
| 245 | "kprobes", | 258 | WARN_ON(trace_array_set_clr_event(gen_kretprobe_test->tr, |
| 246 | "gen_kretprobe_test", false)); | 259 | "kprobes", |
| 260 | "gen_kretprobe_test", false)); | ||
| 261 | |||
| 262 | /* Now give the file and instance back */ | ||
| 263 | trace_put_event_file(gen_kretprobe_test); | ||
| 264 | } | ||
| 247 | 265 | ||
| 248 | /* Now give the file and instance back */ | ||
| 249 | trace_put_event_file(gen_kretprobe_test); | ||
| 250 | 266 | ||
| 251 | /* Now unregister and free the event */ | 267 | /* Now unregister and free the event */ |
| 252 | WARN_ON(kprobe_event_delete("gen_kretprobe_test")); | 268 | WARN_ON(kprobe_event_delete("gen_kretprobe_test")); |
| @@ -83,8 +83,10 @@ struct rethook *rethook_alloc(void *data, rethook_handler_t handler) · 82 unmodified lines | |||
| 83 | { | 83 | { |
| 84 | struct rethook *rh = kzalloc(sizeof(struct rethook), GFP_KERNEL); | 84 | struct rethook *rh = kzalloc(sizeof(struct rethook), GFP_KERNEL); |
| 85 | 85 | ||
| 86 | if (!rh || !handler) | 86 | if (!rh || !handler) { |
| 87 | kfree(rh); | ||
| 87 | return NULL; | 88 | return NULL; |
| 89 | } | ||
| 88 | 90 | ||
| 89 | rh->data = data; | 91 | rh->data = data; |
| 90 | rh->handler = handler; | 92 | rh->handler = handler; |
| @@ -519,6 +519,7 @@ struct ring_buffer_per_cpu { · 518 unmodified lines | |||
| 519 | local_t committing; | 519 | local_t committing; |
| 520 | local_t commits; | 520 | local_t commits; |
| 521 | local_t pages_touched; | 521 | local_t pages_touched; |
| 522 | local_t pages_lost; | ||
| 522 | local_t pages_read; | 523 | local_t pages_read; |
| 523 | long last_pages_touch; | 524 | long last_pages_touch; |
| 524 | size_t shortest_full; | 525 | size_t shortest_full; |
| @@ -894,10 +895,18 @@ size_t ring_buffer_nr_pages(struct trace_buffer *buffer, int cpu) · 369 unmodified lines | |||
| 894 | size_t ring_buffer_nr_dirty_pages(struct trace_buffer *buffer, int cpu) | 895 | size_t ring_buffer_nr_dirty_pages(struct trace_buffer *buffer, int cpu) |
| 895 | { | 896 | { |
| 896 | size_t read; | 897 | size_t read; |
| 898 | size_t lost; | ||
| 897 | size_t cnt; | 899 | size_t cnt; |
| 898 | 900 | ||
| 899 | read = local_read(&buffer->buffers[cpu]->pages_read); | 901 | read = local_read(&buffer->buffers[cpu]->pages_read); |
| 902 | lost = local_read(&buffer->buffers[cpu]->pages_lost); | ||
| 900 | cnt = local_read(&buffer->buffers[cpu]->pages_touched); | 903 | cnt = local_read(&buffer->buffers[cpu]->pages_touched); |
| 904 | |||
| 905 | if (WARN_ON_ONCE(cnt < lost)) | ||
| 906 | return 0; | ||
| 907 | |||
| 908 | cnt -= lost; | ||
| 909 | |||
| 901 | /* The reader can read an empty page, but not more than that */ | 910 | /* The reader can read an empty page, but not more than that */ |
| 902 | if (cnt < read) { | 911 | if (cnt < read) { |
| 903 | WARN_ON_ONCE(read > cnt + 1); | 912 | WARN_ON_ONCE(read > cnt + 1); |
| @@ -907,6 +916,21 @@ size_t ring_buffer_nr_dirty_pages(struct trace_buffer *buffer, int cpu) · 3 unmodified lines | |||
| 907 | return cnt - read; | 916 | return cnt - read; |
| 908 | } | 917 | } |
| 909 | 918 | ||
| 919 | static __always_inline bool full_hit(struct trace_buffer *buffer, int cpu, int full) | ||
| 920 | { | ||
| 921 | struct ring_buffer_per_cpu *cpu_buffer = buffer->buffers[cpu]; | ||
| 922 | size_t nr_pages; | ||
| 923 | size_t dirty; | ||
| 924 | |||
| 925 | nr_pages = cpu_buffer->nr_pages; | ||
| 926 | if (!nr_pages || !full) | ||
| 927 | return true; | ||
| 928 | |||
| 929 | dirty = ring_buffer_nr_dirty_pages(buffer, cpu); | ||
| 930 | |||
| 931 | return (dirty * 100) > (full * nr_pages); | ||
| 932 | } | ||
| 933 | |||
| 910 | /* | 934 | /* |
| 911 | * rb_wake_up_waiters - wake up tasks waiting for ring buffer input | 935 | * rb_wake_up_waiters - wake up tasks waiting for ring buffer input |
| 912 | * | 936 | * |
| @@ -1046,22 +1070,20 @@ int ring_buffer_wait(struct trace_buffer *buffer, int cpu, int full) · 133 unmodified lines | |||
| 1046 | !ring_buffer_empty_cpu(buffer, cpu)) { | 1070 | !ring_buffer_empty_cpu(buffer, cpu)) { |
| 1047 | unsigned long flags; | 1071 | unsigned long flags; |
| 1048 | bool pagebusy; | 1072 | bool pagebusy; |
| 1049 | size_t nr_pages; | 1073 | bool done; |
| 1050 | size_t dirty; | ||
| 1051 | 1074 | ||
| 1052 | if (!full) | 1075 | if (!full) |
| 1053 | break; | 1076 | break; |
| 1054 | 1077 | ||
| 1055 | raw_spin_lock_irqsave(&cpu_buffer->reader_lock, flags); | 1078 | raw_spin_lock_irqsave(&cpu_buffer->reader_lock, flags); |
| 1056 | pagebusy = cpu_buffer->reader_page == cpu_buffer->commit_page; | 1079 | pagebusy = cpu_buffer->reader_page == cpu_buffer->commit_page; |
| 1057 | nr_pages = cpu_buffer->nr_pages; | 1080 | done = !pagebusy && full_hit(buffer, cpu, full); |
| 1058 | dirty = ring_buffer_nr_dirty_pages(buffer, cpu); | 1081 | |
| 1059 | if (!cpu_buffer->shortest_full || | 1082 | if (!cpu_buffer->shortest_full || |
| 1060 | cpu_buffer->shortest_full > full) | 1083 | cpu_buffer->shortest_full > full) |
| 1061 | cpu_buffer->shortest_full = full; | 1084 | cpu_buffer->shortest_full = full; |
| 1062 | raw_spin_unlock_irqrestore(&cpu_buffer->reader_lock, flags); | 1085 | raw_spin_unlock_irqrestore(&cpu_buffer->reader_lock, flags); |
| 1063 | if (!pagebusy && | 1086 | if (done) |
| 1064 | (!nr_pages || (dirty * 100) > full * nr_pages)) | ||
| 1065 | break; | 1087 | break; |
| 1066 | } | 1088 | } |
| 1067 | 1089 | ||
| @@ -1087,6 +1109,7 @@ int ring_buffer_wait(struct trace_buffer *buffer, int cpu, int full) · 19 unmodified lines | |||
| 1087 | * @cpu: the cpu buffer to wait on | 1109 | * @cpu: the cpu buffer to wait on |
| 1088 | * @filp: the file descriptor | 1110 | * @filp: the file descriptor |
| 1089 | * @poll_table: The poll descriptor | 1111 | * @poll_table: The poll descriptor |
| 1112 | * @full: wait until the percentage of pages are available, if @cpu != RING_BUFFER_ALL_CPUS | ||
| 1090 | * | 1113 | * |
| 1091 | * If @cpu == RING_BUFFER_ALL_CPUS then the task will wake up as soon | 1114 | * If @cpu == RING_BUFFER_ALL_CPUS then the task will wake up as soon |
| 1092 | * as data is added to any of the @buffer's cpu buffers. Otherwise | 1115 | * as data is added to any of the @buffer's cpu buffers. Otherwise |
| @@ -1096,14 +1119,15 @@ int ring_buffer_wait(struct trace_buffer *buffer, int cpu, int full) · 3 unmodified lines | |||
| 1096 | * zero otherwise. | 1119 | * zero otherwise. |
| 1097 | */ | 1120 | */ |
| 1098 | __poll_t ring_buffer_poll_wait(struct trace_buffer *buffer, int cpu, | 1121 | __poll_t ring_buffer_poll_wait(struct trace_buffer *buffer, int cpu, |
| 1099 | struct file *filp, poll_table *poll_table) | 1122 | struct file *filp, poll_table *poll_table, int full) |
| 1100 | { | 1123 | { |
| 1101 | struct ring_buffer_per_cpu *cpu_buffer; | 1124 | struct ring_buffer_per_cpu *cpu_buffer; |
| 1102 | struct rb_irq_work *work; | 1125 | struct rb_irq_work *work; |
| 1103 | 1126 | ||
| 1104 | if (cpu == RING_BUFFER_ALL_CPUS) | 1127 | if (cpu == RING_BUFFER_ALL_CPUS) { |
| 1105 | work = &buffer->irq_work; | 1128 | work = &buffer->irq_work; |
| 1106 | else { | 1129 | full = 0; |
| 1130 | } else { | ||
| 1107 | if (!cpumask_test_cpu(cpu, buffer->cpumask)) | 1131 | if (!cpumask_test_cpu(cpu, buffer->cpumask)) |
| 1108 | return -EINVAL; | 1132 | return -EINVAL; |
| 1109 | 1133 | ||
| @@ -1111,8 +1135,14 @@ __poll_t ring_buffer_poll_wait(struct trace_buffer *buffer, int cpu, · 1 unmodified line | |||
| 1111 | work = &cpu_buffer->irq_work; | 1135 | work = &cpu_buffer->irq_work; |
| 1112 | } | 1136 | } |
| 1113 | 1137 | ||
| 1114 | poll_wait(filp, &work->waiters, poll_table); | 1138 | if (full) { |
| 1115 | work->waiters_pending = true; | 1139 | poll_wait(filp, &work->full_waiters, poll_table); |
| 1140 | work->full_waiters_pending = true; | ||
| 1141 | } else { | ||
| 1142 | poll_wait(filp, &work->waiters, poll_table); | ||
| 1143 | work->waiters_pending = true; | ||
| 1144 | } | ||
| 1145 | |||
| 1116 | /* | 1146 | /* |
| 1117 | * There's a tight race between setting the waiters_pending and | 1147 | * There's a tight race between setting the waiters_pending and |
| 1118 | * checking if the ring buffer is empty. Once the waiters_pending bit | 1148 | * checking if the ring buffer is empty. Once the waiters_pending bit |
| @@ -1128,6 +1158,9 @@ __poll_t ring_buffer_poll_wait(struct trace_buffer *buffer, int cpu, · 9 unmodified lines | |||
| 1128 | */ | 1158 | */ |
| 1129 | smp_mb(); | 1159 | smp_mb(); |
| 1130 | 1160 | ||
| 1161 | if (full) | ||
| 1162 | return full_hit(buffer, cpu, full) ? EPOLLIN | EPOLLRDNORM : 0; | ||
| 1163 | |||
| 1131 | if ((cpu == RING_BUFFER_ALL_CPUS && !ring_buffer_empty(buffer)) || | 1164 | if ((cpu == RING_BUFFER_ALL_CPUS && !ring_buffer_empty(buffer)) || |
| 1132 | (cpu != RING_BUFFER_ALL_CPUS && !ring_buffer_empty_cpu(buffer, cpu))) | 1165 | (cpu != RING_BUFFER_ALL_CPUS && !ring_buffer_empty_cpu(buffer, cpu))) |
| 1133 | return EPOLLIN | EPOLLRDNORM; | 1166 | return EPOLLIN | EPOLLRDNORM; |
| @@ -1769,9 +1802,9 @@ static void rb_free_cpu_buffer(struct ring_buffer_per_cpu *cpu_buffer) · 635 unmodified lines | |||
| 1769 | 1802 | ||
| 1770 | free_buffer_page(cpu_buffer->reader_page); | 1803 | free_buffer_page(cpu_buffer->reader_page); |
| 1771 | 1804 | ||
| 1772 | rb_head_page_deactivate(cpu_buffer); | ||
| 1773 | |||
| 1774 | if (head) { | 1805 | if (head) { |
| 1806 | rb_head_page_deactivate(cpu_buffer); | ||
| 1807 | |||
| 1775 | list_for_each_entry_safe(bpage, tmp, head, list) { | 1808 | list_for_each_entry_safe(bpage, tmp, head, list) { |
| 1776 | list_del_init(&bpage->list); | 1809 | list_del_init(&bpage->list); |
| 1777 | free_buffer_page(bpage); | 1810 | free_buffer_page(bpage); |
| @@ -2007,6 +2040,7 @@ rb_remove_pages(struct ring_buffer_per_cpu *cpu_buffer, unsigned long nr_pages) · 229 unmodified lines | |||
| 2007 | */ | 2040 | */ |
| 2008 | local_add(page_entries, &cpu_buffer->overrun); | 2041 | local_add(page_entries, &cpu_buffer->overrun); |
| 2009 | local_sub(BUF_PAGE_SIZE, &cpu_buffer->entries_bytes); | 2042 | local_sub(BUF_PAGE_SIZE, &cpu_buffer->entries_bytes); |
| 2043 | local_inc(&cpu_buffer->pages_lost); | ||
| 2010 | } | 2044 | } |
| 2011 | 2045 | ||
| 2012 | /* | 2046 | /* |
| @@ -2491,6 +2525,7 @@ rb_handle_head_page(struct ring_buffer_per_cpu *cpu_buffer, · 478 unmodified lines | |||
| 2491 | */ | 2525 | */ |
| 2492 | local_add(entries, &cpu_buffer->overrun); | 2526 | local_add(entries, &cpu_buffer->overrun); |
| 2493 | local_sub(BUF_PAGE_SIZE, &cpu_buffer->entries_bytes); | 2527 | local_sub(BUF_PAGE_SIZE, &cpu_buffer->entries_bytes); |
| 2528 | local_inc(&cpu_buffer->pages_lost); | ||
| 2494 | 2529 | ||
| 2495 | /* | 2530 | /* |
| 2496 | * The entries will be zeroed out when we move the | 2531 | * The entries will be zeroed out when we move the |
| @@ -3155,10 +3190,6 @@ static void rb_commit(struct ring_buffer_per_cpu *cpu_buffer, · 658 unmodified lines | |||
| 3155 | static __always_inline void | 3190 | static __always_inline void |
| 3156 | rb_wakeups(struct trace_buffer *buffer, struct ring_buffer_per_cpu *cpu_buffer) | 3191 | rb_wakeups(struct trace_buffer *buffer, struct ring_buffer_per_cpu *cpu_buffer) |
| 3157 | { | 3192 | { |
| 3158 | size_t nr_pages; | ||
| 3159 | size_t dirty; | ||
| 3160 | size_t full; | ||
| 3161 | |||
| 3162 | if (buffer->irq_work.waiters_pending) { | 3193 | if (buffer->irq_work.waiters_pending) { |
| 3163 | buffer->irq_work.waiters_pending = false; | 3194 | buffer->irq_work.waiters_pending = false; |
| 3164 | /* irq_work_queue() supplies it's own memory barriers */ | 3195 | /* irq_work_queue() supplies it's own memory barriers */ |
| @@ -3182,10 +3213,7 @@ rb_wakeups(struct trace_buffer *buffer, struct ring_buffer_per_cpu *cpu_buffer) · 17 unmodified lines | |||
| 3182 | 3213 | ||
| 3183 | cpu_buffer->last_pages_touch = local_read(&cpu_buffer->pages_touched); | 3214 | cpu_buffer->last_pages_touch = local_read(&cpu_buffer->pages_touched); |
| 3184 | 3215 | ||
| 3185 | full = cpu_buffer->shortest_full; | 3216 | if (!full_hit(buffer, cpu_buffer->cpu, cpu_buffer->shortest_full)) |
| 3186 | nr_pages = cpu_buffer->nr_pages; | ||
| 3187 | dirty = ring_buffer_nr_dirty_pages(buffer, cpu_buffer->cpu); | ||
| 3188 | if (full && nr_pages && (dirty * 100) <= full * nr_pages) | ||
| 3189 | return; | 3217 | return; |
| 3190 | 3218 | ||
| 3191 | cpu_buffer->irq_work.wakeup_full = true; | 3219 | cpu_buffer->irq_work.wakeup_full = true; |
| @@ -5248,6 +5276,7 @@ rb_reset_cpu(struct ring_buffer_per_cpu *cpu_buffer) · 2056 unmodified lines | |||
| 5248 | local_set(&cpu_buffer->committing, 0); | 5276 | local_set(&cpu_buffer->committing, 0); |
| 5249 | local_set(&cpu_buffer->commits, 0); | 5277 | local_set(&cpu_buffer->commits, 0); |
| 5250 | local_set(&cpu_buffer->pages_touched, 0); | 5278 | local_set(&cpu_buffer->pages_touched, 0); |
| 5279 | local_set(&cpu_buffer->pages_lost, 0); | ||
| 5251 | local_set(&cpu_buffer->pages_read, 0); | 5280 | local_set(&cpu_buffer->pages_read, 0); |
| 5252 | cpu_buffer->last_pages_touch = 0; | 5281 | cpu_buffer->last_pages_touch = 0; |
| 5253 | cpu_buffer->shortest_full = 0; | 5282 | cpu_buffer->shortest_full = 0; |
| @@ -120,15 +120,13 @@ static int __init test_gen_synth_cmd(void) · 119 unmodified lines | |||
| 120 | 120 | ||
| 121 | /* Now generate a gen_synth_test event */ | 121 | /* Now generate a gen_synth_test event */ |
| 122 | ret = synth_event_trace_array(gen_synth_test, vals, ARRAY_SIZE(vals)); | 122 | ret = synth_event_trace_array(gen_synth_test, vals, ARRAY_SIZE(vals)); |
| 123 | out: | 123 | free: |
| 124 | kfree(buf); | ||
| 124 | return ret; | 125 | return ret; |
| 125 | delete: | 126 | delete: |
| 126 | /* We got an error after creating the event, delete it */ | 127 | /* We got an error after creating the event, delete it */ |
| 127 | synth_event_delete("gen_synth_test"); | 128 | synth_event_delete("gen_synth_test"); |
| 128 | free: | 129 | goto free; |
| 129 | kfree(buf); | ||
| 130 | |||
| 131 | goto out; | ||
| 132 | } | 130 | } |
| 133 | 131 | ||
| 134 | /* | 132 | /* |
| @@ -227,15 +225,13 @@ static int __init test_empty_synth_event(void) · 92 unmodified lines | |||
| 227 | 225 | ||
| 228 | /* Now trace an empty_synth_test event */ | 226 | /* Now trace an empty_synth_test event */ |
| 229 | ret = synth_event_trace_array(empty_synth_test, vals, ARRAY_SIZE(vals)); | 227 | ret = synth_event_trace_array(empty_synth_test, vals, ARRAY_SIZE(vals)); |
| 230 | out: | 228 | free: |
| 229 | kfree(buf); | ||
| 231 | return ret; | 230 | return ret; |
| 232 | delete: | 231 | delete: |
| 233 | /* We got an error after creating the event, delete it */ | 232 | /* We got an error after creating the event, delete it */ |
| 234 | synth_event_delete("empty_synth_test"); | 233 | synth_event_delete("empty_synth_test"); |
| 235 | free: | 234 | goto free; |
| 236 | kfree(buf); | ||
| 237 | |||
| 238 | goto out; | ||
| 239 | } | 235 | } |
| 240 | 236 | ||
| 241 | static struct synth_field_desc create_synth_test_fields[] = { | 237 | static struct synth_field_desc create_synth_test_fields[] = { |
| @@ -6657,6 +6657,7 @@ static int tracing_release_pipe(struct inode *inode, struct file *file) · 6656 unmodified lines | |||
| 6657 | mutex_unlock(&trace_types_lock); | 6657 | mutex_unlock(&trace_types_lock); |
| 6658 | 6658 | ||
| 6659 | free_cpumask_var(iter->started); | 6659 | free_cpumask_var(iter->started); |
| 6660 | kfree(iter->fmt); | ||
| 6660 | mutex_destroy(&iter->mutex); | 6661 | mutex_destroy(&iter->mutex); |
| 6661 | kfree(iter); | 6662 | kfree(iter); |
| 6662 | 6663 | ||
| @@ -6681,7 +6682,7 @@ trace_poll(struct trace_iterator *iter, struct file *filp, poll_table *poll_tabl · 18 unmodified lines | |||
| 6681 | return EPOLLIN | EPOLLRDNORM; | 6682 | return EPOLLIN | EPOLLRDNORM; |
| 6682 | else | 6683 | else |
| 6683 | return ring_buffer_poll_wait(iter->array_buffer->buffer, iter->cpu_file, | 6684 | return ring_buffer_poll_wait(iter->array_buffer->buffer, iter->cpu_file, |
| 6684 | filp, poll_table); | 6685 | filp, poll_table, iter->tr->buffer_percent); |
| 6685 | } | 6686 | } |
| 6686 | 6687 | ||
| 6687 | static __poll_t | 6688 | static __poll_t |
| @@ -7802,6 +7803,7 @@ static struct tracing_log_err *get_tracing_log_err(struct trace_array *tr, · 1114 unmodified lines | |||
| 7802 | int len) | 7803 | int len) |
| 7803 | { | 7804 | { |
| 7804 | struct tracing_log_err *err; | 7805 | struct tracing_log_err *err; |
| 7806 | char *cmd; | ||
| 7805 | 7807 | ||
| 7806 | if (tr->n_err_log_entries < TRACING_LOG_ERRS_MAX) { | 7808 | if (tr->n_err_log_entries < TRACING_LOG_ERRS_MAX) { |
| 7807 | err = alloc_tracing_log_err(len); | 7809 | err = alloc_tracing_log_err(len); |
| @@ -7810,12 +7812,12 @@ static struct tracing_log_err *get_tracing_log_err(struct trace_array *tr, · 2 unmodified lines | |||
| 7810 | 7812 | ||
| 7811 | return err; | 7813 | return err; |
| 7812 | } | 7814 | } |
| 7813 | 7815 | cmd = kzalloc(len, GFP_KERNEL); | |
| 7816 | if (!cmd) | ||
| 7817 | return ERR_PTR(-ENOMEM); | ||
| 7814 | err = list_first_entry(&tr->err_log, struct tracing_log_err, list); | 7818 | err = list_first_entry(&tr->err_log, struct tracing_log_err, list); |
| 7815 | kfree(err->cmd); | 7819 | kfree(err->cmd); |
| 7816 | err->cmd = kzalloc(len, GFP_KERNEL); | 7820 | err->cmd = cmd; |
| 7817 | if (!err->cmd) | ||
| 7818 | return ERR_PTR(-ENOMEM); | ||
| 7819 | list_del(&err->list); | 7821 | list_del(&err->list); |
| 7820 | 7822 | ||
| 7821 | return err; | 7823 | return err; |
| @@ -52,6 +52,7 @@ static void trace_event_probe_cleanup(struct trace_eprobe *ep) · 51 unmodified lines | |||
| 52 | kfree(ep->event_system); | 52 | kfree(ep->event_system); |
| 53 | if (ep->event) | 53 | if (ep->event) |
| 54 | trace_event_put_ref(ep->event); | 54 | trace_event_put_ref(ep->event); |
| 55 | kfree(ep->filter_str); | ||
| 55 | kfree(ep); | 56 | kfree(ep); |
| 56 | } | 57 | } |
| 57 | 58 | ||
| @@ -563,6 +564,9 @@ static void eprobe_trigger_func(struct event_trigger_data *data, · 505 unmodified lines | |||
| 563 | { | 564 | { |
| 564 | struct eprobe_data *edata = data->private_data; | 565 | struct eprobe_data *edata = data->private_data; |
| 565 | 566 | ||
| 567 | if (unlikely(!rec)) | ||
| 568 | return; | ||
| 569 | |||
| 566 | __eprobe_trace_func(edata, rec); | 570 | __eprobe_trace_func(edata, rec); |
| 567 | } | 571 | } |
| 568 | 572 | ||
| @@ -642,7 +646,7 @@ new_eprobe_trigger(struct trace_eprobe *ep, struct trace_event_file *file) · 73 unmodified lines | |||
| 642 | INIT_LIST_HEAD(&trigger->list); | 646 | INIT_LIST_HEAD(&trigger->list); |
| 643 | 647 | ||
| 644 | if (ep->filter_str) { | 648 | if (ep->filter_str) { |
| 645 | ret = create_event_filter(file->tr, file->event_call, | 649 | ret = create_event_filter(file->tr, ep->event, |
| 646 | ep->filter_str, false, &filter); | 650 | ep->filter_str, false, &filter); |
| 647 | if (ret) | 651 | if (ret) |
| 648 | goto error; | 652 | goto error; |
| @@ -900,7 +904,7 @@ static int trace_eprobe_tp_update_arg(struct trace_eprobe *ep, const char *argv[ · 251 unmodified lines | |||
| 900 | 904 | ||
| 901 | static int trace_eprobe_parse_filter(struct trace_eprobe *ep, int argc, const char *argv[]) | 905 | static int trace_eprobe_parse_filter(struct trace_eprobe *ep, int argc, const char *argv[]) |
| 902 | { | 906 | { |
| 903 | struct event_filter *dummy; | 907 | struct event_filter *dummy = NULL; |
| 904 | int i, ret, len = 0; | 908 | int i, ret, len = 0; |
| 905 | char *p; | 909 | char *p; |
| 906 | 910 | ||
| @@ -828,10 +828,9 @@ static int register_synth_event(struct synth_event *event) · 827 unmodified lines | |||
| 828 | } | 828 | } |
| 829 | 829 | ||
| 830 | ret = set_synth_event_print_fmt(call); | 830 | ret = set_synth_event_print_fmt(call); |
| 831 | if (ret < 0) { | 831 | /* unregister_trace_event() will be called inside */ |
| 832 | if (ret < 0) | ||
| 832 | trace_remove_event_call(call); | 833 | trace_remove_event_call(call); |
| 833 | goto err; | ||
| 834 | } | ||
| 835 | out: | 834 | out: |
| 836 | return ret; | 835 | return ret; |
| 837 | err: | 836 | err: |
| @@ -201,8 +201,6 @@ print_syscall_exit(struct trace_iterator *iter, int flags, · 200 unmodified lines | |||
| 201 | return trace_handle_return(s); | 201 | return trace_handle_return(s); |
| 202 | } | 202 | } |
| 203 | 203 | ||
| 204 | extern char *__bad_type_size(void); | ||
| 205 | |||
| 206 | #define SYSCALL_FIELD(_type, _name) { \ | 204 | #define SYSCALL_FIELD(_type, _name) { \ |
| 207 | .type = #_type, .name = #_name, \ | 205 | .type = #_type, .name = #_name, \ |
| 208 | .size = sizeof(_type), .align = __alignof__(_type), \ | 206 | .size = sizeof(_type), .align = __alignof__(_type), \ |
| @@ -97,7 +97,7 @@ long strncpy_from_kernel_nofault(char *dst, const void *unsafe_addr, long count) · 96 unmodified lines | |||
| 97 | return src - unsafe_addr; | 97 | return src - unsafe_addr; |
| 98 | Efault: | 98 | Efault: |
| 99 | pagefault_enable(); | 99 | pagefault_enable(); |
| 100 | dst[-1] = '\0'; | 100 | dst[0] = '\0'; |
| 101 | return -EFAULT; | 101 | return -EFAULT; |
| 102 | } | 102 | } |
| 103 | 103 | ||
| @@ -774,6 +774,7 @@ static void *bpf_test_init(const union bpf_attr *kattr, u32 user_size, · 773 unmodified lines | |||
| 774 | if (user_size > size) | 774 | if (user_size > size) |
| 775 | return ERR_PTR(-EMSGSIZE); | 775 | return ERR_PTR(-EMSGSIZE); |
| 776 | 776 | ||
| 777 | size = SKB_DATA_ALIGN(size); | ||
| 777 | data = kzalloc(size + headroom + tailroom, GFP_USER); | 778 | data = kzalloc(size + headroom + tailroom, GFP_USER); |
| 778 | if (!data) | 779 | if (!data) |
| 779 | return ERR_PTR(-ENOMEM); | 780 | return ERR_PTR(-ENOMEM); |
| @@ -959,6 +959,8 @@ int __br_vlan_set_proto(struct net_bridge *br, __be16 proto, · 958 unmodified lines | |||
| 959 | list_for_each_entry(p, &br->port_list, list) { | 959 | list_for_each_entry(p, &br->port_list, list) { |
| 960 | vg = nbp_vlan_group(p); | 960 | vg = nbp_vlan_group(p); |
| 961 | list_for_each_entry(vlan, &vg->vlan_list, vlist) { | 961 | list_for_each_entry(vlan, &vg->vlan_list, vlist) { |
| 962 | if (vlan->priv_flags & BR_VLFLAG_ADDED_BY_SWITCHDEV) | ||
| 963 | continue; | ||
| 962 | err = vlan_vid_add(p->dev, proto, vlan->vid); | 964 | err = vlan_vid_add(p->dev, proto, vlan->vid); |
| 963 | if (err) | 965 | if (err) |
| 964 | goto err_filt; | 966 | goto err_filt; |
| @@ -973,8 +975,11 @@ int __br_vlan_set_proto(struct net_bridge *br, __be16 proto, · 8 unmodified lines | |||
| 973 | /* Delete VLANs for the old proto from the device filter. */ | 975 | /* Delete VLANs for the old proto from the device filter. */ |
| 974 | list_for_each_entry(p, &br->port_list, list) { | 976 | list_for_each_entry(p, &br->port_list, list) { |
| 975 | vg = nbp_vlan_group(p); | 977 | vg = nbp_vlan_group(p); |
| 976 | list_for_each_entry(vlan, &vg->vlan_list, vlist) | 978 | list_for_each_entry(vlan, &vg->vlan_list, vlist) { |
| 979 | if (vlan->priv_flags & BR_VLFLAG_ADDED_BY_SWITCHDEV) | ||
| 980 | continue; | ||
| 977 | vlan_vid_del(p->dev, oldproto, vlan->vid); | 981 | vlan_vid_del(p->dev, oldproto, vlan->vid); |
| 982 | } | ||
| 978 | } | 983 | } |
| 979 | 984 | ||
| 980 | return 0; | 985 | return 0; |
| @@ -983,13 +988,19 @@ err_filt: · 2 unmodified lines | |||
| 983 | attr.u.vlan_protocol = ntohs(oldproto); | 988 | attr.u.vlan_protocol = ntohs(oldproto); |
| 984 | switchdev_port_attr_set(br->dev, &attr, NULL); | 989 | switchdev_port_attr_set(br->dev, &attr, NULL); |
| 985 | 990 | ||
| 986 | list_for_each_entry_continue_reverse(vlan, &vg->vlan_list, vlist) | 991 | list_for_each_entry_continue_reverse(vlan, &vg->vlan_list, vlist) { |
| 992 | if (vlan->priv_flags & BR_VLFLAG_ADDED_BY_SWITCHDEV) | ||
| 993 | continue; | ||
| 987 | vlan_vid_del(p->dev, proto, vlan->vid); | 994 | vlan_vid_del(p->dev, proto, vlan->vid); |
| 995 | } | ||
| 988 | 996 | ||
| 989 | list_for_each_entry_continue_reverse(p, &br->port_list, list) { | 997 | list_for_each_entry_continue_reverse(p, &br->port_list, list) { |
| 990 | vg = nbp_vlan_group(p); | 998 | vg = nbp_vlan_group(p); |
| 991 | list_for_each_entry(vlan, &vg->vlan_list, vlist) | 999 | list_for_each_entry(vlan, &vg->vlan_list, vlist) { |
| 1000 | if (vlan->priv_flags & BR_VLFLAG_ADDED_BY_SWITCHDEV) | ||
| 1001 | continue; | ||
| 992 | vlan_vid_del(p->dev, proto, vlan->vid); | 1002 | vlan_vid_del(p->dev, proto, vlan->vid); |
| 1003 | } | ||
| 993 | } | 1004 | } |
| 994 | 1005 | ||
| 995 | return err; | 1006 | return err; |
| @@ -310,9 +310,6 @@ static int chnl_net_open(struct net_device *dev) · 309 unmodified lines | |||
| 310 | 310 | ||
| 311 | if (result == 0) { | 311 | if (result == 0) { |
| 312 | pr_debug("connect timeout\n"); | 312 | pr_debug("connect timeout\n"); |
| 313 | caif_disconnect_client(dev_net(dev), &priv->chnl); | ||
| 314 | priv->state = CAIF_DISCONNECTED; | ||
| 315 | pr_debug("state disconnected\n"); | ||
| 316 | result = -ETIMEDOUT; | 313 | result = -ETIMEDOUT; |
| 317 | goto error; | 314 | goto error; |
| 318 | } | 315 | } |
| @@ -864,6 +864,14 @@ disconnect: · 863 unmodified lines | |||
| 864 | return err; | 864 | return err; |
| 865 | } | 865 | } |
| 866 | 866 | ||
| 867 | static void dsa_switch_teardown_tag_protocol(struct dsa_switch *ds) | ||
| 868 | { | ||
| 869 | const struct dsa_device_ops *tag_ops = ds->dst->tag_ops; | ||
| 870 | |||
| 871 | if (tag_ops->disconnect) | ||
| 872 | tag_ops->disconnect(ds); | ||
| 873 | } | ||
| 874 | |||
| 867 | static int dsa_switch_setup(struct dsa_switch *ds) | 875 | static int dsa_switch_setup(struct dsa_switch *ds) |
| 868 | { | 876 | { |
| 869 | struct dsa_devlink_priv *dl_priv; | 877 | struct dsa_devlink_priv *dl_priv; |
| @@ -953,6 +961,8 @@ static void dsa_switch_teardown(struct dsa_switch *ds) · 83 unmodified lines | |||
| 953 | ds->slave_mii_bus = NULL; | 961 | ds->slave_mii_bus = NULL; |
| 954 | } | 962 | } |
| 955 | 963 | ||
| 964 | dsa_switch_teardown_tag_protocol(ds); | ||
| 965 | |||
| 956 | if (ds->ops->teardown) | 966 | if (ds->ops->teardown) |
| 957 | ds->ops->teardown(ds); | 967 | ds->ops->teardown(ds); |
| 958 | 968 | ||
| @@ -210,6 +210,7 @@ static inline struct net_device *dsa_master_find_slave(struct net_device *dev, · 209 unmodified lines | |||
| 210 | extern struct rtnl_link_ops dsa_link_ops __read_mostly; | 210 | extern struct rtnl_link_ops dsa_link_ops __read_mostly; |
| 211 | 211 | ||
| 212 | /* port.c */ | 212 | /* port.c */ |
| 213 | bool dsa_port_supports_hwtstamp(struct dsa_port *dp, struct ifreq *ifr); | ||
| 213 | void dsa_port_set_tag_protocol(struct dsa_port *cpu_dp, | 214 | void dsa_port_set_tag_protocol(struct dsa_port *cpu_dp, |
| 214 | const struct dsa_device_ops *tag_ops); | 215 | const struct dsa_device_ops *tag_ops); |
| 215 | int dsa_port_set_state(struct dsa_port *dp, u8 state, bool do_fast_age); | 216 | int dsa_port_set_state(struct dsa_port *dp, u8 state, bool do_fast_age); |
| @@ -204,8 +204,7 @@ static int dsa_master_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) · 203 unmodified lines | |||
| 204 | * switch in the tree that is PTP capable. | 204 | * switch in the tree that is PTP capable. |
| 205 | */ | 205 | */ |
| 206 | list_for_each_entry(dp, &dst->ports, list) | 206 | list_for_each_entry(dp, &dst->ports, list) |
| 207 | if (dp->ds->ops->port_hwtstamp_get || | 207 | if (dsa_port_supports_hwtstamp(dp, ifr)) |
| 208 | dp->ds->ops->port_hwtstamp_set) | ||
| 209 | return -EBUSY; | 208 | return -EBUSY; |
| 210 | break; | 209 | break; |
| 211 | } | 210 | } |
| @@ -110,6 +110,22 @@ static bool dsa_port_can_configure_learning(struct dsa_port *dp) · 109 unmodified lines | |||
| 110 | return !err; | 110 | return !err; |
| 111 | } | 111 | } |
| 112 | 112 | ||
| 113 | bool dsa_port_supports_hwtstamp(struct dsa_port *dp, struct ifreq *ifr) | ||
| 114 | { | ||
| 115 | struct dsa_switch *ds = dp->ds; | ||
| 116 | int err; | ||
| 117 | |||
| 118 | if (!ds->ops->port_hwtstamp_get || !ds->ops->port_hwtstamp_set) | ||
| 119 | return false; | ||
| 120 | |||
| 121 | /* "See through" shim implementations of the "get" method. | ||
| 122 | * This will clobber the ifreq structure, but we will either return an | ||
| 123 | * error, or the master will overwrite it with proper values. | ||
| 124 | */ | ||
| 125 | err = ds->ops->port_hwtstamp_get(ds, dp->index, ifr); | ||
| 126 | return err != -EOPNOTSUPP; | ||
| 127 | } | ||
| 128 | |||
| 113 | int dsa_port_set_state(struct dsa_port *dp, u8 state, bool do_fast_age) | 129 | int dsa_port_set_state(struct dsa_port *dp, u8 state, bool do_fast_age) |
| 114 | { | 130 | { |
| 115 | struct dsa_switch *ds = dp->ds; | 131 | struct dsa_switch *ds = dp->ds; |
| @@ -402,6 +402,16 @@ config INET_IPCOMP · 401 unmodified lines | |||
| 402 | 402 | ||
| 403 | If unsure, say Y. | 403 | If unsure, say Y. |
| 404 | 404 | ||
| 405 | config INET_TABLE_PERTURB_ORDER | ||
| 406 | int "INET: Source port perturbation table size (as power of 2)" if EXPERT | ||
| 407 | default 16 | ||
| 408 | help | ||
| 409 | Source port perturbation table size (as power of 2) for | ||
| 410 | RFC 6056 3.3.4. Algorithm 4: Double-Hash Port Selection Algorithm. | ||
| 411 | |||
| 412 | The default is almost always what you want. | ||
| 413 | Only change this if you know what you are doing. | ||
| 414 | |||
| 405 | config INET_XFRM_TUNNEL | 415 | config INET_XFRM_TUNNEL |
| 406 | tristate | 416 | tristate |
| 407 | select INET_TUNNEL | 417 | select INET_TUNNEL |
| @@ -906,13 +906,13 @@ EXPORT_SYMBOL_GPL(inet_bhash2_update_saddr); · 905 unmodified lines | |||
| 906 | * Note that we use 32bit integers (vs RFC 'short integers') | 906 | * Note that we use 32bit integers (vs RFC 'short integers') |
| 907 | * because 2^16 is not a multiple of num_ephemeral and this | 907 | * because 2^16 is not a multiple of num_ephemeral and this |
| 908 | * property might be used by clever attacker. | 908 | * property might be used by clever attacker. |
| 909 | * | ||
| 909 | * RFC claims using TABLE_LENGTH=10 buckets gives an improvement, though | 910 | * RFC claims using TABLE_LENGTH=10 buckets gives an improvement, though |
| 910 | * attacks were since demonstrated, thus we use 65536 instead to really | 911 | * attacks were since demonstrated, thus we use 65536 by default instead |
| 911 | * give more isolation and privacy, at the expense of 256kB of kernel | 912 | * to really give more isolation and privacy, at the expense of 256kB |
| 912 | * memory. | 913 | * of kernel memory. |
| 913 | */ | 914 | */ |
| 914 | #define INET_TABLE_PERTURB_SHIFT 16 | 915 | #define INET_TABLE_PERTURB_SIZE (1 << CONFIG_INET_TABLE_PERTURB_ORDER) |
| 915 | #define INET_TABLE_PERTURB_SIZE (1 << INET_TABLE_PERTURB_SHIFT) | ||
| 916 | static u32 *table_perturb; | 916 | static u32 *table_perturb; |
| 917 | 917 | ||
| 918 | int __inet_hash_connect(struct inet_timewait_death_row *death_row, | 918 | int __inet_hash_connect(struct inet_timewait_death_row *death_row, |
| @@ -222,7 +222,7 @@ static void requeue_rx_msgs(struct kcm_mux *mux, struct sk_buff_head *head) · 221 unmodified lines | |||
| 222 | struct sk_buff *skb; | 222 | struct sk_buff *skb; |
| 223 | struct kcm_sock *kcm; | 223 | struct kcm_sock *kcm; |
| 224 | 224 | ||
| 225 | while ((skb = __skb_dequeue(head))) { | 225 | while ((skb = skb_dequeue(head))) { |
| 226 | /* Reset destructor to avoid calling kcm_rcv_ready */ | 226 | /* Reset destructor to avoid calling kcm_rcv_ready */ |
| 227 | skb->destructor = sock_rfree; | 227 | skb->destructor = sock_rfree; |
| 228 | skb_orphan(skb); | 228 | skb_orphan(skb); |
| @@ -1085,53 +1085,17 @@ out_error: · 856 unmodified lines | |||
| 1085 | return err; | 1085 | return err; |
| 1086 | } | 1086 | } |
| 1087 | 1087 | ||
| 1088 | static struct sk_buff *kcm_wait_data(struct sock *sk, int flags, | ||
| 1089 | long timeo, int *err) | ||
| 1090 | { | ||
| 1091 | struct sk_buff *skb; | ||
| 1092 | |||
| 1093 | while (!(skb = skb_peek(&sk->sk_receive_queue))) { | ||
| 1094 | if (sk->sk_err) { | ||
| 1095 | *err = sock_error(sk); | ||
| 1096 | return NULL; | ||
| 1097 | } | ||
| 1098 | |||
| 1099 | if (sock_flag(sk, SOCK_DONE)) | ||
| 1100 | return NULL; | ||
| 1101 | |||
| 1102 | if ((flags & MSG_DONTWAIT) || !timeo) { | ||
| 1103 | *err = -EAGAIN; | ||
| 1104 | return NULL; | ||
| 1105 | } | ||
| 1106 | |||
| 1107 | sk_wait_data(sk, &timeo, NULL); | ||
| 1108 | |||
| 1109 | /* Handle signals */ | ||
| 1110 | if (signal_pending(current)) { | ||
| 1111 | *err = sock_intr_errno(timeo); | ||
| 1112 | return NULL; | ||
| 1113 | } | ||
| 1114 | } | ||
| 1115 | |||
| 1116 | return skb; | ||
| 1117 | } | ||
| 1118 | |||
| 1119 | static int kcm_recvmsg(struct socket *sock, struct msghdr *msg, | 1088 | static int kcm_recvmsg(struct socket *sock, struct msghdr *msg, |
| 1120 | size_t len, int flags) | 1089 | size_t len, int flags) |
| 1121 | { | 1090 | { |
| 1122 | struct sock *sk = sock->sk; | 1091 | struct sock *sk = sock->sk; |
| 1123 | struct kcm_sock *kcm = kcm_sk(sk); | 1092 | struct kcm_sock *kcm = kcm_sk(sk); |
| 1124 | int err = 0; | 1093 | int err = 0; |
| 1125 | long timeo; | ||
| 1126 | struct strp_msg *stm; | 1094 | struct strp_msg *stm; |
| 1127 | int copied = 0; | 1095 | int copied = 0; |
| 1128 | struct sk_buff *skb; | 1096 | struct sk_buff *skb; |
| 1129 | 1097 | ||
| 1130 | timeo = sock_rcvtimeo(sk, flags & MSG_DONTWAIT); | 1098 | skb = skb_recv_datagram(sk, flags, &err); |
| 1131 | |||
| 1132 | lock_sock(sk); | ||
| 1133 | |||
| 1134 | skb = kcm_wait_data(sk, flags, timeo, &err); | ||
| 1135 | if (!skb) | 1099 | if (!skb) |
| 1136 | goto out; | 1100 | goto out; |
| 1137 | 1101 | ||
| @@ -1162,14 +1126,11 @@ msg_finished: · 24 unmodified lines | |||
| 1162 | /* Finished with message */ | 1126 | /* Finished with message */ |
| 1163 | msg->msg_flags |= MSG_EOR; | 1127 | msg->msg_flags |= MSG_EOR; |
| 1164 | KCM_STATS_INCR(kcm->stats.rx_msgs); | 1128 | KCM_STATS_INCR(kcm->stats.rx_msgs); |
| 1165 | skb_unlink(skb, &sk->sk_receive_queue); | ||
| 1166 | kfree_skb(skb); | ||
| 1167 | } | 1129 | } |
| 1168 | } | 1130 | } |
| 1169 | 1131 | ||
| 1170 | out: | 1132 | out: |
| 1171 | release_sock(sk); | 1133 | skb_free_datagram(sk, skb); |
| 1172 | |||
| 1173 | return copied ? : err; | 1134 | return copied ? : err; |
| 1174 | } | 1135 | } |
| 1175 | 1136 | ||
| @@ -1179,7 +1140,6 @@ static ssize_t kcm_splice_read(struct socket *sock, loff_t *ppos, · 3 unmodified lines | |||
| 1179 | { | 1140 | { |
| 1180 | struct sock *sk = sock->sk; | 1141 | struct sock *sk = sock->sk; |
| 1181 | struct kcm_sock *kcm = kcm_sk(sk); | 1142 | struct kcm_sock *kcm = kcm_sk(sk); |
| 1182 | long timeo; | ||
| 1183 | struct strp_msg *stm; | 1143 | struct strp_msg *stm; |
| 1184 | int err = 0; | 1144 | int err = 0; |
| 1185 | ssize_t copied; | 1145 | ssize_t copied; |
| @@ -1187,11 +1147,7 @@ static ssize_t kcm_splice_read(struct socket *sock, loff_t *ppos, · 1 unmodified line | |||
| 1187 | 1147 | ||
| 1188 | /* Only support splice for SOCKSEQPACKET */ | 1148 | /* Only support splice for SOCKSEQPACKET */ |
| 1189 | 1149 | ||
| 1190 | timeo = sock_rcvtimeo(sk, flags & MSG_DONTWAIT); | 1150 | skb = skb_recv_datagram(sk, flags, &err); |
| 1191 | |||
| 1192 | lock_sock(sk); | ||
| 1193 | |||
| 1194 | skb = kcm_wait_data(sk, flags, timeo, &err); | ||
| 1195 | if (!skb) | 1151 | if (!skb) |
| 1196 | goto err_out; | 1152 | goto err_out; |
| 1197 | 1153 | ||
| @@ -1219,13 +1175,11 @@ static ssize_t kcm_splice_read(struct socket *sock, loff_t *ppos, · 21 unmodified lines | |||
| 1219 | * finish reading the message. | 1175 | * finish reading the message. |
| 1220 | */ | 1176 | */ |
| 1221 | 1177 | ||
| 1222 | release_sock(sk); | 1178 | skb_free_datagram(sk, skb); |
| 1223 | |||
| 1224 | return copied; | 1179 | return copied; |
| 1225 | 1180 | ||
| 1226 | err_out: | 1181 | err_out: |
| 1227 | release_sock(sk); | 1182 | skb_free_datagram(sk, skb); |
| 1228 | |||
| 1229 | return err; | 1183 | return err; |
| 1230 | } | 1184 | } |
| 1231 | 1185 | ||
| @@ -1150,8 +1150,10 @@ static void l2tp_tunnel_destruct(struct sock *sk) · 1149 unmodified lines | |||
| 1150 | } | 1150 | } |
| 1151 | 1151 | ||
| 1152 | /* Remove hooks into tunnel socket */ | 1152 | /* Remove hooks into tunnel socket */ |
| 1153 | write_lock_bh(&sk->sk_callback_lock); | ||
| 1153 | sk->sk_destruct = tunnel->old_sk_destruct; | 1154 | sk->sk_destruct = tunnel->old_sk_destruct; |
| 1154 | sk->sk_user_data = NULL; | 1155 | sk->sk_user_data = NULL; |
| 1156 | write_unlock_bh(&sk->sk_callback_lock); | ||
| 1155 | 1157 | ||
| 1156 | /* Call the original destructor */ | 1158 | /* Call the original destructor */ |
| 1157 | if (sk->sk_destruct) | 1159 | if (sk->sk_destruct) |
| @@ -1469,16 +1471,18 @@ int l2tp_tunnel_register(struct l2tp_tunnel *tunnel, struct net *net, · 311 unmodified lines | |||
| 1469 | sock = sockfd_lookup(tunnel->fd, &ret); | 1471 | sock = sockfd_lookup(tunnel->fd, &ret); |
| 1470 | if (!sock) | 1472 | if (!sock) |
| 1471 | goto err; | 1473 | goto err; |
| 1472 | |||
| 1473 | ret = l2tp_validate_socket(sock->sk, net, tunnel->encap); | ||
| 1474 | if (ret < 0) | ||
| 1475 | goto err_sock; | ||
| 1476 | } | 1474 | } |
| 1477 | 1475 | ||
| 1476 | sk = sock->sk; | ||
| 1477 | write_lock(&sk->sk_callback_lock); | ||
| 1478 | |||
| 1479 | ret = l2tp_validate_socket(sk, net, tunnel->encap); | ||
| 1480 | if (ret < 0) | ||
| 1481 | goto err_sock; | ||
| 1482 | |||
| 1478 | tunnel->l2tp_net = net; | 1483 | tunnel->l2tp_net = net; |
| 1479 | pn = l2tp_pernet(net); | 1484 | pn = l2tp_pernet(net); |
| 1480 | 1485 | ||
| 1481 | sk = sock->sk; | ||
| 1482 | sock_hold(sk); | 1486 | sock_hold(sk); |
| 1483 | tunnel->sock = sk; | 1487 | tunnel->sock = sk; |
| 1484 | 1488 | ||
| @@ -1504,7 +1508,7 @@ int l2tp_tunnel_register(struct l2tp_tunnel *tunnel, struct net *net, · 19 unmodified lines | |||
| 1504 | 1508 | ||
| 1505 | setup_udp_tunnel_sock(net, sock, &udp_cfg); | 1509 | setup_udp_tunnel_sock(net, sock, &udp_cfg); |
| 1506 | } else { | 1510 | } else { |
| 1507 | sk->sk_user_data = tunnel; | 1511 | rcu_assign_sk_user_data(sk, tunnel); |
| 1508 | } | 1512 | } |
| 1509 | 1513 | ||
| 1510 | tunnel->old_sk_destruct = sk->sk_destruct; | 1514 | tunnel->old_sk_destruct = sk->sk_destruct; |
| @@ -1518,6 +1522,7 @@ int l2tp_tunnel_register(struct l2tp_tunnel *tunnel, struct net *net, · 7 unmodified lines | |||
| 1518 | if (tunnel->fd >= 0) | 1522 | if (tunnel->fd >= 0) |
| 1519 | sockfd_put(sock); | 1523 | sockfd_put(sock); |
| 1520 | 1524 | ||
| 1525 | write_unlock(&sk->sk_callback_lock); | ||
| 1521 | return 0; | 1526 | return 0; |
| 1522 | 1527 | ||
| 1523 | err_sock: | 1528 | err_sock: |
| @@ -1525,6 +1530,8 @@ err_sock: · 1 unmodified line | |||
| 1525 | sock_release(sock); | 1530 | sock_release(sock); |
| 1526 | else | 1531 | else |
| 1527 | sockfd_put(sock); | 1532 | sockfd_put(sock); |
| 1533 | |||
| 1534 | write_unlock(&sk->sk_callback_lock); | ||
| 1528 | err: | 1535 | err: |
| 1529 | return ret; | 1536 | return ret; |
| 1530 | } | 1537 | } |
| @@ -346,7 +346,7 @@ static struct sk_buff *tls_enc_skb(struct tls_context *tls_ctx, · 345 unmodified lines | |||
| 346 | salt = tls_ctx->crypto_send.aes_gcm_256.salt; | 346 | salt = tls_ctx->crypto_send.aes_gcm_256.salt; |
| 347 | break; | 347 | break; |
| 348 | default: | 348 | default: |
| 349 | return NULL; | 349 | goto free_req; |
| 350 | } | 350 | } |
| 351 | cipher_sz = &tls_cipher_size_desc[tls_ctx->crypto_send.info.cipher_type]; | 351 | cipher_sz = &tls_cipher_size_desc[tls_ctx->crypto_send.info.cipher_type]; |
| 352 | buf_len = cipher_sz->salt + cipher_sz->iv + TLS_AAD_SPACE_SIZE + | 352 | buf_len = cipher_sz->salt + cipher_sz->iv + TLS_AAD_SPACE_SIZE + |
| @@ -492,7 +492,8 @@ int tls_sw_fallback_init(struct sock *sk, · 139 unmodified lines | |||
| 492 | key = ((struct tls12_crypto_info_aes_gcm_256 *)crypto_info)->key; | 492 | key = ((struct tls12_crypto_info_aes_gcm_256 *)crypto_info)->key; |
| 493 | break; | 493 | break; |
| 494 | default: | 494 | default: |
| 495 | return -EINVAL; | 495 | rc = -EINVAL; |
| 496 | goto free_aead; | ||
| 496 | } | 497 | } |
| 497 | cipher_sz = &tls_cipher_size_desc[crypto_info->cipher_type]; | 498 | cipher_sz = &tls_cipher_size_desc[crypto_info->cipher_type]; |
| 498 | 499 | ||
| @@ -117,7 +117,7 @@ int x25_lapb_receive_frame(struct sk_buff *skb, struct net_device *dev, · 116 unmodified lines | |||
| 117 | 117 | ||
| 118 | if (!pskb_may_pull(skb, 1)) { | 118 | if (!pskb_may_pull(skb, 1)) { |
| 119 | x25_neigh_put(nb); | 119 | x25_neigh_put(nb); |
| 120 | return 0; | 120 | goto drop; |
| 121 | } | 121 | } |
| 122 | 122 | ||
| 123 | switch (skb->data[0]) { | 123 | switch (skb->data[0]) { |
| @@ -90,7 +90,7 @@ if [ -n "$KDEB_PKGVERSION" ]; then · 89 unmodified lines | |||
| 90 | packageversion=$KDEB_PKGVERSION | 90 | packageversion=$KDEB_PKGVERSION |
| 91 | revision=${packageversion##*-} | 91 | revision=${packageversion##*-} |
| 92 | else | 92 | else |
| 93 | revision=$(cat .version 2>/dev/null||echo 1) | 93 | revision=$($srctree/init/build-version) |
| 94 | packageversion=$version-$revision | 94 | packageversion=$version-$revision |
| 95 | fi | 95 | fi |
| 96 | sourcename=$KDEB_SOURCENAME | 96 | sourcename=$KDEB_SOURCENAME |
| @@ -9436,6 +9436,8 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { · 9435 unmodified lines | |||
| 9436 | SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_AMP), | 9436 | SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_AMP), |
| 9437 | SND_PCI_QUIRK(0x144d, 0xc189, "Samsung Galaxy Flex Book (NT950QCG-X716)", ALC298_FIXUP_SAMSUNG_AMP), | 9437 | SND_PCI_QUIRK(0x144d, 0xc189, "Samsung Galaxy Flex Book (NT950QCG-X716)", ALC298_FIXUP_SAMSUNG_AMP), |
| 9438 | SND_PCI_QUIRK(0x144d, 0xc18a, "Samsung Galaxy Book Ion (NP930XCJ-K01US)", ALC298_FIXUP_SAMSUNG_AMP), | 9438 | SND_PCI_QUIRK(0x144d, 0xc18a, "Samsung Galaxy Book Ion (NP930XCJ-K01US)", ALC298_FIXUP_SAMSUNG_AMP), |
| 9439 | SND_PCI_QUIRK(0x144d, 0xc1a3, "Samsung Galaxy Book Pro (NP935XDB-KC1SE)", ALC298_FIXUP_SAMSUNG_AMP), | ||
| 9440 | SND_PCI_QUIRK(0x144d, 0xc1a6, "Samsung Galaxy Book Pro 360 (NP930QBD)", ALC298_FIXUP_SAMSUNG_AMP), | ||
| 9439 | SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8), | 9441 | SND_PCI_QUIRK(0x144d, 0xc740, "Samsung Ativ book 8 (NP870Z5G)", ALC269_FIXUP_ATIV_BOOK_8), |
| 9440 | SND_PCI_QUIRK(0x144d, 0xc812, "Samsung Notebook Pen S (NT950SBE-X58)", ALC298_FIXUP_SAMSUNG_AMP), | 9442 | SND_PCI_QUIRK(0x144d, 0xc812, "Samsung Notebook Pen S (NT950SBE-X58)", ALC298_FIXUP_SAMSUNG_AMP), |
| 9441 | SND_PCI_QUIRK(0x144d, 0xc830, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_AMP), | 9443 | SND_PCI_QUIRK(0x144d, 0xc830, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_AMP), |
| @@ -816,12 +816,19 @@ static int hdmi_dai_probe(struct snd_soc_dai *dai) · 815 unmodified lines | |||
| 816 | .source = "RX", | 816 | .source = "RX", |
| 817 | }, | 817 | }, |
| 818 | }; | 818 | }; |
| 819 | int ret; | 819 | int ret, i; |
| 820 | 820 | ||
| 821 | dapm = snd_soc_component_get_dapm(dai->component); | 821 | dapm = snd_soc_component_get_dapm(dai->component); |
| 822 | ret = snd_soc_dapm_add_routes(dapm, route, 2); | 822 | |
| 823 | if (ret) | 823 | /* One of the directions might be omitted for unidirectional DAIs */ |
| 824 | return ret; | 824 | for (i = 0; i < ARRAY_SIZE(route); i++) { |
| 825 | if (!route[i].source || !route[i].sink) | ||
| 826 | continue; | ||
| 827 | |||
| 828 | ret = snd_soc_dapm_add_routes(dapm, &route[i], 1); | ||
| 829 | if (ret) | ||
| 830 | return ret; | ||
| 831 | } | ||
| 825 | 832 | ||
| 826 | daifmt = devm_kzalloc(dai->dev, sizeof(*daifmt), GFP_KERNEL); | 833 | daifmt = devm_kzalloc(dai->dev, sizeof(*daifmt), GFP_KERNEL); |
| 827 | if (!daifmt) | 834 | if (!daifmt) |
| @@ -1009,11 +1016,24 @@ static int hdmi_codec_probe(struct platform_device *pdev) · 181 unmodified lines | |||
| 1009 | if (hcd->i2s) { | 1016 | if (hcd->i2s) { |
| 1010 | daidrv[i] = hdmi_i2s_dai; | 1017 | daidrv[i] = hdmi_i2s_dai; |
| 1011 | daidrv[i].playback.channels_max = hcd->max_i2s_channels; | 1018 | daidrv[i].playback.channels_max = hcd->max_i2s_channels; |
| 1019 | if (hcd->no_i2s_playback) | ||
| 1020 | memset(&daidrv[i].playback, 0, | ||
| 1021 | sizeof(daidrv[i].playback)); | ||
| 1022 | if (hcd->no_i2s_capture) | ||
| 1023 | memset(&daidrv[i].capture, 0, | ||
| 1024 | sizeof(daidrv[i].capture)); | ||
| 1012 | i++; | 1025 | i++; |
| 1013 | } | 1026 | } |
| 1014 | 1027 | ||
| 1015 | if (hcd->spdif) | 1028 | if (hcd->spdif) { |
| 1016 | daidrv[i] = hdmi_spdif_dai; | 1029 | daidrv[i] = hdmi_spdif_dai; |
| 1030 | if (hcd->no_spdif_playback) | ||
| 1031 | memset(&daidrv[i].playback, 0, | ||
| 1032 | sizeof(daidrv[i].playback)); | ||
| 1033 | if (hcd->no_spdif_capture) | ||
| 1034 | memset(&daidrv[i].capture, 0, | ||
| 1035 | sizeof(daidrv[i].capture)); | ||
| 1036 | } | ||
| 1017 | 1037 | ||
| 1018 | dev_set_drvdata(dev, hcp); | 1038 | dev_set_drvdata(dev, hcp); |
| 1019 | 1039 | ||
| @@ -1133,10 +1133,8 @@ static int snd_usbmidi_output_open(struct snd_rawmidi_substream *substream) · 1132 unmodified lines | |||
| 1133 | port = &umidi->endpoints[i].out->ports[j]; | 1133 | port = &umidi->endpoints[i].out->ports[j]; |
| 1134 | break; | 1134 | break; |
| 1135 | } | 1135 | } |
| 1136 | if (!port) { | 1136 | if (!port) |
| 1137 | snd_BUG(); | ||
| 1138 | return -ENXIO; | 1137 | return -ENXIO; |
| 1139 | } | ||
| 1140 | 1138 | ||
| 1141 | substream->runtime->private_data = port; | 1139 | substream->runtime->private_data = port; |
| 1142 | port->state = STATE_UNKNOWN; | 1140 | port->state = STATE_UNKNOWN; |
| @@ -535,6 +535,11 @@ · 534 unmodified lines | |||
| 535 | #define MSR_AMD64_CPUID_FN_1 0xc0011004 | 535 | #define MSR_AMD64_CPUID_FN_1 0xc0011004 |
| 536 | #define MSR_AMD64_LS_CFG 0xc0011020 | 536 | #define MSR_AMD64_LS_CFG 0xc0011020 |
| 537 | #define MSR_AMD64_DC_CFG 0xc0011022 | 537 | #define MSR_AMD64_DC_CFG 0xc0011022 |
| 538 | |||
| 539 | #define MSR_AMD64_DE_CFG 0xc0011029 | ||
| 540 | #define MSR_AMD64_DE_CFG_LFENCE_SERIALIZE_BIT 1 | ||
| 541 | #define MSR_AMD64_DE_CFG_LFENCE_SERIALIZE BIT_ULL(MSR_AMD64_DE_CFG_LFENCE_SERIALIZE_BIT) | ||
| 542 | |||
| 538 | #define MSR_AMD64_BU_CFG2 0xc001102a | 543 | #define MSR_AMD64_BU_CFG2 0xc001102a |
| 539 | #define MSR_AMD64_IBSFETCHCTL 0xc0011030 | 544 | #define MSR_AMD64_IBSFETCHCTL 0xc0011030 |
| 540 | #define MSR_AMD64_IBSFETCHLINAD 0xc0011031 | 545 | #define MSR_AMD64_IBSFETCHLINAD 0xc0011031 |
| @@ -640,9 +645,6 @@ · 99 unmodified lines | |||
| 640 | #define FAM10H_MMIO_CONF_BASE_MASK 0xfffffffULL | 645 | #define FAM10H_MMIO_CONF_BASE_MASK 0xfffffffULL |
| 641 | #define FAM10H_MMIO_CONF_BASE_SHIFT 20 | 646 | #define FAM10H_MMIO_CONF_BASE_SHIFT 20 |
| 642 | #define MSR_FAM10H_NODE_ID 0xc001100c | 647 | #define MSR_FAM10H_NODE_ID 0xc001100c |
| 643 | #define MSR_F10H_DECFG 0xc0011029 | ||
| 644 | #define MSR_F10H_DECFG_LFENCE_SERIALIZE_BIT 1 | ||
| 645 | #define MSR_F10H_DECFG_LFENCE_SERIALIZE BIT_ULL(MSR_F10H_DECFG_LFENCE_SERIALIZE_BIT) | ||
| 646 | 648 | ||
| 647 | /* K8 MSRs */ | 649 | /* K8 MSRs */ |
| 648 | #define MSR_K8_TOP_MEM1 0xc001001a | 650 | #define MSR_K8_TOP_MEM1 0xc001001a |
| @@ -715,12 +715,12 @@ int main(int argc, char **argv) · 714 unmodified lines | |||
| 715 | continue; | 715 | continue; |
| 716 | } | 716 | } |
| 717 | 717 | ||
| 718 | toread = buf_len; | ||
| 719 | } else { | 718 | } else { |
| 720 | usleep(timedelay); | 719 | usleep(timedelay); |
| 721 | toread = 64; | ||
| 722 | } | 720 | } |
| 723 | 721 | ||
| 722 | toread = buf_len; | ||
| 723 | |||
| 724 | read_size = read(buf_fd, data, toread * scan_size); | 724 | read_size = read(buf_fd, data, toread * scan_size); |
| 725 | if (read_size < 0) { | 725 | if (read_size < 0) { |
| 726 | if (errno == EAGAIN) { | 726 | if (errno == EAGAIN) { |
| @@ -63,6 +63,13 @@ void test_varlen(void) · 62 unmodified lines | |||
| 63 | CHECK_VAL(data->total4, size1 + size2); | 63 | CHECK_VAL(data->total4, size1 + size2); |
| 64 | CHECK(memcmp(data->payload4, exp_str, size1 + size2), "content_check", | 64 | CHECK(memcmp(data->payload4, exp_str, size1 + size2), "content_check", |
| 65 | "doesn't match!\n"); | 65 | "doesn't match!\n"); |
| 66 | |||
| 67 | CHECK_VAL(bss->ret_bad_read, -EFAULT); | ||
| 68 | CHECK_VAL(data->payload_bad[0], 0x42); | ||
| 69 | CHECK_VAL(data->payload_bad[1], 0x42); | ||
| 70 | CHECK_VAL(data->payload_bad[2], 0); | ||
| 71 | CHECK_VAL(data->payload_bad[3], 0x42); | ||
| 72 | CHECK_VAL(data->payload_bad[4], 0x42); | ||
| 66 | cleanup: | 73 | cleanup: |
| 67 | test_varlen__destroy(skel); | 74 | test_varlen__destroy(skel); |
| 68 | } | 75 | } |
| @@ -19,6 +19,7 @@ __u64 payload1_len1 = 0; · 18 unmodified lines | |||
| 19 | __u64 payload1_len2 = 0; | 19 | __u64 payload1_len2 = 0; |
| 20 | __u64 total1 = 0; | 20 | __u64 total1 = 0; |
| 21 | char payload1[MAX_LEN + MAX_LEN] = {}; | 21 | char payload1[MAX_LEN + MAX_LEN] = {}; |
| 22 | __u64 ret_bad_read = 0; | ||
| 22 | 23 | ||
| 23 | /* .data */ | 24 | /* .data */ |
| 24 | int payload2_len1 = -1; | 25 | int payload2_len1 = -1; |
| @@ -36,6 +37,8 @@ int payload4_len2 = -1; · 11 unmodified lines | |||
| 36 | int total4= -1; | 37 | int total4= -1; |
| 37 | char payload4[MAX_LEN + MAX_LEN] = { 1 }; | 38 | char payload4[MAX_LEN + MAX_LEN] = { 1 }; |
| 38 | 39 | ||
| 40 | char payload_bad[5] = { 0x42, 0x42, 0x42, 0x42, 0x42 }; | ||
| 41 | |||
| 39 | SEC("raw_tp/sys_enter") | 42 | SEC("raw_tp/sys_enter") |
| 40 | int handler64_unsigned(void *regs) | 43 | int handler64_unsigned(void *regs) |
| 41 | { | 44 | { |
| @@ -61,6 +64,8 @@ int handler64_unsigned(void *regs) · 19 unmodified lines | |||
| 61 | 64 | ||
| 62 | total1 = payload - (void *)payload1; | 65 | total1 = payload - (void *)payload1; |
| 63 | 66 | ||
| 67 | ret_bad_read = bpf_probe_read_kernel_str(payload_bad + 2, 1, (void *) -1); | ||
| 68 | |||
| 64 | return 0; | 69 | return 0; |
| 65 | } | 70 | } |
| 66 | 71 | ||
| @@ -1010,7 +1010,7 @@ static inline const char *str_msg(const struct msg *msg, char *buf) · 1009 unmodified lines | |||
| 1010 | msg->subtest_done.have_log); | 1010 | msg->subtest_done.have_log); |
| 1011 | break; | 1011 | break; |
| 1012 | case MSG_TEST_LOG: | 1012 | case MSG_TEST_LOG: |
| 1013 | sprintf(buf, "MSG_TEST_LOG (cnt: %ld, last: %d)", | 1013 | sprintf(buf, "MSG_TEST_LOG (cnt: %zu, last: %d)", |
| 1014 | strlen(msg->test_log.log_buf), | 1014 | strlen(msg->test_log.log_buf), |
| 1015 | msg->test_log.is_last); | 1015 | msg->test_log.is_last); |
| 1016 | break; | 1016 | break; |
| @@ -1260,7 +1260,7 @@ static int get_xlated_program(int fd_prog, struct bpf_insn **buf, int *cnt) · 1259 unmodified lines | |||
| 1260 | 1260 | ||
| 1261 | bzero(&info, sizeof(info)); | 1261 | bzero(&info, sizeof(info)); |
| 1262 | info.xlated_prog_len = xlated_prog_len; | 1262 | info.xlated_prog_len = xlated_prog_len; |
| 1263 | info.xlated_prog_insns = (__u64)*buf; | 1263 | info.xlated_prog_insns = (__u64)(unsigned long)*buf; |
| 1264 | if (bpf_obj_get_info_by_fd(fd_prog, &info, &info_len)) { | 1264 | if (bpf_obj_get_info_by_fd(fd_prog, &info, &info_len)) { |
| 1265 | perror("second bpf_obj_get_info_by_fd failed"); | 1265 | perror("second bpf_obj_get_info_by_fd failed"); |
| 1266 | goto out_free_buf; | 1266 | goto out_free_buf; |