From: Sasha Levin Date: Mon, 2 May 2022 04:06:25 +0000 (-0400) Subject: Fixes for 5.4 X-Git-Tag: v5.4.192~47 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f43cd81c8942d410ad658c8b8a6db360d1fed049;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 5.4 Signed-off-by: Sasha Levin --- diff --git a/queue-5.4/arm-dts-am3517-evm-fix-misc-pinmuxing.patch b/queue-5.4/arm-dts-am3517-evm-fix-misc-pinmuxing.patch new file mode 100644 index 00000000000..98a0f5a9fa3 --- /dev/null +++ b/queue-5.4/arm-dts-am3517-evm-fix-misc-pinmuxing.patch @@ -0,0 +1,153 @@ +From 6e5e8c2fabbbaef369b2afd8662501e8f969fa82 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 26 Feb 2022 15:48:19 -0600 +Subject: ARM: dts: am3517-evm: Fix misc pinmuxing + +From: Adam Ford + +[ Upstream commit 942da3af32b2288e674736eb159d1fc676261691 ] + +The bootloader for the AM3517 has previously done much of the pin +muxing, but as the bootloader is moving more and more to a model +based on the device tree, it may no longer automatically mux the +pins, so it is necessary to add the pinmuxing to the Linux device +trees so the respective peripherals can remain functional. + +Fixes: 6ed1d7997561 ("ARM: dts: am3517-evm: Add support for UI board and Audio") +Signed-off-by: Adam Ford +Message-Id: <20220226214820.747847-1-aford173@gmail.com> +Signed-off-by: Tony Lindgren +Signed-off-by: Sasha Levin +--- + arch/arm/boot/dts/am3517-evm.dts | 45 +++++++++++++++++++++++++++---- + arch/arm/boot/dts/am3517-som.dtsi | 9 +++++++ + 2 files changed, 49 insertions(+), 5 deletions(-) + +diff --git a/arch/arm/boot/dts/am3517-evm.dts b/arch/arm/boot/dts/am3517-evm.dts +index a1fd3e63e86e..3db30ce134b9 100644 +--- a/arch/arm/boot/dts/am3517-evm.dts ++++ b/arch/arm/boot/dts/am3517-evm.dts +@@ -160,6 +160,8 @@ pwm11: dmtimer-pwm@11 { + + /* HS USB Host PHY on PORT 1 */ + hsusb1_phy: hsusb1_phy { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&hsusb1_rst_pins>; + compatible = "usb-nop-xceiv"; + reset-gpios = <&gpio2 25 GPIO_ACTIVE_LOW>; /* gpio_57 */ + #phy-cells = <0>; +@@ -167,7 +169,9 @@ hsusb1_phy: hsusb1_phy { + }; + + &davinci_emac { +- status = "okay"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <ðernet_pins>; ++ status = "okay"; + }; + + &davinci_mdio { +@@ -192,6 +196,8 @@ dpi_out: endpoint { + }; + + &i2c2 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2c2_pins>; + clock-frequency = <400000>; + /* User DIP swithes [1:8] / User LEDS [1:2] */ + tca6416: gpio@21 { +@@ -204,6 +210,8 @@ tca6416: gpio@21 { + }; + + &i2c3 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2c3_pins>; + clock-frequency = <400000>; + }; + +@@ -222,6 +230,8 @@ &mmc3 { + }; + + &usbhshost { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&hsusb1_pins>; + port1-mode = "ehci-phy"; + }; + +@@ -230,8 +240,35 @@ &usbhsehci { + }; + + &omap3_pmx_core { +- pinctrl-names = "default"; +- pinctrl-0 = <&hsusb1_rst_pins>; ++ ++ ethernet_pins: pinmux_ethernet_pins { ++ pinctrl-single,pins = < ++ OMAP3_CORE1_IOPAD(0x21fe, PIN_INPUT | MUX_MODE0) /* rmii_mdio_data */ ++ OMAP3_CORE1_IOPAD(0x2200, MUX_MODE0) /* rmii_mdio_clk */ ++ OMAP3_CORE1_IOPAD(0x2202, PIN_INPUT_PULLDOWN | MUX_MODE0) /* rmii_rxd0 */ ++ OMAP3_CORE1_IOPAD(0x2204, PIN_INPUT_PULLDOWN | MUX_MODE0) /* rmii_rxd1 */ ++ OMAP3_CORE1_IOPAD(0x2206, PIN_INPUT_PULLDOWN | MUX_MODE0) /* rmii_crs_dv */ ++ OMAP3_CORE1_IOPAD(0x2208, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* rmii_rxer */ ++ OMAP3_CORE1_IOPAD(0x220a, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* rmii_txd0 */ ++ OMAP3_CORE1_IOPAD(0x220c, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* rmii_txd1 */ ++ OMAP3_CORE1_IOPAD(0x220e, PIN_OUTPUT_PULLDOWN |MUX_MODE0) /* rmii_txen */ ++ OMAP3_CORE1_IOPAD(0x2210, PIN_INPUT_PULLDOWN | MUX_MODE0) /* rmii_50mhz_clk */ ++ >; ++ }; ++ ++ i2c2_pins: pinmux_i2c2_pins { ++ pinctrl-single,pins = < ++ OMAP3_CORE1_IOPAD(0x21be, PIN_INPUT_PULLUP | MUX_MODE0) /* i2c2_scl */ ++ OMAP3_CORE1_IOPAD(0x21c0, PIN_INPUT_PULLUP | MUX_MODE0) /* i2c2_sda */ ++ >; ++ }; ++ ++ i2c3_pins: pinmux_i2c3_pins { ++ pinctrl-single,pins = < ++ OMAP3_CORE1_IOPAD(0x21c2, PIN_INPUT_PULLUP | MUX_MODE0) /* i2c3_scl */ ++ OMAP3_CORE1_IOPAD(0x21c4, PIN_INPUT_PULLUP | MUX_MODE0) /* i2c3_sda */ ++ >; ++ }; + + leds_pins: pinmux_leds_pins { + pinctrl-single,pins = < +@@ -299,8 +336,6 @@ OMAP3_CORE1_IOPAD(0x20ba, PIN_OUTPUT | MUX_MODE4) /* gpmc_ncs6.gpio_57 */ + }; + + &omap3_pmx_core2 { +- pinctrl-names = "default"; +- pinctrl-0 = <&hsusb1_pins>; + + hsusb1_pins: pinmux_hsusb1_pins { + pinctrl-single,pins = < +diff --git a/arch/arm/boot/dts/am3517-som.dtsi b/arch/arm/boot/dts/am3517-som.dtsi +index 8b669e2eafec..f7b680f6c48a 100644 +--- a/arch/arm/boot/dts/am3517-som.dtsi ++++ b/arch/arm/boot/dts/am3517-som.dtsi +@@ -69,6 +69,8 @@ nand@0,0 { + }; + + &i2c1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2c1_pins>; + clock-frequency = <400000>; + + s35390a: s35390a@30 { +@@ -179,6 +181,13 @@ bluetooth { + + &omap3_pmx_core { + ++ i2c1_pins: pinmux_i2c1_pins { ++ pinctrl-single,pins = < ++ OMAP3_CORE1_IOPAD(0x21ba, PIN_INPUT_PULLUP | MUX_MODE0) /* i2c1_scl */ ++ OMAP3_CORE1_IOPAD(0x21bc, PIN_INPUT_PULLUP | MUX_MODE0) /* i2c1_sda */ ++ >; ++ }; ++ + wl12xx_buffer_pins: pinmux_wl12xx_buffer_pins { + pinctrl-single,pins = < + OMAP3_CORE1_IOPAD(0x2156, PIN_OUTPUT | MUX_MODE4) /* mmc1_dat7.gpio_129 */ +-- +2.35.1 + diff --git a/queue-5.4/arm-dts-at91-map-mclk-for-wm8731-on-at91sam9g20ek.patch b/queue-5.4/arm-dts-at91-map-mclk-for-wm8731-on-at91sam9g20ek.patch new file mode 100644 index 00000000000..b8c171de267 --- /dev/null +++ b/queue-5.4/arm-dts-at91-map-mclk-for-wm8731-on-at91sam9g20ek.patch @@ -0,0 +1,45 @@ +From bdd5ac2f7f1774d1c7b0318273edb5e4d2de9bad Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 4 Apr 2022 11:28:05 +0100 +Subject: ARM: dts: at91: Map MCLK for wm8731 on at91sam9g20ek + +From: Mark Brown + +[ Upstream commit 0e486fe341fabd8e583f3d601a874cd394979c45 ] + +The MCLK of the WM8731 on the AT91SAM9G20-EK board is connected to the +PCK0 output of the SoC and is expected to be set to 12MHz. Previously +this was mapped using pre-common clock API calls in the audio machine +driver but the conversion to the common clock framework broke that so +describe things in the DT instead. + +Fixes: ff78a189b0ae55f ("ARM: at91: remove old at91-specific clock driver") +Signed-off-by: Mark Brown +Reviewed-by: Claudiu Beznea +Signed-off-by: Nicolas Ferre +Link: https://lore.kernel.org/r/20220404102806.581374-2-broonie@kernel.org +Signed-off-by: Sasha Levin +--- + arch/arm/boot/dts/at91sam9g20ek_common.dtsi | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/arch/arm/boot/dts/at91sam9g20ek_common.dtsi b/arch/arm/boot/dts/at91sam9g20ek_common.dtsi +index bda22700110c..287566e09a67 100644 +--- a/arch/arm/boot/dts/at91sam9g20ek_common.dtsi ++++ b/arch/arm/boot/dts/at91sam9g20ek_common.dtsi +@@ -217,6 +217,12 @@ i2c-gpio-0 { + wm8731: wm8731@1b { + compatible = "wm8731"; + reg = <0x1b>; ++ ++ /* PCK0 at 12MHz */ ++ clocks = <&pmc PMC_TYPE_SYSTEM 8>; ++ clock-names = "mclk"; ++ assigned-clocks = <&pmc PMC_TYPE_SYSTEM 8>; ++ assigned-clock-rates = <12000000>; + }; + }; + +-- +2.35.1 + diff --git a/queue-5.4/arm-dts-fix-mmc-order-for-omap3-gta04.patch b/queue-5.4/arm-dts-fix-mmc-order-for-omap3-gta04.patch new file mode 100644 index 00000000000..0b306a8be62 --- /dev/null +++ b/queue-5.4/arm-dts-fix-mmc-order-for-omap3-gta04.patch @@ -0,0 +1,38 @@ +From ce83b3fb63e5094ec3afb182647c26399cb64546 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 8 Mar 2022 14:00:20 +0100 +Subject: ARM: dts: Fix mmc order for omap3-gta04 + +From: H. Nikolaus Schaller + +[ Upstream commit 09269dd050094593fc747f2a5853d189fefcb6b5 ] + +Commit a1ebdb374199 ("ARM: dts: Fix swapped mmc order for omap3") +introduces general mmc aliases. Let's tailor them to the need +of the GTA04 board which does not make use of mmc2 and mmc3 interfaces. + +Fixes: a1ebdb374199 ("ARM: dts: Fix swapped mmc order for omap3") +Signed-off-by: H. Nikolaus Schaller +Message-Id: +Signed-off-by: Tony Lindgren +Signed-off-by: Sasha Levin +--- + arch/arm/boot/dts/omap3-gta04.dtsi | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/arch/arm/boot/dts/omap3-gta04.dtsi b/arch/arm/boot/dts/omap3-gta04.dtsi +index 186b2af7743e..089e9f1f442b 100644 +--- a/arch/arm/boot/dts/omap3-gta04.dtsi ++++ b/arch/arm/boot/dts/omap3-gta04.dtsi +@@ -31,6 +31,8 @@ chosen { + aliases { + display0 = &lcd; + display1 = &tv0; ++ /delete-property/ mmc2; ++ /delete-property/ mmc3; + }; + + ldo_3v3: fixedregulator { +-- +2.35.1 + diff --git a/queue-5.4/arm-dts-imx6qdl-apalis-fix-sgtl5000-detection-issue.patch b/queue-5.4/arm-dts-imx6qdl-apalis-fix-sgtl5000-detection-issue.patch new file mode 100644 index 00000000000..4b19d2035f4 --- /dev/null +++ b/queue-5.4/arm-dts-imx6qdl-apalis-fix-sgtl5000-detection-issue.patch @@ -0,0 +1,71 @@ +From b6873fe2a40328f747e0a1fa921ec08f04d1936c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 26 Mar 2022 12:14:55 -0300 +Subject: ARM: dts: imx6qdl-apalis: Fix sgtl5000 detection issue + +From: Fabio Estevam + +[ Upstream commit fa51e1dc4b91375bc18349663a52395ad585bd3c ] + +On a custom carrier board with a i.MX6Q Apalis SoM, the sgtl5000 codec +on the SoM is often not detected and the following error message is +seen when the sgtl5000 driver tries to read the ID register: + +sgtl5000 1-000a: Error reading chip id -6 + +The reason for the error is that the MCLK clock is not provided +early enough. + +Fix the problem by describing the MCLK pinctrl inside the codec +node instead of placing it inside the audmux pinctrl group. + +With this change applied the sgtl5000 is always detected on every boot. + +Fixes: 693e3ffaae5a ("ARM: dts: imx6: Add support for Toradex Apalis iMX6Q/D SoM") +Signed-off-by: Fabio Estevam +Reviewed-by: Tim Harvey +Acked-by: Max Krummenacher +Signed-off-by: Shawn Guo +Signed-off-by: Sasha Levin +--- + arch/arm/boot/dts/imx6qdl-apalis.dtsi | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/arch/arm/boot/dts/imx6qdl-apalis.dtsi b/arch/arm/boot/dts/imx6qdl-apalis.dtsi +index 7c4ad541c3f5..b165bd6ea53b 100644 +--- a/arch/arm/boot/dts/imx6qdl-apalis.dtsi ++++ b/arch/arm/boot/dts/imx6qdl-apalis.dtsi +@@ -314,6 +314,8 @@ vgen6_reg: vgen6 { + codec: sgtl5000@a { + compatible = "fsl,sgtl5000"; + reg = <0x0a>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pinctrl_sgtl5000>; + clocks = <&clks IMX6QDL_CLK_CKO>; + VDDA-supply = <®_module_3v3_audio>; + VDDIO-supply = <®_module_3v3>; +@@ -543,8 +545,6 @@ MX6QDL_PAD_DISP0_DAT20__AUD4_TXC 0x130b0 + MX6QDL_PAD_DISP0_DAT21__AUD4_TXD 0x130b0 + MX6QDL_PAD_DISP0_DAT22__AUD4_TXFS 0x130b0 + MX6QDL_PAD_DISP0_DAT23__AUD4_RXD 0x130b0 +- /* SGTL5000 sys_mclk */ +- MX6QDL_PAD_GPIO_5__CCM_CLKO1 0x130b0 + >; + }; + +@@ -810,6 +810,12 @@ MX6QDL_PAD_NANDF_CS1__GPIO6_IO14 0x000b0 + >; + }; + ++ pinctrl_sgtl5000: sgtl5000grp { ++ fsl,pins = < ++ MX6QDL_PAD_GPIO_5__CCM_CLKO1 0x130b0 ++ >; ++ }; ++ + pinctrl_spdif: spdifgrp { + fsl,pins = < + MX6QDL_PAD_GPIO_16__SPDIF_IN 0x1b0b0 +-- +2.35.1 + diff --git a/queue-5.4/arm-dts-imx6ull-colibri-fix-vqmmc-regulator.patch b/queue-5.4/arm-dts-imx6ull-colibri-fix-vqmmc-regulator.patch new file mode 100644 index 00000000000..c09c305a2d2 --- /dev/null +++ b/queue-5.4/arm-dts-imx6ull-colibri-fix-vqmmc-regulator.patch @@ -0,0 +1,39 @@ +From 5e3c4c7630fca4cb8275ccea7b171a0a37849053 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 14 Apr 2022 10:50:54 +0200 +Subject: ARM: dts: imx6ull-colibri: fix vqmmc regulator + +From: Max Krummenacher + +[ Upstream commit 45974e4276a8d6653394f66666fc57d8ffa6de9a ] + +The correct spelling for the property is gpios. Otherwise, the regulator +will neither reserve nor control any GPIOs. Thus, any SD/MMC card which +can use UHS-I modes will fail. + +Fixes: c2e4987e0e02 ("ARM: dts: imx6ull: add Toradex Colibri iMX6ULL support") +Signed-off-by: Max Krummenacher +Signed-off-by: Denys Drozdov +Signed-off-by: Marcel Ziswiler +Signed-off-by: Shawn Guo +Signed-off-by: Sasha Levin +--- + arch/arm/boot/dts/imx6ull-colibri.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm/boot/dts/imx6ull-colibri.dtsi b/arch/arm/boot/dts/imx6ull-colibri.dtsi +index d56728f03c35..c83323b9ea53 100644 +--- a/arch/arm/boot/dts/imx6ull-colibri.dtsi ++++ b/arch/arm/boot/dts/imx6ull-colibri.dtsi +@@ -37,7 +37,7 @@ reg_module_3v3_avdd: regulator-module-3v3-avdd { + + reg_sd1_vmmc: regulator-sd1-vmmc { + compatible = "regulator-gpio"; +- gpio = <&gpio5 9 GPIO_ACTIVE_HIGH>; ++ gpios = <&gpio5 9 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_snvs_reg_sd>; + regulator-always-on; +-- +2.35.1 + diff --git a/queue-5.4/arm-dts-logicpd-som-lv-fix-wrong-pinmuxing-on-omap35.patch b/queue-5.4/arm-dts-logicpd-som-lv-fix-wrong-pinmuxing-on-omap35.patch new file mode 100644 index 00000000000..4a98a872f39 --- /dev/null +++ b/queue-5.4/arm-dts-logicpd-som-lv-fix-wrong-pinmuxing-on-omap35.patch @@ -0,0 +1,104 @@ +From 38d29f1ec9a87ded7e866c351bf93f416884aa70 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 3 Mar 2022 11:18:17 -0600 +Subject: ARM: dts: logicpd-som-lv: Fix wrong pinmuxing on OMAP35 + +From: Adam Ford + +[ Upstream commit 46ff3df87215ff42c0cd2c4bdb7d74540384a69c ] + +The pinout of the OMAP35 and DM37 variants of the SOM-LV are the +same, but the macros which define the pinmuxing are different +between OMAP3530 and DM3730. The pinmuxing was correct for +for the DM3730, but wrong for the OMAP3530. Since the boot loader +was correctly pin-muxing the pins, this was not obvious. As the +bootloader not guaranteed to pinmux all the pins any more, this +causes an issue, so the pinmux needs to be moved from a common +file to their respective board files. + +Fixes: f8a2e3ff7103 ("ARM: dts: Add minimal support for LogicPD OMAP35xx SOM-LV devkit") +Signed-off-by: Adam Ford +Message-Id: <20220303171818.11060-1-aford173@gmail.com> +Signed-off-by: Tony Lindgren +Signed-off-by: Sasha Levin +--- + arch/arm/boot/dts/logicpd-som-lv-35xx-devkit.dts | 15 +++++++++++++++ + arch/arm/boot/dts/logicpd-som-lv-37xx-devkit.dts | 15 +++++++++++++++ + arch/arm/boot/dts/logicpd-som-lv.dtsi | 15 --------------- + 3 files changed, 30 insertions(+), 15 deletions(-) + +diff --git a/arch/arm/boot/dts/logicpd-som-lv-35xx-devkit.dts b/arch/arm/boot/dts/logicpd-som-lv-35xx-devkit.dts +index f7a841a28865..270e4986b6e6 100644 +--- a/arch/arm/boot/dts/logicpd-som-lv-35xx-devkit.dts ++++ b/arch/arm/boot/dts/logicpd-som-lv-35xx-devkit.dts +@@ -11,3 +11,18 @@ / { + model = "LogicPD Zoom OMAP35xx SOM-LV Development Kit"; + compatible = "logicpd,dm3730-som-lv-devkit", "ti,omap3"; + }; ++ ++&omap3_pmx_core2 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&hsusb2_2_pins>; ++ hsusb2_2_pins: pinmux_hsusb2_2_pins { ++ pinctrl-single,pins = < ++ OMAP3430_CORE2_IOPAD(0x25f0, PIN_OUTPUT | MUX_MODE3) /* etk_d10.hsusb2_clk */ ++ OMAP3430_CORE2_IOPAD(0x25f2, PIN_OUTPUT | MUX_MODE3) /* etk_d11.hsusb2_stp */ ++ OMAP3430_CORE2_IOPAD(0x25f4, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d12.hsusb2_dir */ ++ OMAP3430_CORE2_IOPAD(0x25f6, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d13.hsusb2_nxt */ ++ OMAP3430_CORE2_IOPAD(0x25f8, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d14.hsusb2_data0 */ ++ OMAP3430_CORE2_IOPAD(0x25fa, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d15.hsusb2_data1 */ ++ >; ++ }; ++}; +diff --git a/arch/arm/boot/dts/logicpd-som-lv-37xx-devkit.dts b/arch/arm/boot/dts/logicpd-som-lv-37xx-devkit.dts +index a604d92221a4..c757f0d7781c 100644 +--- a/arch/arm/boot/dts/logicpd-som-lv-37xx-devkit.dts ++++ b/arch/arm/boot/dts/logicpd-som-lv-37xx-devkit.dts +@@ -11,3 +11,18 @@ / { + model = "LogicPD Zoom DM3730 SOM-LV Development Kit"; + compatible = "logicpd,dm3730-som-lv-devkit", "ti,omap3630", "ti,omap3"; + }; ++ ++&omap3_pmx_core2 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&hsusb2_2_pins>; ++ hsusb2_2_pins: pinmux_hsusb2_2_pins { ++ pinctrl-single,pins = < ++ OMAP3630_CORE2_IOPAD(0x25f0, PIN_OUTPUT | MUX_MODE3) /* etk_d10.hsusb2_clk */ ++ OMAP3630_CORE2_IOPAD(0x25f2, PIN_OUTPUT | MUX_MODE3) /* etk_d11.hsusb2_stp */ ++ OMAP3630_CORE2_IOPAD(0x25f4, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d12.hsusb2_dir */ ++ OMAP3630_CORE2_IOPAD(0x25f6, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d13.hsusb2_nxt */ ++ OMAP3630_CORE2_IOPAD(0x25f8, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d14.hsusb2_data0 */ ++ OMAP3630_CORE2_IOPAD(0x25fa, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d15.hsusb2_data1 */ ++ >; ++ }; ++}; +diff --git a/arch/arm/boot/dts/logicpd-som-lv.dtsi b/arch/arm/boot/dts/logicpd-som-lv.dtsi +index b56524cc7fe2..55b619c99e24 100644 +--- a/arch/arm/boot/dts/logicpd-som-lv.dtsi ++++ b/arch/arm/boot/dts/logicpd-som-lv.dtsi +@@ -265,21 +265,6 @@ OMAP3_WKUP_IOPAD(0x2a0c, PIN_OUTPUT | MUX_MODE4) /* sys_boot1.gpio_3 */ + }; + }; + +-&omap3_pmx_core2 { +- pinctrl-names = "default"; +- pinctrl-0 = <&hsusb2_2_pins>; +- hsusb2_2_pins: pinmux_hsusb2_2_pins { +- pinctrl-single,pins = < +- OMAP3630_CORE2_IOPAD(0x25f0, PIN_OUTPUT | MUX_MODE3) /* etk_d10.hsusb2_clk */ +- OMAP3630_CORE2_IOPAD(0x25f2, PIN_OUTPUT | MUX_MODE3) /* etk_d11.hsusb2_stp */ +- OMAP3630_CORE2_IOPAD(0x25f4, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d12.hsusb2_dir */ +- OMAP3630_CORE2_IOPAD(0x25f6, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d13.hsusb2_nxt */ +- OMAP3630_CORE2_IOPAD(0x25f8, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d14.hsusb2_data0 */ +- OMAP3630_CORE2_IOPAD(0x25fa, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d15.hsusb2_data1 */ +- >; +- }; +-}; +- + &uart2 { + interrupts-extended = <&intc 73 &omap3_pmx_core OMAP3_UART2_RX>; + pinctrl-names = "default"; +-- +2.35.1 + diff --git a/queue-5.4/arm-omap2-fix-refcount-leak-in-omap_gic_of_init.patch b/queue-5.4/arm-omap2-fix-refcount-leak-in-omap_gic_of_init.patch new file mode 100644 index 00000000000..615731973b2 --- /dev/null +++ b/queue-5.4/arm-omap2-fix-refcount-leak-in-omap_gic_of_init.patch @@ -0,0 +1,42 @@ +From dd6ef3043d34c706ae610568c0770843c4c6f89d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 9 Mar 2022 10:43:01 +0000 +Subject: ARM: OMAP2+: Fix refcount leak in omap_gic_of_init + +From: Miaoqian Lin + +[ Upstream commit 0f83e6b4161617014017a694888dd8743f46f071 ] + +The of_find_compatible_node() function returns a node pointer with +refcount incremented, We should use of_node_put() on it when done +Add the missing of_node_put() to release the refcount. + +Fixes: fd1c07861491 ("ARM: OMAP4: Fix the init code to have OMAP4460 errata available in DT build") +Signed-off-by: Miaoqian Lin +Message-Id: <20220309104302.18398-1-linmq006@gmail.com> +Signed-off-by: Tony Lindgren +Signed-off-by: Sasha Levin +--- + arch/arm/mach-omap2/omap4-common.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-omap2/omap4-common.c +index 5c3845730dbf..0b80f8bcd304 100644 +--- a/arch/arm/mach-omap2/omap4-common.c ++++ b/arch/arm/mach-omap2/omap4-common.c +@@ -314,10 +314,12 @@ void __init omap_gic_of_init(void) + + np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-gic"); + gic_dist_base_addr = of_iomap(np, 0); ++ of_node_put(np); + WARN_ON(!gic_dist_base_addr); + + np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-twd-timer"); + twd_base = of_iomap(np, 0); ++ of_node_put(np); + WARN_ON(!twd_base); + + skip_errata_init: +-- +2.35.1 + diff --git a/queue-5.4/arm64-dts-imx8mn-ddr4-evk-describe-the-32.768-khz-pm.patch b/queue-5.4/arm64-dts-imx8mn-ddr4-evk-describe-the-32.768-khz-pm.patch new file mode 100644 index 00000000000..af02f7cab4c --- /dev/null +++ b/queue-5.4/arm64-dts-imx8mn-ddr4-evk-describe-the-32.768-khz-pm.patch @@ -0,0 +1,45 @@ +From 7465a06c0a4d0a5e479c1d0c599577242385457b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 18 Apr 2022 14:47:31 -0300 +Subject: arm64: dts: imx8mn-ddr4-evk: Describe the 32.768 kHz PMIC clock + +From: Fabio Estevam + +[ Upstream commit 0310b5aa0656a94102344f1e9ae2892e342a665d ] + +The ROHM BD71847 PMIC has a 32.768 kHz clock. + +Describe the PMIC clock to fix the following boot errors: + +bd718xx-clk bd71847-clk.1.auto: No parent clk found +bd718xx-clk: probe of bd71847-clk.1.auto failed with error -22 + +Based on the same fix done for imx8mm-evk as per commit +a6a355ede574 ("arm64: dts: imx8mm-evk: Add 32.768 kHz clock to PMIC") + +Fixes: 3e44dd09736d ("arm64: dts: imx8mn-ddr4-evk: Add rohm,bd71847 PMIC support") +Signed-off-by: Fabio Estevam +Signed-off-by: Shawn Guo +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/freescale/imx8mn-ddr4-evk.dts | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/arch/arm64/boot/dts/freescale/imx8mn-ddr4-evk.dts b/arch/arm64/boot/dts/freescale/imx8mn-ddr4-evk.dts +index 9ad1d43b8ce7..4fa39654b695 100644 +--- a/arch/arm64/boot/dts/freescale/imx8mn-ddr4-evk.dts ++++ b/arch/arm64/boot/dts/freescale/imx8mn-ddr4-evk.dts +@@ -213,6 +213,10 @@ pmic@4b { + interrupts = <3 GPIO_ACTIVE_LOW>; + rohm,reset-snvs-powered; + ++ #clock-cells = <0>; ++ clocks = <&osc_32k 0>; ++ clock-output-names = "clk-32k-out"; ++ + regulators { + buck1_reg: BUCK1 { + regulator-name = "BUCK1"; +-- +2.35.1 + diff --git a/queue-5.4/arm64-dts-meson-remove-cpu-opps-below-1ghz-for-g12b-.patch b/queue-5.4/arm64-dts-meson-remove-cpu-opps-below-1ghz-for-g12b-.patch new file mode 100644 index 00000000000..572be62356c --- /dev/null +++ b/queue-5.4/arm64-dts-meson-remove-cpu-opps-below-1ghz-for-g12b-.patch @@ -0,0 +1,146 @@ +From bf9d856ff9ecbe1632b61792df2643e5cdf7e2b4 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 10 Feb 2022 10:06:37 +0000 +Subject: arm64: dts: meson: remove CPU opps below 1GHz for G12B boards + +From: Christian Hewitt + +[ Upstream commit 6c4d636bc00dc17c63ffb2a73a0da850240e26e3 ] + +Amlogic G12B devices experience CPU stalls and random board wedges when +the system idles and CPU cores clock down to lower opp points. Recent +vendor kernels include a change to remove 100-250MHz and other distro +sources also remove the 500/667MHz points. Unless all 100-667Mhz opps +are removed or the CPU governor forced to performance stalls are still +observed, so let's remove them to improve stability and uptime. + +Fixes: b96d4e92709b ("arm64: dts: meson-g12b: support a311d and s922x cpu operating points") +Signed-off-by: Christian Hewitt +Reviewed-by: Neil Armstrong +Signed-off-by: Neil Armstrong +Link: https://lore.kernel.org/r/20220210100638.19130-2-christianshewitt@gmail.com +Signed-off-by: Sasha Levin +--- + .../boot/dts/amlogic/meson-g12b-a311d.dtsi | 40 ------------------- + .../boot/dts/amlogic/meson-g12b-s922x.dtsi | 40 ------------------- + 2 files changed, 80 deletions(-) + +diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-a311d.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b-a311d.dtsi +index d61f43052a34..8e9ad1e51d66 100644 +--- a/arch/arm64/boot/dts/amlogic/meson-g12b-a311d.dtsi ++++ b/arch/arm64/boot/dts/amlogic/meson-g12b-a311d.dtsi +@@ -11,26 +11,6 @@ cpu_opp_table_0: opp-table-0 { + compatible = "operating-points-v2"; + opp-shared; + +- opp-100000000 { +- opp-hz = /bits/ 64 <100000000>; +- opp-microvolt = <731000>; +- }; +- +- opp-250000000 { +- opp-hz = /bits/ 64 <250000000>; +- opp-microvolt = <731000>; +- }; +- +- opp-500000000 { +- opp-hz = /bits/ 64 <500000000>; +- opp-microvolt = <731000>; +- }; +- +- opp-667000000 { +- opp-hz = /bits/ 64 <667000000>; +- opp-microvolt = <731000>; +- }; +- + opp-1000000000 { + opp-hz = /bits/ 64 <1000000000>; + opp-microvolt = <761000>; +@@ -71,26 +51,6 @@ cpub_opp_table_1: opp-table-1 { + compatible = "operating-points-v2"; + opp-shared; + +- opp-100000000 { +- opp-hz = /bits/ 64 <100000000>; +- opp-microvolt = <731000>; +- }; +- +- opp-250000000 { +- opp-hz = /bits/ 64 <250000000>; +- opp-microvolt = <731000>; +- }; +- +- opp-500000000 { +- opp-hz = /bits/ 64 <500000000>; +- opp-microvolt = <731000>; +- }; +- +- opp-667000000 { +- opp-hz = /bits/ 64 <667000000>; +- opp-microvolt = <731000>; +- }; +- + opp-1000000000 { + opp-hz = /bits/ 64 <1000000000>; + opp-microvolt = <731000>; +diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-s922x.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b-s922x.dtsi +index 046cc332d07f..f2543da63c39 100644 +--- a/arch/arm64/boot/dts/amlogic/meson-g12b-s922x.dtsi ++++ b/arch/arm64/boot/dts/amlogic/meson-g12b-s922x.dtsi +@@ -11,26 +11,6 @@ cpu_opp_table_0: opp-table-0 { + compatible = "operating-points-v2"; + opp-shared; + +- opp-100000000 { +- opp-hz = /bits/ 64 <100000000>; +- opp-microvolt = <731000>; +- }; +- +- opp-250000000 { +- opp-hz = /bits/ 64 <250000000>; +- opp-microvolt = <731000>; +- }; +- +- opp-500000000 { +- opp-hz = /bits/ 64 <500000000>; +- opp-microvolt = <731000>; +- }; +- +- opp-667000000 { +- opp-hz = /bits/ 64 <667000000>; +- opp-microvolt = <731000>; +- }; +- + opp-1000000000 { + opp-hz = /bits/ 64 <1000000000>; + opp-microvolt = <731000>; +@@ -71,26 +51,6 @@ cpub_opp_table_1: opp-table-1 { + compatible = "operating-points-v2"; + opp-shared; + +- opp-100000000 { +- opp-hz = /bits/ 64 <100000000>; +- opp-microvolt = <751000>; +- }; +- +- opp-250000000 { +- opp-hz = /bits/ 64 <250000000>; +- opp-microvolt = <751000>; +- }; +- +- opp-500000000 { +- opp-hz = /bits/ 64 <500000000>; +- opp-microvolt = <751000>; +- }; +- +- opp-667000000 { +- opp-hz = /bits/ 64 <667000000>; +- opp-microvolt = <751000>; +- }; +- + opp-1000000000 { + opp-hz = /bits/ 64 <1000000000>; + opp-microvolt = <771000>; +-- +2.35.1 + diff --git a/queue-5.4/arm64-dts-meson-remove-cpu-opps-below-1ghz-for-sm1-b.patch b/queue-5.4/arm64-dts-meson-remove-cpu-opps-below-1ghz-for-sm1-b.patch new file mode 100644 index 00000000000..dd0cfa45863 --- /dev/null +++ b/queue-5.4/arm64-dts-meson-remove-cpu-opps-below-1ghz-for-sm1-b.patch @@ -0,0 +1,60 @@ +From dd949e2d203510c65c602f849f1035ee61e15865 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 10 Feb 2022 10:06:38 +0000 +Subject: arm64: dts: meson: remove CPU opps below 1GHz for SM1 boards + +From: Christian Hewitt + +[ Upstream commit fd86d85401c2049f652293877c0f7e6e5afc3bbc ] + +Amlogic SM1 devices experience CPU stalls and random board wedges when +the system idles and CPU cores clock down to lower opp points. Recent +vendor kernels include a change to remove 100-250MHz and other distro +sources also remove the 500/667MHz points. Unless all 100-667Mhz opps +are removed or the CPU governor forced to performance stalls are still +observed, so let's remove them to improve stability and uptime. + +Fixes: 3d9e76483049 ("arm64: dts: meson-sm1-sei610: enable DVFS") +Signed-off-by: Christian Hewitt +Reviewed-by: Neil Armstrong +Signed-off-by: Neil Armstrong +Link: https://lore.kernel.org/r/20220210100638.19130-3-christianshewitt@gmail.com +Signed-off-by: Sasha Levin +--- + arch/arm64/boot/dts/amlogic/meson-sm1.dtsi | 20 -------------------- + 1 file changed, 20 deletions(-) + +diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi b/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi +index 8ba3555ca369..dd62a608c805 100644 +--- a/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi ++++ b/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi +@@ -55,26 +55,6 @@ cpu_opp_table: opp-table { + compatible = "operating-points-v2"; + opp-shared; + +- opp-100000000 { +- opp-hz = /bits/ 64 <100000000>; +- opp-microvolt = <730000>; +- }; +- +- opp-250000000 { +- opp-hz = /bits/ 64 <250000000>; +- opp-microvolt = <730000>; +- }; +- +- opp-500000000 { +- opp-hz = /bits/ 64 <500000000>; +- opp-microvolt = <730000>; +- }; +- +- opp-667000000 { +- opp-hz = /bits/ 64 <666666666>; +- opp-microvolt = <750000>; +- }; +- + opp-1000000000 { + opp-hz = /bits/ 64 <1000000000>; + opp-microvolt = <770000>; +-- +2.35.1 + diff --git a/queue-5.4/asoc-wm8731-disable-the-regulator-when-probing-fails.patch b/queue-5.4/asoc-wm8731-disable-the-regulator-when-probing-fails.patch new file mode 100644 index 00000000000..6b15960180d --- /dev/null +++ b/queue-5.4/asoc-wm8731-disable-the-regulator-when-probing-fails.patch @@ -0,0 +1,90 @@ +From 86b51f388b94667a6947c050477a831c1bb36339 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 5 Apr 2022 20:10:38 +0800 +Subject: ASoC: wm8731: Disable the regulator when probing fails + +From: Zheyu Ma + +[ Upstream commit 92ccbf17eeacf510cf1eed9c252d9332ca24f02d ] + +When the driver fails during probing, the driver should disable the +regulator, not just handle it in wm8731_hw_init(). + +The following log reveals it: + +[ 17.812483] WARNING: CPU: 1 PID: 364 at drivers/regulator/core.c:2257 _regulator_put+0x3ec/0x4e0 +[ 17.815958] RIP: 0010:_regulator_put+0x3ec/0x4e0 +[ 17.824467] Call Trace: +[ 17.824774] +[ 17.825040] regulator_bulk_free+0x82/0xe0 +[ 17.825514] devres_release_group+0x319/0x3d0 +[ 17.825882] i2c_device_probe+0x766/0x940 +[ 17.829198] i2c_register_driver+0xb5/0x130 + +Signed-off-by: Zheyu Ma +Link: https://lore.kernel.org/r/20220405121038.4094051-1-zheyuma97@gmail.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/codecs/wm8731.c | 19 +++++++++++-------- + 1 file changed, 11 insertions(+), 8 deletions(-) + +diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c +index 6fd1bef848ed..fa55d79b39b6 100644 +--- a/sound/soc/codecs/wm8731.c ++++ b/sound/soc/codecs/wm8731.c +@@ -601,7 +601,7 @@ static int wm8731_hw_init(struct device *dev, struct wm8731_priv *wm8731) + ret = wm8731_reset(wm8731->regmap); + if (ret < 0) { + dev_err(dev, "Failed to issue reset: %d\n", ret); +- goto err_regulator_enable; ++ goto err; + } + + /* Clear POWEROFF, keep everything else disabled */ +@@ -618,10 +618,7 @@ static int wm8731_hw_init(struct device *dev, struct wm8731_priv *wm8731) + + regcache_mark_dirty(wm8731->regmap); + +-err_regulator_enable: +- /* Regulators will be enabled by bias management */ +- regulator_bulk_disable(ARRAY_SIZE(wm8731->supplies), wm8731->supplies); +- ++err: + return ret; + } + +@@ -765,21 +762,27 @@ static int wm8731_i2c_probe(struct i2c_client *i2c, + ret = PTR_ERR(wm8731->regmap); + dev_err(&i2c->dev, "Failed to allocate register map: %d\n", + ret); +- return ret; ++ goto err_regulator_enable; + } + + ret = wm8731_hw_init(&i2c->dev, wm8731); + if (ret != 0) +- return ret; ++ goto err_regulator_enable; + + ret = devm_snd_soc_register_component(&i2c->dev, + &soc_component_dev_wm8731, &wm8731_dai, 1); + if (ret != 0) { + dev_err(&i2c->dev, "Failed to register CODEC: %d\n", ret); +- return ret; ++ goto err_regulator_enable; + } + + return 0; ++ ++err_regulator_enable: ++ /* Regulators will be enabled by bias management */ ++ regulator_bulk_disable(ARRAY_SIZE(wm8731->supplies), wm8731->supplies); ++ ++ return ret; + } + + static int wm8731_i2c_remove(struct i2c_client *client) +-- +2.35.1 + diff --git a/queue-5.4/bnx2x-fix-napi-api-usage-sequence.patch b/queue-5.4/bnx2x-fix-napi-api-usage-sequence.patch new file mode 100644 index 00000000000..9f789a98b79 --- /dev/null +++ b/queue-5.4/bnx2x-fix-napi-api-usage-sequence.patch @@ -0,0 +1,152 @@ +From 768451d9d08b10ffb7da574276741ca069ff481b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 26 Apr 2022 08:39:13 -0700 +Subject: bnx2x: fix napi API usage sequence + +From: Manish Chopra + +[ Upstream commit af68656d66eda219b7f55ce8313a1da0312c79e1 ] + +While handling PCI errors (AER flow) driver tries to +disable NAPI [napi_disable()] after NAPI is deleted +[__netif_napi_del()] which causes unexpected system +hang/crash. + +System message log shows the following: +======================================= +[ 3222.537510] EEH: Detected PCI bus error on PHB#384-PE#800000 [ 3222.537511] EEH: This PCI device has failed 2 times in the last hour and will be permanently disabled after 5 failures. +[ 3222.537512] EEH: Notify device drivers to shutdown [ 3222.537513] EEH: Beginning: 'error_detected(IO frozen)' +[ 3222.537514] EEH: PE#800000 (PCI 0384:80:00.0): Invoking +bnx2x->error_detected(IO frozen) +[ 3222.537516] bnx2x: [bnx2x_io_error_detected:14236(eth14)]IO error detected [ 3222.537650] EEH: PE#800000 (PCI 0384:80:00.0): bnx2x driver reports: +'need reset' +[ 3222.537651] EEH: PE#800000 (PCI 0384:80:00.1): Invoking +bnx2x->error_detected(IO frozen) +[ 3222.537651] bnx2x: [bnx2x_io_error_detected:14236(eth13)]IO error detected [ 3222.537729] EEH: PE#800000 (PCI 0384:80:00.1): bnx2x driver reports: +'need reset' +[ 3222.537729] EEH: Finished:'error_detected(IO frozen)' with aggregate recovery state:'need reset' +[ 3222.537890] EEH: Collect temporary log [ 3222.583481] EEH: of node=0384:80:00.0 [ 3222.583519] EEH: PCI device/vendor: 168e14e4 [ 3222.583557] EEH: PCI cmd/status register: 00100140 [ 3222.583557] EEH: PCI-E capabilities and status follow: +[ 3222.583744] EEH: PCI-E 00: 00020010 012c8da2 00095d5e 00455c82 [ 3222.583892] EEH: PCI-E 10: 10820000 00000000 00000000 00000000 [ 3222.583893] EEH: PCI-E 20: 00000000 [ 3222.583893] EEH: PCI-E AER capability register set follows: +[ 3222.584079] EEH: PCI-E AER 00: 13c10001 00000000 00000000 00062030 [ 3222.584230] EEH: PCI-E AER 10: 00002000 000031c0 000001e0 00000000 [ 3222.584378] EEH: PCI-E AER 20: 00000000 00000000 00000000 00000000 [ 3222.584416] EEH: PCI-E AER 30: 00000000 00000000 [ 3222.584416] EEH: of node=0384:80:00.1 [ 3222.584454] EEH: PCI device/vendor: 168e14e4 [ 3222.584491] EEH: PCI cmd/status register: 00100140 [ 3222.584492] EEH: PCI-E capabilities and status follow: +[ 3222.584677] EEH: PCI-E 00: 00020010 012c8da2 00095d5e 00455c82 [ 3222.584825] EEH: PCI-E 10: 10820000 00000000 00000000 00000000 [ 3222.584826] EEH: PCI-E 20: 00000000 [ 3222.584826] EEH: PCI-E AER capability register set follows: +[ 3222.585011] EEH: PCI-E AER 00: 13c10001 00000000 00000000 00062030 [ 3222.585160] EEH: PCI-E AER 10: 00002000 000031c0 000001e0 00000000 [ 3222.585309] EEH: PCI-E AER 20: 00000000 00000000 00000000 00000000 [ 3222.585347] EEH: PCI-E AER 30: 00000000 00000000 [ 3222.586872] RTAS: event: 5, Type: Platform Error (224), Severity: 2 [ 3222.586873] EEH: Reset without hotplug activity [ 3224.762767] EEH: Beginning: 'slot_reset' +[ 3224.762770] EEH: PE#800000 (PCI 0384:80:00.0): Invoking +bnx2x->slot_reset() +[ 3224.762771] bnx2x: [bnx2x_io_slot_reset:14271(eth14)]IO slot reset initializing... +[ 3224.762887] bnx2x 0384:80:00.0: enabling device (0140 -> 0142) [ 3224.768157] bnx2x: [bnx2x_io_slot_reset:14287(eth14)]IO slot reset +--> driver unload + +Uninterruptible tasks +===================== +crash> ps | grep UN + 213 2 11 c000000004c89e00 UN 0.0 0 0 [eehd] + 215 2 0 c000000004c80000 UN 0.0 0 0 +[kworker/0:2] + 2196 1 28 c000000004504f00 UN 0.1 15936 11136 wickedd + 4287 1 9 c00000020d076800 UN 0.0 4032 3008 agetty + 4289 1 20 c00000020d056680 UN 0.0 7232 3840 agetty + 32423 2 26 c00000020038c580 UN 0.0 0 0 +[kworker/26:3] + 32871 4241 27 c0000002609ddd00 UN 0.1 18624 11648 sshd + 32920 10130 16 c00000027284a100 UN 0.1 48512 12608 sendmail + 33092 32987 0 c000000205218b00 UN 0.1 48512 12608 sendmail + 33154 4567 16 c000000260e51780 UN 0.1 48832 12864 pickup + 33209 4241 36 c000000270cb6500 UN 0.1 18624 11712 sshd + 33473 33283 0 c000000205211480 UN 0.1 48512 12672 sendmail + 33531 4241 37 c00000023c902780 UN 0.1 18624 11648 sshd + +EEH handler hung while bnx2x sleeping and holding RTNL lock +=========================================================== +crash> bt 213 +PID: 213 TASK: c000000004c89e00 CPU: 11 COMMAND: "eehd" + #0 [c000000004d477e0] __schedule at c000000000c70808 + #1 [c000000004d478b0] schedule at c000000000c70ee0 + #2 [c000000004d478e0] schedule_timeout at c000000000c76dec + #3 [c000000004d479c0] msleep at c0000000002120cc + #4 [c000000004d479f0] napi_disable at c000000000a06448 + ^^^^^^^^^^^^^^^^ + #5 [c000000004d47a30] bnx2x_netif_stop at c0080000018dba94 [bnx2x] + #6 [c000000004d47a60] bnx2x_io_slot_reset at c0080000018a551c [bnx2x] + #7 [c000000004d47b20] eeh_report_reset at c00000000004c9bc + #8 [c000000004d47b90] eeh_pe_report at c00000000004d1a8 + #9 [c000000004d47c40] eeh_handle_normal_event at c00000000004da64 + +And the sleeping source code +============================ +crash> dis -ls c000000000a06448 +FILE: ../net/core/dev.c +LINE: 6702 + + 6697 { + 6698 might_sleep(); + 6699 set_bit(NAPI_STATE_DISABLE, &n->state); + 6700 + 6701 while (test_and_set_bit(NAPI_STATE_SCHED, &n->state)) +* 6702 msleep(1); + 6703 while (test_and_set_bit(NAPI_STATE_NPSVC, &n->state)) + 6704 msleep(1); + 6705 + 6706 hrtimer_cancel(&n->timer); + 6707 + 6708 clear_bit(NAPI_STATE_DISABLE, &n->state); + 6709 } + +EEH calls into bnx2x twice based on the system log above, first through +bnx2x_io_error_detected() and then bnx2x_io_slot_reset(), and executes +the following call chains: + +bnx2x_io_error_detected() + +-> bnx2x_eeh_nic_unload() + +-> bnx2x_del_all_napi() + +-> __netif_napi_del() + +bnx2x_io_slot_reset() + +-> bnx2x_netif_stop() + +-> bnx2x_napi_disable() + +->napi_disable() + +Fix this by correcting the sequence of NAPI APIs usage, +that is delete the NAPI after disabling it. + +Fixes: 7fa6f34081f1 ("bnx2x: AER revised") +Reported-by: David Christensen +Tested-by: David Christensen +Signed-off-by: Manish Chopra +Signed-off-by: Ariel Elior +Link: https://lore.kernel.org/r/20220426153913.6966-1-manishc@marvell.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +index cff64e43bdd8..b5f58c62e7d2 100644 +--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c ++++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +@@ -14267,10 +14267,6 @@ static int bnx2x_eeh_nic_unload(struct bnx2x *bp) + + /* Stop Tx */ + bnx2x_tx_disable(bp); +- /* Delete all NAPI objects */ +- bnx2x_del_all_napi(bp); +- if (CNIC_LOADED(bp)) +- bnx2x_del_all_napi_cnic(bp); + netdev_reset_tc(bp->dev); + + del_timer_sync(&bp->timer); +@@ -14375,6 +14371,11 @@ static pci_ers_result_t bnx2x_io_slot_reset(struct pci_dev *pdev) + bnx2x_drain_tx_queues(bp); + bnx2x_send_unload_req(bp, UNLOAD_RECOVERY); + bnx2x_netif_stop(bp, 1); ++ bnx2x_del_all_napi(bp); ++ ++ if (CNIC_LOADED(bp)) ++ bnx2x_del_all_napi_cnic(bp); ++ + bnx2x_free_irq(bp); + + /* Report UNLOAD_DONE to MCP */ +-- +2.35.1 + diff --git a/queue-5.4/bpf-lwt-fix-crash-when-using-bpf_skb_set_tunnel_key-.patch b/queue-5.4/bpf-lwt-fix-crash-when-using-bpf_skb_set_tunnel_key-.patch new file mode 100644 index 00000000000..fe4705a151d --- /dev/null +++ b/queue-5.4/bpf-lwt-fix-crash-when-using-bpf_skb_set_tunnel_key-.patch @@ -0,0 +1,88 @@ +From 4a10530d64f0836fdb0d40b1ff6ef966bd16c933 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 20 Apr 2022 19:52:19 +0300 +Subject: bpf, lwt: Fix crash when using bpf_skb_set_tunnel_key() from bpf_xmit + lwt hook + +From: Eyal Birger + +[ Upstream commit b02d196c44ead1a5949729be9ff08fe781c3e48a ] + +xmit_check_hhlen() observes the dst for getting the device hard header +length to make sure a modified packet can fit. When a helper which changes +the dst - such as bpf_skb_set_tunnel_key() - is called as part of the +xmit program the accessed dst is no longer valid. + +This leads to the following splat: + + BUG: kernel NULL pointer dereference, address: 00000000000000de + #PF: supervisor read access in kernel mode + #PF: error_code(0x0000) - not-present page + PGD 0 P4D 0 + Oops: 0000 [#1] PREEMPT SMP PTI + CPU: 0 PID: 798 Comm: ping Not tainted 5.18.0-rc2+ #103 + Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-2 04/01/2014 + RIP: 0010:bpf_xmit+0xfb/0x17f + Code: c6 c0 4d cd 8e 48 c7 c7 7d 33 f0 8e e8 42 09 fb ff 48 8b 45 58 48 8b 95 c8 00 00 00 48 2b 95 c0 00 00 00 48 83 e0 fe 48 8b 00 <0f> b7 80 de 00 00 00 39 c2 73 22 29 d0 b9 20 0a 00 00 31 d2 48 89 + RSP: 0018:ffffb148c0bc7b98 EFLAGS: 00010282 + RAX: 0000000000000000 RBX: 0000000000240008 RCX: 0000000000000000 + RDX: 0000000000000010 RSI: 00000000ffffffea RDI: 00000000ffffffff + RBP: ffff922a828a4e00 R08: ffffffff8f1350e8 R09: 00000000ffffdfff + R10: ffffffff8f055100 R11: ffffffff8f105100 R12: 0000000000000000 + R13: ffff922a828a4e00 R14: 0000000000000040 R15: 0000000000000000 + FS: 00007f414e8f0080(0000) GS:ffff922afdc00000(0000) knlGS:0000000000000000 + CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 + CR2: 00000000000000de CR3: 0000000002d80006 CR4: 0000000000370ef0 + Call Trace: + + lwtunnel_xmit.cold+0x71/0xc8 + ip_finish_output2+0x279/0x520 + ? __ip_finish_output.part.0+0x21/0x130 + +Fix by fetching the device hard header length before running the BPF code. + +Fixes: 3a0af8fd61f9 ("bpf: BPF for lightweight tunnel infrastructure") +Signed-off-by: Eyal Birger +Signed-off-by: Daniel Borkmann +Link: https://lore.kernel.org/bpf/20220420165219.1755407-1-eyal.birger@gmail.com +Signed-off-by: Sasha Levin +--- + net/core/lwt_bpf.c | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +diff --git a/net/core/lwt_bpf.c b/net/core/lwt_bpf.c +index a5502c5aa44e..bf270b6a99b4 100644 +--- a/net/core/lwt_bpf.c ++++ b/net/core/lwt_bpf.c +@@ -158,10 +158,8 @@ static int bpf_output(struct net *net, struct sock *sk, struct sk_buff *skb) + return dst->lwtstate->orig_output(net, sk, skb); + } + +-static int xmit_check_hhlen(struct sk_buff *skb) ++static int xmit_check_hhlen(struct sk_buff *skb, int hh_len) + { +- int hh_len = skb_dst(skb)->dev->hard_header_len; +- + if (skb_headroom(skb) < hh_len) { + int nhead = HH_DATA_ALIGN(hh_len - skb_headroom(skb)); + +@@ -273,6 +271,7 @@ static int bpf_xmit(struct sk_buff *skb) + + bpf = bpf_lwt_lwtunnel(dst->lwtstate); + if (bpf->xmit.prog) { ++ int hh_len = dst->dev->hard_header_len; + __be16 proto = skb->protocol; + int ret; + +@@ -290,7 +289,7 @@ static int bpf_xmit(struct sk_buff *skb) + /* If the header was expanded, headroom might be too + * small for L2 header to come, expand as needed. + */ +- ret = xmit_check_hhlen(skb); ++ ret = xmit_check_hhlen(skb, hh_len); + if (unlikely(ret)) + return ret; + +-- +2.35.1 + diff --git a/queue-5.4/bus-sunxi-rsb-fix-the-return-value-of-sunxi_rsb_devi.patch b/queue-5.4/bus-sunxi-rsb-fix-the-return-value-of-sunxi_rsb_devi.patch new file mode 100644 index 00000000000..21296455e98 --- /dev/null +++ b/queue-5.4/bus-sunxi-rsb-fix-the-return-value-of-sunxi_rsb_devi.patch @@ -0,0 +1,43 @@ +From 40d27393b6c9984ae724e2b1f82e65cf6ce60239 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 21 Apr 2022 16:35:49 +0200 +Subject: bus: sunxi-rsb: Fix the return value of sunxi_rsb_device_create() + +From: Christophe JAILLET + +[ Upstream commit fff8c10368e64e7f8960f149375c12ca5f3b30af ] + +This code is really spurious. +It always returns an ERR_PTR, even when err is known to be 0 and calls +put_device() after a successful device_register() call. + +It is likely that the return statement in the normal path is missing. +Add 'return rdev;' to fix it. + +Fixes: d787dcdb9c8f ("bus: sunxi-rsb: Add driver for Allwinner Reduced Serial Bus") +Signed-off-by: Christophe JAILLET +Reviewed-by: Samuel Holland +Tested-by: Samuel Holland +Signed-off-by: Jernej Skrabec +Link: https://lore.kernel.org/r/ef2b9576350bba4c8e05e669e9535e9e2a415763.1650551719.git.christophe.jaillet@wanadoo.fr +Signed-off-by: Sasha Levin +--- + drivers/bus/sunxi-rsb.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/bus/sunxi-rsb.c b/drivers/bus/sunxi-rsb.c +index 1bb00a959c67..9b1a5e62417c 100644 +--- a/drivers/bus/sunxi-rsb.c ++++ b/drivers/bus/sunxi-rsb.c +@@ -224,6 +224,8 @@ static struct sunxi_rsb_device *sunxi_rsb_device_create(struct sunxi_rsb *rsb, + + dev_dbg(&rdev->dev, "device %s registered\n", dev_name(&rdev->dev)); + ++ return rdev; ++ + err_device_add: + put_device(&rdev->dev); + +-- +2.35.1 + diff --git a/queue-5.4/cifs-destage-any-unwritten-data-to-the-server-before.patch b/queue-5.4/cifs-destage-any-unwritten-data-to-the-server-before.patch new file mode 100644 index 00000000000..e528f7bb3b5 --- /dev/null +++ b/queue-5.4/cifs-destage-any-unwritten-data-to-the-server-before.patch @@ -0,0 +1,59 @@ +From 6cbba217ea3a9b240f763cf389ec8c306d64a613 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 21 Apr 2022 11:15:36 +1000 +Subject: cifs: destage any unwritten data to the server before calling + copychunk_write + +From: Ronnie Sahlberg + +[ Upstream commit f5d0f921ea362636e4a2efb7c38d1ead373a8700 ] + +because the copychunk_write might cover a region of the file that has not yet +been sent to the server and thus fail. + +A simple way to reproduce this is: +truncate -s 0 /mnt/testfile; strace -f -o x -ttT xfs_io -i -f -c 'pwrite 0k 128k' -c 'fcollapse 16k 24k' /mnt/testfile + +the issue is that the 'pwrite 0k 128k' becomes rearranged on the wire with +the 'fcollapse 16k 24k' due to write-back caching. + +fcollapse is implemented in cifs.ko as a SMB2 IOCTL(COPYCHUNK_WRITE) call +and it will fail serverside since the file is still 0b in size serverside +until the writes have been destaged. +To avoid this we must ensure that we destage any unwritten data to the +server before calling COPYCHUNK_WRITE. + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1997373 +Reported-by: Xiaoli Feng +Signed-off-by: Ronnie Sahlberg +Signed-off-by: Steve French +Signed-off-by: Sasha Levin +--- + fs/cifs/smb2ops.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c +index defee1d208d2..7985fe25850b 100644 +--- a/fs/cifs/smb2ops.c ++++ b/fs/cifs/smb2ops.c +@@ -1643,9 +1643,17 @@ smb2_copychunk_range(const unsigned int xid, + int chunks_copied = 0; + bool chunk_sizes_updated = false; + ssize_t bytes_written, total_bytes_written = 0; ++ struct inode *inode; + + pcchunk = kmalloc(sizeof(struct copychunk_ioctl), GFP_KERNEL); + ++ /* ++ * We need to flush all unwritten data before we can send the ++ * copychunk ioctl to the server. ++ */ ++ inode = d_inode(trgtfile->dentry); ++ filemap_write_and_wait(inode->i_mapping); ++ + if (pcchunk == NULL) + return -ENOMEM; + +-- +2.35.1 + diff --git a/queue-5.4/clk-sunxi-sun9i-mmc-check-return-value-after-calling.patch b/queue-5.4/clk-sunxi-sun9i-mmc-check-return-value-after-calling.patch new file mode 100644 index 00000000000..62dc1d9c86f --- /dev/null +++ b/queue-5.4/clk-sunxi-sun9i-mmc-check-return-value-after-calling.patch @@ -0,0 +1,39 @@ +From a582e8823e569d99ca2fb4851972529200e39813 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 21 Apr 2022 21:43:08 +0800 +Subject: clk: sunxi: sun9i-mmc: check return value after calling + platform_get_resource() + +From: Yang Yingliang + +[ Upstream commit f58ca215cda1975f77b2b762903684a3c101bec9 ] + +It will cause null-ptr-deref if platform_get_resource() returns NULL, +we need check the return value. + +Fixes: 7a6fca879f59 ("clk: sunxi: Add driver for A80 MMC config clocks/resets") +Signed-off-by: Yang Yingliang +Reviewed-by: Samuel Holland +Signed-off-by: Jernej Skrabec +Link: https://lore.kernel.org/r/20220421134308.2885094-1-yangyingliang@huawei.com +Signed-off-by: Sasha Levin +--- + drivers/clk/sunxi/clk-sun9i-mmc.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/clk/sunxi/clk-sun9i-mmc.c b/drivers/clk/sunxi/clk-sun9i-mmc.c +index 542b31d6e96d..636bcf2439ef 100644 +--- a/drivers/clk/sunxi/clk-sun9i-mmc.c ++++ b/drivers/clk/sunxi/clk-sun9i-mmc.c +@@ -109,6 +109,8 @@ static int sun9i_a80_mmc_config_clk_probe(struct platform_device *pdev) + spin_lock_init(&data->lock); + + r = platform_get_resource(pdev, IORESOURCE_MEM, 0); ++ if (!r) ++ return -EINVAL; + /* one clock/reset pair per word */ + count = DIV_ROUND_UP((resource_size(r)), SUN9I_MMC_WIDTH); + data->membase = devm_ioremap_resource(&pdev->dev, r); +-- +2.35.1 + diff --git a/queue-5.4/cpufreq-fix-memory-leak-in-sun50i_cpufreq_nvmem_prob.patch b/queue-5.4/cpufreq-fix-memory-leak-in-sun50i_cpufreq_nvmem_prob.patch new file mode 100644 index 00000000000..f3bdf14ed5c --- /dev/null +++ b/queue-5.4/cpufreq-fix-memory-leak-in-sun50i_cpufreq_nvmem_prob.patch @@ -0,0 +1,64 @@ +From 91f4f72199e6d98bc986d7b18db0ac6df7dd5e91 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 23 Apr 2022 15:12:04 +0000 +Subject: cpufreq: fix memory leak in sun50i_cpufreq_nvmem_probe + +From: Xiaobing Luo + +[ Upstream commit 1aa24a8f3b5133dae4bc1e57427e345445f3e902 ] + +-------------------------------------------- +unreferenced object 0xffff000010742a00 (size 128): + comm "swapper/0", pid 1, jiffies 4294902015 (age 1187.652s) + hex dump (first 32 bytes): + 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ + backtrace: + [<00000000b4dfebaa>] __kmalloc+0x338/0x474 + [<00000000d6e716db>] sun50i_cpufreq_nvmem_probe+0xc4/0x36c + [<000000007d6082a0>] platform_probe+0x98/0x11c + [<00000000c990f549>] really_probe+0x234/0x5a0 + [<000000002d9fecc6>] __driver_probe_device+0x194/0x224 + [<00000000cf0b94fa>] driver_probe_device+0x64/0x13c + [<00000000f238e4cf>] __device_attach_driver+0xf8/0x180 + [<000000006720e418>] bus_for_each_drv+0xf8/0x160 + [<00000000df4f14f6>] __device_attach+0x174/0x29c + [<00000000782002fb>] device_initial_probe+0x20/0x30 + [<00000000c2681b06>] bus_probe_device+0xfc/0x110 + [<00000000964cf3bd>] device_add+0x5f0/0xcd0 + [<000000004b9264e3>] platform_device_add+0x198/0x390 + [<00000000fa82a9d0>] platform_device_register_full+0x178/0x210 + [<000000009a5daf13>] sun50i_cpufreq_init+0xf8/0x168 + [<000000000377cc7c>] do_one_initcall+0xe4/0x570 +-------------------------------------------- + +if sun50i_cpufreq_get_efuse failed, then opp_tables leak. + +Fixes: f328584f7bff ("cpufreq: Add sun50i nvmem based CPU scaling driver") +Signed-off-by: Xiaobing Luo +Reviewed-by: Samuel Holland +Signed-off-by: Viresh Kumar +Signed-off-by: Sasha Levin +--- + drivers/cpufreq/sun50i-cpufreq-nvmem.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/cpufreq/sun50i-cpufreq-nvmem.c b/drivers/cpufreq/sun50i-cpufreq-nvmem.c +index 2deed8d8773f..75e1bf3a08f7 100644 +--- a/drivers/cpufreq/sun50i-cpufreq-nvmem.c ++++ b/drivers/cpufreq/sun50i-cpufreq-nvmem.c +@@ -98,8 +98,10 @@ static int sun50i_cpufreq_nvmem_probe(struct platform_device *pdev) + return -ENOMEM; + + ret = sun50i_cpufreq_get_efuse(&speed); +- if (ret) ++ if (ret) { ++ kfree(opp_tables); + return ret; ++ } + + snprintf(name, MAX_NAME_LEN, "speed%d", speed); + +-- +2.35.1 + diff --git a/queue-5.4/drivers-net-hippi-fix-deadlock-in-rr_close.patch b/queue-5.4/drivers-net-hippi-fix-deadlock-in-rr_close.patch new file mode 100644 index 00000000000..418cfe487b7 --- /dev/null +++ b/queue-5.4/drivers-net-hippi-fix-deadlock-in-rr_close.patch @@ -0,0 +1,53 @@ +From 2648dc263f0afba51173feeeb55b31a1b031d640 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 17 Apr 2022 20:55:19 +0800 +Subject: drivers: net: hippi: Fix deadlock in rr_close() + +From: Duoming Zhou + +[ Upstream commit bc6de2878429e85c1f1afaa566f7b5abb2243eef ] + +There is a deadlock in rr_close(), which is shown below: + + (Thread 1) | (Thread 2) + | rr_open() +rr_close() | add_timer() + spin_lock_irqsave() //(1) | (wait a time) + ... | rr_timer() + del_timer_sync() | spin_lock_irqsave() //(2) + (wait timer to stop) | ... + +We hold rrpriv->lock in position (1) of thread 1 and +use del_timer_sync() to wait timer to stop, but timer handler +also need rrpriv->lock in position (2) of thread 2. +As a result, rr_close() will block forever. + +This patch extracts del_timer_sync() from the protection of +spin_lock_irqsave(), which could let timer handler to obtain +the needed lock. + +Signed-off-by: Duoming Zhou +Link: https://lore.kernel.org/r/20220417125519.82618-1-duoming@zju.edu.cn +Signed-off-by: Paolo Abeni +Signed-off-by: Sasha Levin +--- + drivers/net/hippi/rrunner.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/net/hippi/rrunner.c b/drivers/net/hippi/rrunner.c +index a4b3fce69ecd..6016e182f008 100644 +--- a/drivers/net/hippi/rrunner.c ++++ b/drivers/net/hippi/rrunner.c +@@ -1346,7 +1346,9 @@ static int rr_close(struct net_device *dev) + + rrpriv->fw_running = 0; + ++ spin_unlock_irqrestore(&rrpriv->lock, flags); + del_timer_sync(&rrpriv->timer); ++ spin_lock_irqsave(&rrpriv->lock, flags); + + writel(0, ®s->TxPi); + writel(0, ®s->IpRxPi); +-- +2.35.1 + diff --git a/queue-5.4/drm-amd-display-fix-memory-leak-in-dcn21_clock_sourc.patch b/queue-5.4/drm-amd-display-fix-memory-leak-in-dcn21_clock_sourc.patch new file mode 100644 index 00000000000..555ad7cddfa --- /dev/null +++ b/queue-5.4/drm-amd-display-fix-memory-leak-in-dcn21_clock_sourc.patch @@ -0,0 +1,34 @@ +From 841d6e71c8ca8157e57841c58a2adc00fd297eb1 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 21 Apr 2022 17:03:09 +0800 +Subject: drm/amd/display: Fix memory leak in dcn21_clock_source_create + +From: Miaoqian Lin + +[ Upstream commit 65e54987508b6f0771f56bdfa3ee1926d52785ae ] + +When dcn20_clk_src_construct() fails, we need to release clk_src. + +Fixes: 6f4e6361c3ff ("drm/amd/display: Add Renoir resource (v2)") +Signed-off-by: Miaoqian Lin +Signed-off-by: Alex Deucher +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c b/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c +index 11a4c4029a90..acc2c307c871 100644 +--- a/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c ++++ b/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c +@@ -1140,6 +1140,7 @@ static struct clock_source *dcn21_clock_source_create( + return &clk_src->base; + } + ++ kfree(clk_src); + BREAK_TO_DEBUGGER(); + return NULL; + } +-- +2.35.1 + diff --git a/queue-5.4/ip6_gre-avoid-updating-tunnel-tun_hlen-in-__gre6_xmi.patch b/queue-5.4/ip6_gre-avoid-updating-tunnel-tun_hlen-in-__gre6_xmi.patch new file mode 100644 index 00000000000..7313cd7e1dd --- /dev/null +++ b/queue-5.4/ip6_gre-avoid-updating-tunnel-tun_hlen-in-__gre6_xmi.patch @@ -0,0 +1,48 @@ +From cd5055175432a763608f422833e6d32a5fd94d58 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 14 Apr 2022 13:34:26 -0700 +Subject: ip6_gre: Avoid updating tunnel->tun_hlen in __gre6_xmit() + +From: Peilin Ye + +[ Upstream commit f40c064e933d7787ca7411b699504d7a2664c1f5 ] + +Do not update tunnel->tun_hlen in data plane code. Use a local variable +instead, just like "tunnel_hlen" in net/ipv4/ip_gre.c:gre_fb_xmit(). + +Co-developed-by: Cong Wang +Signed-off-by: Cong Wang +Signed-off-by: Peilin Ye +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + net/ipv6/ip6_gre.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c +index 5dbc280d4385..e550db28aabb 100644 +--- a/net/ipv6/ip6_gre.c ++++ b/net/ipv6/ip6_gre.c +@@ -730,6 +730,7 @@ static netdev_tx_t __gre6_xmit(struct sk_buff *skb, + struct ip_tunnel_info *tun_info; + const struct ip_tunnel_key *key; + __be16 flags; ++ int tun_hlen; + + tun_info = skb_tunnel_info(skb); + if (unlikely(!tun_info || +@@ -748,9 +749,9 @@ static netdev_tx_t __gre6_xmit(struct sk_buff *skb, + dsfield = key->tos; + flags = key->tun_flags & + (TUNNEL_CSUM | TUNNEL_KEY | TUNNEL_SEQ); +- tunnel->tun_hlen = gre_calc_hlen(flags); ++ tun_hlen = gre_calc_hlen(flags); + +- gre_build_header(skb, tunnel->tun_hlen, ++ gre_build_header(skb, tun_hlen, + flags, protocol, + tunnel_id_to_key32(tun_info->key.tun_id), + (flags & TUNNEL_SEQ) ? htonl(tunnel->o_seqno++) +-- +2.35.1 + diff --git a/queue-5.4/ip_gre-make-o_seqno-start-from-0-in-native-mode.patch b/queue-5.4/ip_gre-make-o_seqno-start-from-0-in-native-mode.patch new file mode 100644 index 00000000000..e53cd54a1b7 --- /dev/null +++ b/queue-5.4/ip_gre-make-o_seqno-start-from-0-in-native-mode.patch @@ -0,0 +1,51 @@ +From 9e04f3b97d156195dc76d1b5c934a3e96fc573f8 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 21 Apr 2022 15:07:57 -0700 +Subject: ip_gre: Make o_seqno start from 0 in native mode + +From: Peilin Ye + +[ Upstream commit ff827beb706ed719c766acf36449801ded0c17fc ] + +For GRE and GRETAP devices, currently o_seqno starts from 1 in native +mode. According to RFC 2890 2.2., "The first datagram is sent with a +sequence number of 0." Fix it. + +It is worth mentioning that o_seqno already starts from 0 in collect_md +mode, see gre_fb_xmit(), where tunnel->o_seqno is passed to +gre_build_header() before getting incremented. + +Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") +Signed-off-by: Peilin Ye +Acked-by: William Tu +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + net/ipv4/ip_gre.c | 8 +++----- + 1 file changed, 3 insertions(+), 5 deletions(-) + +diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c +index f67f1d27f565..5b38d03f6d79 100644 +--- a/net/ipv4/ip_gre.c ++++ b/net/ipv4/ip_gre.c +@@ -432,14 +432,12 @@ static void __gre_xmit(struct sk_buff *skb, struct net_device *dev, + __be16 proto) + { + struct ip_tunnel *tunnel = netdev_priv(dev); +- +- if (tunnel->parms.o_flags & TUNNEL_SEQ) +- tunnel->o_seqno++; ++ __be16 flags = tunnel->parms.o_flags; + + /* Push GRE header. */ + gre_build_header(skb, tunnel->tun_hlen, +- tunnel->parms.o_flags, proto, tunnel->parms.o_key, +- htonl(tunnel->o_seqno)); ++ flags, proto, tunnel->parms.o_key, ++ (flags & TUNNEL_SEQ) ? htonl(tunnel->o_seqno++) : 0); + + ip_tunnel_xmit(skb, dev, tnl_params, tnl_params->protocol); + } +-- +2.35.1 + diff --git a/queue-5.4/ipvs-correctly-print-the-memory-size-of-ip_vs_conn_t.patch b/queue-5.4/ipvs-correctly-print-the-memory-size-of-ip_vs_conn_t.patch new file mode 100644 index 00000000000..b7377862573 --- /dev/null +++ b/queue-5.4/ipvs-correctly-print-the-memory-size-of-ip_vs_conn_t.patch @@ -0,0 +1,38 @@ +From 7f683751407c23b7caefcaebb908a7d4f61c3bf5 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 12 Apr 2022 19:05:45 +0800 +Subject: ipvs: correctly print the memory size of ip_vs_conn_tab + +From: Pengcheng Yang + +[ Upstream commit eba1a872cb73314280d5448d934935b23e30b7ca ] + +The memory size of ip_vs_conn_tab changed after we use hlist +instead of list. + +Fixes: 731109e78415 ("ipvs: use hlist instead of list") +Signed-off-by: Pengcheng Yang +Acked-by: Julian Anastasov +Acked-by: Simon Horman +Signed-off-by: Pablo Neira Ayuso +Signed-off-by: Sasha Levin +--- + net/netfilter/ipvs/ip_vs_conn.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/net/netfilter/ipvs/ip_vs_conn.c b/net/netfilter/ipvs/ip_vs_conn.c +index d1524ca4b90e..a189079a6ea5 100644 +--- a/net/netfilter/ipvs/ip_vs_conn.c ++++ b/net/netfilter/ipvs/ip_vs_conn.c +@@ -1421,7 +1421,7 @@ int __init ip_vs_conn_init(void) + pr_info("Connection hash table configured " + "(size=%d, memory=%ldKbytes)\n", + ip_vs_conn_tab_size, +- (long)(ip_vs_conn_tab_size*sizeof(struct list_head))/1024); ++ (long)(ip_vs_conn_tab_size*sizeof(*ip_vs_conn_tab))/1024); + IP_VS_DBG(0, "Each connection entry needs %zd bytes at least\n", + sizeof(struct ip_vs_conn)); + +-- +2.35.1 + diff --git a/queue-5.4/ixgbe-ensure-ipsec-vf-pf-compatibility.patch b/queue-5.4/ixgbe-ensure-ipsec-vf-pf-compatibility.patch new file mode 100644 index 00000000000..cf093d9ae53 --- /dev/null +++ b/queue-5.4/ixgbe-ensure-ipsec-vf-pf-compatibility.patch @@ -0,0 +1,45 @@ +From 14440f64f3d8b935fe2dad133d079a41fd04cf3e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 27 Apr 2022 10:31:52 -0700 +Subject: ixgbe: ensure IPsec VF<->PF compatibility + +From: Leon Romanovsky + +[ Upstream commit f049efc7f7cd2f3c419f55040928eaefb13b3636 ] + +The VF driver can forward any IPsec flags and such makes the function +is not extendable and prone to backward/forward incompatibility. + +If new software runs on VF, it won't know that PF configured something +completely different as it "knows" only XFRM_OFFLOAD_INBOUND flag. + +Fixes: eda0333ac293 ("ixgbe: add VF IPsec management") +Reviewed-by: Raed Salem +Signed-off-by: Leon Romanovsky +Reviewed-by: Shannon Nelson +Tested-by: Konrad Jankowski +Signed-off-by: Tony Nguyen +Link: https://lore.kernel.org/r/20220427173152.443102-1-anthony.l.nguyen@intel.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c +index b14b164c9601..5799b434165e 100644 +--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c ++++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c +@@ -903,7 +903,8 @@ int ixgbe_ipsec_vf_add_sa(struct ixgbe_adapter *adapter, u32 *msgbuf, u32 vf) + /* Tx IPsec offload doesn't seem to work on this + * device, so block these requests for now. + */ +- if (!(sam->flags & XFRM_OFFLOAD_INBOUND)) { ++ sam->flags = sam->flags & ~XFRM_OFFLOAD_IPV6; ++ if (sam->flags != XFRM_OFFLOAD_INBOUND) { + err = -EOPNOTSUPP; + goto err_out; + } +-- +2.35.1 + diff --git a/queue-5.4/mtd-rawnand-fix-ecc-parameters-for-mt7622.patch b/queue-5.4/mtd-rawnand-fix-ecc-parameters-for-mt7622.patch new file mode 100644 index 00000000000..cd6c27e3bd8 --- /dev/null +++ b/queue-5.4/mtd-rawnand-fix-ecc-parameters-for-mt7622.patch @@ -0,0 +1,99 @@ +From 1ea3ad8bb410b947e8527554d8263323f5ae998c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 3 Apr 2022 00:03:13 +0800 +Subject: mtd: rawnand: fix ecc parameters for mt7622 + +From: Chuanhong Guo + +[ Upstream commit 9fe4e0d3cbfe90152137963cc024ecb63db6e8e6 ] + +According to the datasheet, mt7622 only has 5 ECC capabilities instead +of 7, and the decoding error register is arranged as follows: ++------+---------+---------+---------+---------+ +| Bits | 19:15 | 14:10 | 9:5 | 4:0 | ++------+---------+---------+---------+---------+ +| Name | ERRNUM3 | ERRNUM2 | ERRNUM1 | ERRNUM0 | ++------+---------+---------+---------+---------+ +This means err_mask should be 0x1f instead of 0x3f and the number of +bits shifted in mtk_ecc_get_stats should be 5 instead of 8. + +This commit introduces err_shift for the difference in this register +and fix other existing parameters. + +Public MT7622 reference manual can be found on [0] and the info this +commit is based on is from page 656 and page 660. + +[0]: https://wiki.banana-pi.org/Banana_Pi_BPI-R64#Documents + +Fixes: 98dea8d71931 ("mtd: nand: mtk: Support MT7622 NAND flash controller.") +Signed-off-by: Chuanhong Guo +Signed-off-by: Miquel Raynal +Link: https://lore.kernel.org/linux-mtd/20220402160315.919094-1-gch981213@gmail.com +Signed-off-by: Sasha Levin +--- + drivers/mtd/nand/raw/mtk_ecc.c | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +diff --git a/drivers/mtd/nand/raw/mtk_ecc.c b/drivers/mtd/nand/raw/mtk_ecc.c +index 74595b644b7c..57fa7807cd7d 100644 +--- a/drivers/mtd/nand/raw/mtk_ecc.c ++++ b/drivers/mtd/nand/raw/mtk_ecc.c +@@ -43,6 +43,7 @@ + + struct mtk_ecc_caps { + u32 err_mask; ++ u32 err_shift; + const u8 *ecc_strength; + const u32 *ecc_regs; + u8 num_ecc_strength; +@@ -76,7 +77,7 @@ static const u8 ecc_strength_mt2712[] = { + }; + + static const u8 ecc_strength_mt7622[] = { +- 4, 6, 8, 10, 12, 14, 16 ++ 4, 6, 8, 10, 12 + }; + + enum mtk_ecc_regs { +@@ -221,7 +222,7 @@ void mtk_ecc_get_stats(struct mtk_ecc *ecc, struct mtk_ecc_stats *stats, + for (i = 0; i < sectors; i++) { + offset = (i >> 2) << 2; + err = readl(ecc->regs + ECC_DECENUM0 + offset); +- err = err >> ((i % 4) * 8); ++ err = err >> ((i % 4) * ecc->caps->err_shift); + err &= ecc->caps->err_mask; + if (err == ecc->caps->err_mask) { + /* uncorrectable errors */ +@@ -449,6 +450,7 @@ EXPORT_SYMBOL(mtk_ecc_get_parity_bits); + + static const struct mtk_ecc_caps mtk_ecc_caps_mt2701 = { + .err_mask = 0x3f, ++ .err_shift = 8, + .ecc_strength = ecc_strength_mt2701, + .ecc_regs = mt2701_ecc_regs, + .num_ecc_strength = 20, +@@ -459,6 +461,7 @@ static const struct mtk_ecc_caps mtk_ecc_caps_mt2701 = { + + static const struct mtk_ecc_caps mtk_ecc_caps_mt2712 = { + .err_mask = 0x7f, ++ .err_shift = 8, + .ecc_strength = ecc_strength_mt2712, + .ecc_regs = mt2712_ecc_regs, + .num_ecc_strength = 23, +@@ -468,10 +471,11 @@ static const struct mtk_ecc_caps mtk_ecc_caps_mt2712 = { + }; + + static const struct mtk_ecc_caps mtk_ecc_caps_mt7622 = { +- .err_mask = 0x3f, ++ .err_mask = 0x1f, ++ .err_shift = 5, + .ecc_strength = ecc_strength_mt7622, + .ecc_regs = mt7622_ecc_regs, +- .num_ecc_strength = 7, ++ .num_ecc_strength = 5, + .ecc_mode_shift = 4, + .parity_bits = 13, + .pg_irq_sel = 0, +-- +2.35.1 + diff --git a/queue-5.4/mtd-rawnand-fix-return-value-check-of-wait_for_compl.patch b/queue-5.4/mtd-rawnand-fix-return-value-check-of-wait_for_compl.patch new file mode 100644 index 00000000000..ed7a92b8e01 --- /dev/null +++ b/queue-5.4/mtd-rawnand-fix-return-value-check-of-wait_for_compl.patch @@ -0,0 +1,84 @@ +From 168ea98470bd1c08495b1a4a14eac8b05eedd366 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 12 Apr 2022 08:34:31 +0000 +Subject: mtd: rawnand: Fix return value check of wait_for_completion_timeout + +From: Miaoqian Lin + +[ Upstream commit 084c16ab423a8890121b902b405823bfec5b4365 ] + +wait_for_completion_timeout() returns unsigned long not int. +It returns 0 if timed out, and positive if completed. +The check for <= 0 is ambiguous and should be == 0 here +indicating timeout which is the only error case. + +Fixes: 83738d87e3a0 ("mtd: sh_flctl: Add DMA capabilty") +Signed-off-by: Miaoqian Lin +Signed-off-by: Miquel Raynal +Link: https://lore.kernel.org/linux-mtd/20220412083435.29254-1-linmq006@gmail.com +Signed-off-by: Sasha Levin +--- + drivers/mtd/nand/raw/sh_flctl.c | 14 ++++++++------ + 1 file changed, 8 insertions(+), 6 deletions(-) + +diff --git a/drivers/mtd/nand/raw/sh_flctl.c b/drivers/mtd/nand/raw/sh_flctl.c +index e509c93737c4..f0e2f2d65282 100644 +--- a/drivers/mtd/nand/raw/sh_flctl.c ++++ b/drivers/mtd/nand/raw/sh_flctl.c +@@ -384,7 +384,8 @@ static int flctl_dma_fifo0_transfer(struct sh_flctl *flctl, unsigned long *buf, + dma_addr_t dma_addr; + dma_cookie_t cookie; + uint32_t reg; +- int ret; ++ int ret = 0; ++ unsigned long time_left; + + if (dir == DMA_FROM_DEVICE) { + chan = flctl->chan_fifo0_rx; +@@ -425,13 +426,14 @@ static int flctl_dma_fifo0_transfer(struct sh_flctl *flctl, unsigned long *buf, + goto out; + } + +- ret = ++ time_left = + wait_for_completion_timeout(&flctl->dma_complete, + msecs_to_jiffies(3000)); + +- if (ret <= 0) { ++ if (time_left == 0) { + dmaengine_terminate_all(chan); + dev_err(&flctl->pdev->dev, "wait_for_completion_timeout\n"); ++ ret = -ETIMEDOUT; + } + + out: +@@ -441,7 +443,7 @@ static int flctl_dma_fifo0_transfer(struct sh_flctl *flctl, unsigned long *buf, + + dma_unmap_single(chan->device->dev, dma_addr, len, dir); + +- /* ret > 0 is success */ ++ /* ret == 0 is success */ + return ret; + } + +@@ -465,7 +467,7 @@ static void read_fiforeg(struct sh_flctl *flctl, int rlen, int offset) + + /* initiate DMA transfer */ + if (flctl->chan_fifo0_rx && rlen >= 32 && +- flctl_dma_fifo0_transfer(flctl, buf, rlen, DMA_FROM_DEVICE) > 0) ++ !flctl_dma_fifo0_transfer(flctl, buf, rlen, DMA_FROM_DEVICE)) + goto convert; /* DMA success */ + + /* do polling transfer */ +@@ -524,7 +526,7 @@ static void write_ec_fiforeg(struct sh_flctl *flctl, int rlen, + + /* initiate DMA transfer */ + if (flctl->chan_fifo0_tx && rlen >= 32 && +- flctl_dma_fifo0_transfer(flctl, buf, rlen, DMA_TO_DEVICE) > 0) ++ !flctl_dma_fifo0_transfer(flctl, buf, rlen, DMA_TO_DEVICE)) + return; /* DMA success */ + + /* do polling transfer */ +-- +2.35.1 + diff --git a/queue-5.4/net-bcmgenet-hide-status-block-before-tx-timestampin.patch b/queue-5.4/net-bcmgenet-hide-status-block-before-tx-timestampin.patch new file mode 100644 index 00000000000..9d0658bb931 --- /dev/null +++ b/queue-5.4/net-bcmgenet-hide-status-block-before-tx-timestampin.patch @@ -0,0 +1,61 @@ +From 6c144afe6d0f8f633e06d18805a6ebc9f59ce709 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 24 Apr 2022 09:53:07 -0700 +Subject: net: bcmgenet: hide status block before TX timestamping + +From: Jonathan Lemon + +[ Upstream commit acac0541d1d65e81e599ec399d34d184d2424401 ] + +The hardware checksum offloading requires use of a transmit +status block inserted before the outgoing frame data, this was +updated in '9a9ba2a4aaaa ("net: bcmgenet: always enable status blocks")' + +However, skb_tx_timestamp() assumes that it is passed a raw frame +and PTP parsing chokes on this status block. + +Fix this by calling __skb_pull(), which hides the TSB before calling +skb_tx_timestamp(), so an outgoing PTP packet is parsed correctly. + +As the data in the skb has already been set up for DMA, and the +dma_unmap_* calls use a separately stored address, there is no +no effective change in the data transmission. + +Signed-off-by: Jonathan Lemon +Acked-by: Florian Fainelli +Link: https://lore.kernel.org/r/20220424165307.591145-1-jonathan.lemon@gmail.com +Fixes: d03825fba459 ("net: bcmgenet: add skb_tx_timestamp call") +Signed-off-by: Paolo Abeni +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/broadcom/genet/bcmgenet.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c +index 2affdddc12bf..e03e2bfcc6a1 100644 +--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c ++++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c +@@ -1547,6 +1547,11 @@ static struct sk_buff *bcmgenet_put_tx_csum(struct net_device *dev, + return skb; + } + ++static void bcmgenet_hide_tsb(struct sk_buff *skb) ++{ ++ __skb_pull(skb, sizeof(struct status_64)); ++} ++ + static netdev_tx_t bcmgenet_xmit(struct sk_buff *skb, struct net_device *dev) + { + struct bcmgenet_priv *priv = netdev_priv(dev); +@@ -1655,6 +1660,8 @@ static netdev_tx_t bcmgenet_xmit(struct sk_buff *skb, struct net_device *dev) + } + + GENET_CB(skb)->last_cb = tx_cb_ptr; ++ ++ bcmgenet_hide_tsb(skb); + skb_tx_timestamp(skb); + + /* Decrement total BD count and advance our write pointer */ +-- +2.35.1 + diff --git a/queue-5.4/net-dsa-lantiq_gswip-don-t-set-gswip_mii_cfg_rmii_cl.patch b/queue-5.4/net-dsa-lantiq_gswip-don-t-set-gswip_mii_cfg_rmii_cl.patch new file mode 100644 index 00000000000..b46f0071346 --- /dev/null +++ b/queue-5.4/net-dsa-lantiq_gswip-don-t-set-gswip_mii_cfg_rmii_cl.patch @@ -0,0 +1,60 @@ +From 4e6e1bd7d8c783a45a5f973641b728c248341c36 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 25 Apr 2022 17:20:27 +0200 +Subject: net: dsa: lantiq_gswip: Don't set GSWIP_MII_CFG_RMII_CLK + +From: Martin Blumenstingl + +[ Upstream commit 71cffebf6358a7f5031f5b208bbdc1cb4db6e539 ] + +Commit 4b5923249b8fa4 ("net: dsa: lantiq_gswip: Configure all remaining +GSWIP_MII_CFG bits") added all known bits in the GSWIP_MII_CFGp +register. It helped bring this register into a well-defined state so the +driver has to rely less on the bootloader to do things right. +Unfortunately it also sets the GSWIP_MII_CFG_RMII_CLK bit without any +possibility to configure it. Upon further testing it turns out that all +boards which are supported by the GSWIP driver in OpenWrt which use an +RMII PHY have a dedicated oscillator on the board which provides the +50MHz RMII reference clock. + +Don't set the GSWIP_MII_CFG_RMII_CLK bit (but keep the code which always +clears it) to fix support for the Fritz!Box 7362 SL in OpenWrt. This is +a board with two Atheros AR8030 RMII PHYs. With the "RMII clock" bit set +the MAC also generates the RMII reference clock whose signal then +conflicts with the signal from the oscillator on the board. This results +in a constant cycle of the PHY detecting link up/down (and as a result +of that: the two ports using the AR8030 PHYs are not working). + +At the time of writing this patch there's no known board where the MAC +(GSWIP) has to generate the RMII reference clock. If needed this can be +implemented in future by providing a device-tree flag so the +GSWIP_MII_CFG_RMII_CLK bit can be toggled per port. + +Fixes: 4b5923249b8fa4 ("net: dsa: lantiq_gswip: Configure all remaining GSWIP_MII_CFG bits") +Tested-by: Jan Hoffmann +Signed-off-by: Martin Blumenstingl +Acked-by: Hauke Mehrtens +Link: https://lore.kernel.org/r/20220425152027.2220750-1-martin.blumenstingl@googlemail.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + drivers/net/dsa/lantiq_gswip.c | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/drivers/net/dsa/lantiq_gswip.c b/drivers/net/dsa/lantiq_gswip.c +index 60e36f46f8ab..0c191d395f8f 100644 +--- a/drivers/net/dsa/lantiq_gswip.c ++++ b/drivers/net/dsa/lantiq_gswip.c +@@ -1607,9 +1607,6 @@ static void gswip_phylink_mac_config(struct dsa_switch *ds, int port, + break; + case PHY_INTERFACE_MODE_RMII: + miicfg |= GSWIP_MII_CFG_MODE_RMIIM; +- +- /* Configure the RMII clock as output: */ +- miicfg |= GSWIP_MII_CFG_RMII_CLK; + break; + case PHY_INTERFACE_MODE_RGMII: + case PHY_INTERFACE_MODE_RGMII_ID: +-- +2.35.1 + diff --git a/queue-5.4/net-hns3-add-validity-check-for-message-data-length.patch b/queue-5.4/net-hns3-add-validity-check-for-message-data-length.patch new file mode 100644 index 00000000000..ac6bf4a2584 --- /dev/null +++ b/queue-5.4/net-hns3-add-validity-check-for-message-data-length.patch @@ -0,0 +1,42 @@ +From 77f86af585b655f5b0eb59ee4fcee58a135e992b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 24 Apr 2022 20:57:24 +0800 +Subject: net: hns3: add validity check for message data length + +From: Jian Shen + +[ Upstream commit 7d413735cb18ff73aaba3457b16b08332e8d3cc4 ] + +Add validity check for message data length in function +hclge_send_mbx_msg(), avoid unexpected overflow. + +Fixes: dde1a86e93ca ("net: hns3: Add mailbox support to PF driver") +Signed-off-by: Jian Shen +Signed-off-by: Guangbin Huang +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c +index 23a706a1765a..410a9bf7bf0a 100644 +--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c ++++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c +@@ -64,6 +64,13 @@ static int hclge_send_mbx_msg(struct hclge_vport *vport, u8 *msg, u16 msg_len, + enum hclge_cmd_status status; + struct hclge_desc desc; + ++ if (msg_len > HCLGE_MBX_MAX_MSG_SIZE) { ++ dev_err(&hdev->pdev->dev, ++ "msg data length(=%u) exceeds maximum(=%u)\n", ++ msg_len, HCLGE_MBX_MAX_MSG_SIZE); ++ return -EMSGSIZE; ++ } ++ + resp_pf_to_vf = (struct hclge_mbx_pf_to_vf_cmd *)desc.data; + + hclge_cmd_setup_basic_desc(&desc, HCLGEVF_OPC_MBX_PF_TO_VF, false); +-- +2.35.1 + diff --git a/queue-5.4/net-smc-sync-err-code-when-tcp-connection-was-refuse.patch b/queue-5.4/net-smc-sync-err-code-when-tcp-connection-was-refuse.patch new file mode 100644 index 00000000000..570c4012788 --- /dev/null +++ b/queue-5.4/net-smc-sync-err-code-when-tcp-connection-was-refuse.patch @@ -0,0 +1,41 @@ +From ebdb72dc77b91ae97e523bac3114df18d56b8333 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 21 Apr 2022 17:40:27 +0800 +Subject: net/smc: sync err code when tcp connection was refused + +From: liuyacan + +[ Upstream commit 4e2e65e2e56c6ceb4ea1719360080c0af083229e ] + +In the current implementation, when TCP initiates a connection +to an unavailable [ip,port], ECONNREFUSED will be stored in the +TCP socket, but SMC will not. However, some apps (like curl) use +getsockopt(,,SO_ERROR,,) to get the error information, which makes +them miss the error message and behave strangely. + +Fixes: 50717a37db03 ("net/smc: nonblocking connect rework") +Signed-off-by: liuyacan +Reviewed-by: Tony Lu +Acked-by: Karsten Graul +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + net/smc/af_smc.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c +index 5221092cc66d..a5a8cca46bd5 100644 +--- a/net/smc/af_smc.c ++++ b/net/smc/af_smc.c +@@ -816,6 +816,8 @@ static void smc_connect_work(struct work_struct *work) + smc->sk.sk_state = SMC_CLOSED; + if (rc == -EPIPE || rc == -EAGAIN) + smc->sk.sk_err = EPIPE; ++ else if (rc == -ECONNREFUSED) ++ smc->sk.sk_err = ECONNREFUSED; + else if (signal_pending(current)) + smc->sk.sk_err = -sock_intr_errno(timeo); + sock_put(&smc->sk); /* passive closing */ +-- +2.35.1 + diff --git a/queue-5.4/phy-mapphone-mdm6600-fix-pm-error-handling-in-phy_md.patch b/queue-5.4/phy-mapphone-mdm6600-fix-pm-error-handling-in-phy_md.patch new file mode 100644 index 00000000000..e5128a77a2c --- /dev/null +++ b/queue-5.4/phy-mapphone-mdm6600-fix-pm-error-handling-in-phy_md.patch @@ -0,0 +1,46 @@ +From caf80a2d4178a655cf040696896d7db38228c447 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 1 Mar 2022 02:46:11 +0000 +Subject: phy: mapphone-mdm6600: Fix PM error handling in phy_mdm6600_probe + +From: Miaoqian Lin + +[ Upstream commit d644e0d79829b1b9a14beedbdb0dc1256fc3677d ] + +The pm_runtime_enable will increase power disable depth. +If the probe fails, we should use pm_runtime_disable() to balance +pm_runtime_enable(). And use pm_runtime_dont_use_autosuspend() to +undo pm_runtime_use_autosuspend() +In the PM Runtime docs: + Drivers in ->remove() callback should undo the runtime PM changes done + in ->probe(). Usually this means calling pm_runtime_disable(), + pm_runtime_dont_use_autosuspend() etc. + +We should do this in error handling. + +Fixes: f7f50b2a7b05 ("phy: mapphone-mdm6600: Add runtime PM support for n_gsm on USB suspend") +Signed-off-by: Miaoqian Lin +Link: https://lore.kernel.org/r/20220301024615.31899-1-linmq006@gmail.com +Signed-off-by: Vinod Koul +Signed-off-by: Sasha Levin +--- + drivers/phy/motorola/phy-mapphone-mdm6600.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/phy/motorola/phy-mapphone-mdm6600.c b/drivers/phy/motorola/phy-mapphone-mdm6600.c +index 94a34cf75eb3..39d13f7e4cf3 100644 +--- a/drivers/phy/motorola/phy-mapphone-mdm6600.c ++++ b/drivers/phy/motorola/phy-mapphone-mdm6600.c +@@ -628,7 +628,8 @@ static int phy_mdm6600_probe(struct platform_device *pdev) + cleanup: + if (error < 0) + phy_mdm6600_device_power_off(ddata); +- ++ pm_runtime_disable(ddata->dev); ++ pm_runtime_dont_use_autosuspend(ddata->dev); + return error; + } + +-- +2.35.1 + diff --git a/queue-5.4/phy-samsung-exynos5250-sata-fix-missing-device-put-i.patch b/queue-5.4/phy-samsung-exynos5250-sata-fix-missing-device-put-i.patch new file mode 100644 index 00000000000..9b795c25cae --- /dev/null +++ b/queue-5.4/phy-samsung-exynos5250-sata-fix-missing-device-put-i.patch @@ -0,0 +1,77 @@ +From c76c9a5b4e99d14b97b83ee923d2bf83a8eab975 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 7 Apr 2022 11:18:57 +0200 +Subject: phy: samsung: exynos5250-sata: fix missing device put in probe error + paths + +From: Krzysztof Kozlowski + +[ Upstream commit 5c8402c4db45dd55c2c93c8d730f5dfa7c78a702 ] + +The actions of of_find_i2c_device_by_node() in probe function should be +reversed in error paths by putting the reference to obtained device. + +Fixes: bcff4cba41bc ("PHY: Exynos: Add Exynos5250 SATA PHY driver") +Signed-off-by: Krzysztof Kozlowski +Reviewed-by: Alim Akhtar +Link: https://lore.kernel.org/r/20220407091857.230386-2-krzysztof.kozlowski@linaro.org +Signed-off-by: Vinod Koul +Signed-off-by: Sasha Levin +--- + drivers/phy/samsung/phy-exynos5250-sata.c | 20 ++++++++++++++------ + 1 file changed, 14 insertions(+), 6 deletions(-) + +diff --git a/drivers/phy/samsung/phy-exynos5250-sata.c b/drivers/phy/samsung/phy-exynos5250-sata.c +index 5077987570fd..ea46576404b8 100644 +--- a/drivers/phy/samsung/phy-exynos5250-sata.c ++++ b/drivers/phy/samsung/phy-exynos5250-sata.c +@@ -199,20 +199,21 @@ static int exynos_sata_phy_probe(struct platform_device *pdev) + sata_phy->phyclk = devm_clk_get(dev, "sata_phyctrl"); + if (IS_ERR(sata_phy->phyclk)) { + dev_err(dev, "failed to get clk for PHY\n"); +- return PTR_ERR(sata_phy->phyclk); ++ ret = PTR_ERR(sata_phy->phyclk); ++ goto put_dev; + } + + ret = clk_prepare_enable(sata_phy->phyclk); + if (ret < 0) { + dev_err(dev, "failed to enable source clk\n"); +- return ret; ++ goto put_dev; + } + + sata_phy->phy = devm_phy_create(dev, NULL, &exynos_sata_phy_ops); + if (IS_ERR(sata_phy->phy)) { +- clk_disable_unprepare(sata_phy->phyclk); + dev_err(dev, "failed to create PHY\n"); +- return PTR_ERR(sata_phy->phy); ++ ret = PTR_ERR(sata_phy->phy); ++ goto clk_disable; + } + + phy_set_drvdata(sata_phy->phy, sata_phy); +@@ -220,11 +221,18 @@ static int exynos_sata_phy_probe(struct platform_device *pdev) + phy_provider = devm_of_phy_provider_register(dev, + of_phy_simple_xlate); + if (IS_ERR(phy_provider)) { +- clk_disable_unprepare(sata_phy->phyclk); +- return PTR_ERR(phy_provider); ++ ret = PTR_ERR(phy_provider); ++ goto clk_disable; + } + + return 0; ++ ++clk_disable: ++ clk_disable_unprepare(sata_phy->phyclk); ++put_dev: ++ put_device(&sata_phy->client->dev); ++ ++ return ret; + } + + static const struct of_device_id exynos_sata_phy_of_match[] = { +-- +2.35.1 + diff --git a/queue-5.4/phy-samsung-fix-missing-of_node_put-in-exynos_sata_p.patch b/queue-5.4/phy-samsung-fix-missing-of_node_put-in-exynos_sata_p.patch new file mode 100644 index 00000000000..5362dd28021 --- /dev/null +++ b/queue-5.4/phy-samsung-fix-missing-of_node_put-in-exynos_sata_p.patch @@ -0,0 +1,38 @@ +From e627b1d60275ea3286ed2c1b92f04c3534e9de4c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 7 Apr 2022 11:18:56 +0200 +Subject: phy: samsung: Fix missing of_node_put() in exynos_sata_phy_probe + +From: Miaoqian Lin + +[ Upstream commit 388ec8f079f2f20d5cd183c3bc6f33cbc3ffd3ef ] + +The device_node pointer is returned by of_parse_phandle() with refcount +incremented. We should use of_node_put() on it when done. + +Fixes: bcff4cba41bc ("PHY: Exynos: Add Exynos5250 SATA PHY driver") +Signed-off-by: Miaoqian Lin +Reviewed-by: Krzysztof Kozlowski +Signed-off-by: Krzysztof Kozlowski +Link: https://lore.kernel.org/r/20220407091857.230386-1-krzysztof.kozlowski@linaro.org +Signed-off-by: Vinod Koul +Signed-off-by: Sasha Levin +--- + drivers/phy/samsung/phy-exynos5250-sata.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/phy/samsung/phy-exynos5250-sata.c b/drivers/phy/samsung/phy-exynos5250-sata.c +index 4dd7324d91b2..5077987570fd 100644 +--- a/drivers/phy/samsung/phy-exynos5250-sata.c ++++ b/drivers/phy/samsung/phy-exynos5250-sata.c +@@ -190,6 +190,7 @@ static int exynos_sata_phy_probe(struct platform_device *pdev) + return -EINVAL; + + sata_phy->client = of_find_i2c_device_by_node(node); ++ of_node_put(node); + if (!sata_phy->client) + return -EPROBE_DEFER; + +-- +2.35.1 + diff --git a/queue-5.4/phy-ti-add-missing-pm_runtime_disable-in-serdes_am65.patch b/queue-5.4/phy-ti-add-missing-pm_runtime_disable-in-serdes_am65.patch new file mode 100644 index 00000000000..d6a319d3be4 --- /dev/null +++ b/queue-5.4/phy-ti-add-missing-pm_runtime_disable-in-serdes_am65.patch @@ -0,0 +1,39 @@ +From 296bcb40cbd41b5c39622d7e7e4920e2d3ce07f1 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 1 Mar 2022 02:58:49 +0000 +Subject: phy: ti: Add missing pm_runtime_disable() in serdes_am654_probe + +From: Miaoqian Lin + +[ Upstream commit ce88613e5bd579478653a028291098143f2a5bdf ] + +The pm_runtime_enable() will increase power disable depth. +If the probe fails, we should use pm_runtime_disable() to balance +pm_runtime_enable(). +Add missing pm_runtime_disable() for serdes_am654_probe(). + +Fixes: 71e2f5c5c224 ("phy: ti: Add a new SERDES driver for TI's AM654x SoC") +Signed-off-by: Miaoqian Lin +Link: https://lore.kernel.org/r/20220301025853.1911-1-linmq006@gmail.com +Signed-off-by: Vinod Koul +Signed-off-by: Sasha Levin +--- + drivers/phy/ti/phy-am654-serdes.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/phy/ti/phy-am654-serdes.c b/drivers/phy/ti/phy-am654-serdes.c +index 6ef12017ff4e..96e3426f9293 100644 +--- a/drivers/phy/ti/phy-am654-serdes.c ++++ b/drivers/phy/ti/phy-am654-serdes.c +@@ -641,7 +641,7 @@ static int serdes_am654_probe(struct platform_device *pdev) + + clk_err: + of_clk_del_provider(node); +- ++ pm_runtime_disable(dev); + return ret; + } + +-- +2.35.1 + diff --git a/queue-5.4/phy-ti-omap-usb2-fix-error-handling-in-omap_usb2_ena.patch b/queue-5.4/phy-ti-omap-usb2-fix-error-handling-in-omap_usb2_ena.patch new file mode 100644 index 00000000000..1c6fd8905e9 --- /dev/null +++ b/queue-5.4/phy-ti-omap-usb2-fix-error-handling-in-omap_usb2_ena.patch @@ -0,0 +1,38 @@ +From a98ff501e7ea4dfc51c41a5d794297b5ebbd858b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 18 Mar 2022 10:57:46 +0000 +Subject: phy: ti: omap-usb2: Fix error handling in omap_usb2_enable_clocks + +From: Miaoqian Lin + +[ Upstream commit 3588060befff75ff39fab7122b94c6fb3148fcda ] + +The corresponding API for clk_prepare_enable is clk_disable_unprepare. +Make sure that the clock is unprepared on exit by changing clk_disable +to clk_disable_unprepare. + +Fixes: ed31ee7cf1fe ("phy: ti: usb2: Fix logic on -EPROBE_DEFER") +Signed-off-by: Miaoqian Lin +Link: https://lore.kernel.org/r/20220318105748.19532-1-linmq006@gmail.com +Signed-off-by: Vinod Koul +Signed-off-by: Sasha Levin +--- + drivers/phy/ti/phy-omap-usb2.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/phy/ti/phy-omap-usb2.c b/drivers/phy/ti/phy-omap-usb2.c +index 3d74629d7423..471fe2e80f4e 100644 +--- a/drivers/phy/ti/phy-omap-usb2.c ++++ b/drivers/phy/ti/phy-omap-usb2.c +@@ -157,7 +157,7 @@ static int omap_usb2_enable_clocks(struct omap_usb *phy) + return 0; + + err1: +- clk_disable(phy->wkupclk); ++ clk_disable_unprepare(phy->wkupclk); + + err0: + return ret; +-- +2.35.1 + diff --git a/queue-5.4/pinctrl-pistachio-fix-use-of-irq_of_parse_and_map.patch b/queue-5.4/pinctrl-pistachio-fix-use-of-irq_of_parse_and_map.patch new file mode 100644 index 00000000000..4d7b03e3d41 --- /dev/null +++ b/queue-5.4/pinctrl-pistachio-fix-use-of-irq_of_parse_and_map.patch @@ -0,0 +1,43 @@ +From ab5188c4279b2383fa14765cf24526975f4165f8 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 24 Apr 2022 03:14:30 +0000 +Subject: pinctrl: pistachio: fix use of irq_of_parse_and_map() + +From: Lv Ruyi + +[ Upstream commit 0c9843a74a85224a89daa81fa66891dae2f930e1 ] + +The irq_of_parse_and_map() function returns 0 on failure, and does not +return an negative value. + +Fixes: cefc03e5995e ("pinctrl: Add Pistachio SoC pin control driver") +Reported-by: Zeal Robot +Signed-off-by: Lv Ruyi +Link: https://lore.kernel.org/r/20220424031430.3170759-1-lv.ruyi@zte.com.cn +Signed-off-by: Linus Walleij +Signed-off-by: Sasha Levin +--- + drivers/pinctrl/pinctrl-pistachio.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/drivers/pinctrl/pinctrl-pistachio.c b/drivers/pinctrl/pinctrl-pistachio.c +index 379e9a6a6d89..5f381e4c7577 100644 +--- a/drivers/pinctrl/pinctrl-pistachio.c ++++ b/drivers/pinctrl/pinctrl-pistachio.c +@@ -1370,10 +1370,10 @@ static int pistachio_gpio_register(struct pistachio_pinctrl *pctl) + } + + irq = irq_of_parse_and_map(child, 0); +- if (irq < 0) { +- dev_err(pctl->dev, "No IRQ for bank %u: %d\n", i, irq); ++ if (!irq) { ++ dev_err(pctl->dev, "No IRQ for bank %u\n", i); + of_node_put(child); +- ret = irq; ++ ret = -EINVAL; + goto err; + } + +-- +2.35.1 + diff --git a/queue-5.4/sctp-check-asoc-strreset_chunk-in-sctp_generate_reco.patch b/queue-5.4/sctp-check-asoc-strreset_chunk-in-sctp_generate_reco.patch new file mode 100644 index 00000000000..dcbebeb76cf --- /dev/null +++ b/queue-5.4/sctp-check-asoc-strreset_chunk-in-sctp_generate_reco.patch @@ -0,0 +1,66 @@ +From c201f744de579e411c021163b8ac23a1d4b1d210 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 20 Apr 2022 16:52:41 -0400 +Subject: sctp: check asoc strreset_chunk in sctp_generate_reconf_event + +From: Xin Long + +[ Upstream commit 165e3e17fe8fe6a8aab319bc6e631a2e23b9a857 ] + +A null pointer reference issue can be triggered when the response of a +stream reconf request arrives after the timer is triggered, such as: + + send Incoming SSN Reset Request ---> + CPU0: + reconf timer is triggered, + go to the handler code before hold sk lock + <--- reply with Outgoing SSN Reset Request + CPU1: + process Outgoing SSN Reset Request, + and set asoc->strreset_chunk to NULL + CPU0: + continue the handler code, hold sk lock, + and try to hold asoc->strreset_chunk, crash! + +In Ying Xu's testing, the call trace is: + + [ ] BUG: kernel NULL pointer dereference, address: 0000000000000010 + [ ] RIP: 0010:sctp_chunk_hold+0xe/0x40 [sctp] + [ ] Call Trace: + [ ] + [ ] sctp_sf_send_reconf+0x2c/0x100 [sctp] + [ ] sctp_do_sm+0xa4/0x220 [sctp] + [ ] sctp_generate_reconf_event+0xbd/0xe0 [sctp] + [ ] call_timer_fn+0x26/0x130 + +This patch is to fix it by returning from the timer handler if asoc +strreset_chunk is already set to NULL. + +Fixes: 7b9438de0cd4 ("sctp: add stream reconf timer") +Reported-by: Ying Xu +Signed-off-by: Xin Long +Acked-by: Marcelo Ricardo Leitner +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + net/sctp/sm_sideeffect.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c +index 0d225f891b61..8d32229199b9 100644 +--- a/net/sctp/sm_sideeffect.c ++++ b/net/sctp/sm_sideeffect.c +@@ -458,6 +458,10 @@ void sctp_generate_reconf_event(struct timer_list *t) + goto out_unlock; + } + ++ /* This happens when the response arrives after the timer is triggered. */ ++ if (!asoc->strreset_chunk) ++ goto out_unlock; ++ + error = sctp_do_sm(net, SCTP_EVENT_T_TIMEOUT, + SCTP_ST_TIMEOUT(SCTP_EVENT_TIMEOUT_RECONF), + asoc->state, asoc->ep, asoc, +-- +2.35.1 + diff --git a/queue-5.4/series b/queue-5.4/series index 68ee2f8b512..4b25096a848 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -26,3 +26,47 @@ serial-8250-correct-the-clock-for-endrun-ptp-1588-pcie-device.patch arch_topology-do-not-set-llc_sibling-if-llc_id-is-invalid.patch hex2bin-make-the-function-hex_to_bin-constant-time.patch hex2bin-fix-access-beyond-string-end.patch +video-fbdev-udlfb-properly-check-endpoint-type.patch +arm64-dts-meson-remove-cpu-opps-below-1ghz-for-g12b-.patch +arm64-dts-meson-remove-cpu-opps-below-1ghz-for-sm1-b.patch +mtd-rawnand-fix-ecc-parameters-for-mt7622.patch +usb-fix-xhci-event-ring-dequeue-pointer-erdp-update-.patch +arm-dts-imx6qdl-apalis-fix-sgtl5000-detection-issue.patch +phy-samsung-fix-missing-of_node_put-in-exynos_sata_p.patch +phy-samsung-exynos5250-sata-fix-missing-device-put-i.patch +arm-omap2-fix-refcount-leak-in-omap_gic_of_init.patch +phy-ti-omap-usb2-fix-error-handling-in-omap_usb2_ena.patch +arm-dts-at91-map-mclk-for-wm8731-on-at91sam9g20ek.patch +phy-mapphone-mdm6600-fix-pm-error-handling-in-phy_md.patch +phy-ti-add-missing-pm_runtime_disable-in-serdes_am65.patch +arm-dts-fix-mmc-order-for-omap3-gta04.patch +arm-dts-am3517-evm-fix-misc-pinmuxing.patch +arm-dts-logicpd-som-lv-fix-wrong-pinmuxing-on-omap35.patch +ipvs-correctly-print-the-memory-size-of-ip_vs_conn_t.patch +mtd-rawnand-fix-return-value-check-of-wait_for_compl.patch +bpf-lwt-fix-crash-when-using-bpf_skb_set_tunnel_key-.patch +tcp-md5-incorrect-tcp_header_len-for-incoming-connec.patch +tcp-ensure-to-use-the-most-recently-sent-skb-when-fi.patch +sctp-check-asoc-strreset_chunk-in-sctp_generate_reco.patch +arm-dts-imx6ull-colibri-fix-vqmmc-regulator.patch +arm64-dts-imx8mn-ddr4-evk-describe-the-32.768-khz-pm.patch +pinctrl-pistachio-fix-use-of-irq_of_parse_and_map.patch +cpufreq-fix-memory-leak-in-sun50i_cpufreq_nvmem_prob.patch +net-hns3-add-validity-check-for-message-data-length.patch +net-smc-sync-err-code-when-tcp-connection-was-refuse.patch +ip_gre-make-o_seqno-start-from-0-in-native-mode.patch +tcp-fix-potential-xmit-stalls-caused-by-tcp_notsent_.patch +bus-sunxi-rsb-fix-the-return-value-of-sunxi_rsb_devi.patch +clk-sunxi-sun9i-mmc-check-return-value-after-calling.patch +net-bcmgenet-hide-status-block-before-tx-timestampin.patch +net-dsa-lantiq_gswip-don-t-set-gswip_mii_cfg_rmii_cl.patch +drm-amd-display-fix-memory-leak-in-dcn21_clock_sourc.patch +tls-skip-tls_append_frag-on-zero-copy-size.patch +bnx2x-fix-napi-api-usage-sequence.patch +ixgbe-ensure-ipsec-vf-pf-compatibility.patch +tcp-fix-f-rto-may-not-work-correctly-when-receiving-.patch +asoc-wm8731-disable-the-regulator-when-probing-fails.patch +ip6_gre-avoid-updating-tunnel-tun_hlen-in-__gre6_xmi.patch +x86-__memcpy_flushcache-fix-wrong-alignment-if-size-.patch +cifs-destage-any-unwritten-data-to-the-server-before.patch +drivers-net-hippi-fix-deadlock-in-rr_close.patch diff --git a/queue-5.4/tcp-ensure-to-use-the-most-recently-sent-skb-when-fi.patch b/queue-5.4/tcp-ensure-to-use-the-most-recently-sent-skb-when-fi.patch new file mode 100644 index 00000000000..44567ed133d --- /dev/null +++ b/queue-5.4/tcp-ensure-to-use-the-most-recently-sent-skb-when-fi.patch @@ -0,0 +1,102 @@ +From 2bc9b51934319041023bd01bee63b8055599c77f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 20 Apr 2022 10:34:41 +0800 +Subject: tcp: ensure to use the most recently sent skb when filling the rate + sample + +From: Pengcheng Yang + +[ Upstream commit b253a0680ceadc5d7b4acca7aa2d870326cad8ad ] + +If an ACK (s)acks multiple skbs, we favor the information +from the most recently sent skb by choosing the skb with +the highest prior_delivered count. But in the interval +between receiving ACKs, we send multiple skbs with the same +prior_delivered, because the tp->delivered only changes +when we receive an ACK. + +We used RACK's solution, copying tcp_rack_sent_after() as +tcp_skb_sent_after() helper to determine "which packet was +sent last?". Later, we will use tcp_skb_sent_after() instead +in RACK. + +Fixes: b9f64820fb22 ("tcp: track data delivery rate for a TCP connection") +Signed-off-by: Pengcheng Yang +Cc: Paolo Abeni +Acked-by: Neal Cardwell +Tested-by: Neal Cardwell +Reviewed-by: Eric Dumazet +Link: https://lore.kernel.org/r/1650422081-22153-1-git-send-email-yangpc@wangsu.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + include/net/tcp.h | 6 ++++++ + net/ipv4/tcp_rate.c | 11 ++++++++--- + 2 files changed, 14 insertions(+), 3 deletions(-) + +diff --git a/include/net/tcp.h b/include/net/tcp.h +index b914959cd2c6..b686a21a8593 100644 +--- a/include/net/tcp.h ++++ b/include/net/tcp.h +@@ -1030,6 +1030,7 @@ struct rate_sample { + int losses; /* number of packets marked lost upon ACK */ + u32 acked_sacked; /* number of packets newly (S)ACKed upon ACK */ + u32 prior_in_flight; /* in flight before this ACK */ ++ u32 last_end_seq; /* end_seq of most recently ACKed packet */ + bool is_app_limited; /* is sample from packet with bubble in pipe? */ + bool is_retrans; /* is sample from retransmission? */ + bool is_ack_delayed; /* is this (likely) a delayed ACK? */ +@@ -1139,6 +1140,11 @@ void tcp_rate_gen(struct sock *sk, u32 delivered, u32 lost, + bool is_sack_reneg, struct rate_sample *rs); + void tcp_rate_check_app_limited(struct sock *sk); + ++static inline bool tcp_skb_sent_after(u64 t1, u64 t2, u32 seq1, u32 seq2) ++{ ++ return t1 > t2 || (t1 == t2 && after(seq1, seq2)); ++} ++ + /* These functions determine how the current flow behaves in respect of SACK + * handling. SACK is negotiated with the peer, and therefore it can vary + * between different flows. +diff --git a/net/ipv4/tcp_rate.c b/net/ipv4/tcp_rate.c +index 0de693565963..6ab197928abb 100644 +--- a/net/ipv4/tcp_rate.c ++++ b/net/ipv4/tcp_rate.c +@@ -73,26 +73,31 @@ void tcp_rate_skb_sent(struct sock *sk, struct sk_buff *skb) + * + * If an ACK (s)acks multiple skbs (e.g., stretched-acks), this function is + * called multiple times. We favor the information from the most recently +- * sent skb, i.e., the skb with the highest prior_delivered count. ++ * sent skb, i.e., the skb with the most recently sent time and the highest ++ * sequence. + */ + void tcp_rate_skb_delivered(struct sock *sk, struct sk_buff *skb, + struct rate_sample *rs) + { + struct tcp_sock *tp = tcp_sk(sk); + struct tcp_skb_cb *scb = TCP_SKB_CB(skb); ++ u64 tx_tstamp; + + if (!scb->tx.delivered_mstamp) + return; + ++ tx_tstamp = tcp_skb_timestamp_us(skb); + if (!rs->prior_delivered || +- after(scb->tx.delivered, rs->prior_delivered)) { ++ tcp_skb_sent_after(tx_tstamp, tp->first_tx_mstamp, ++ scb->end_seq, rs->last_end_seq)) { + rs->prior_delivered = scb->tx.delivered; + rs->prior_mstamp = scb->tx.delivered_mstamp; + rs->is_app_limited = scb->tx.is_app_limited; + rs->is_retrans = scb->sacked & TCPCB_RETRANS; ++ rs->last_end_seq = scb->end_seq; + + /* Record send time of most recently ACKed packet: */ +- tp->first_tx_mstamp = tcp_skb_timestamp_us(skb); ++ tp->first_tx_mstamp = tx_tstamp; + /* Find the duration of the "send phase" of this window: */ + rs->interval_us = tcp_stamp_us_delta(tp->first_tx_mstamp, + scb->tx.first_tx_mstamp); +-- +2.35.1 + diff --git a/queue-5.4/tcp-fix-f-rto-may-not-work-correctly-when-receiving-.patch b/queue-5.4/tcp-fix-f-rto-may-not-work-correctly-when-receiving-.patch new file mode 100644 index 00000000000..4161c994ccf --- /dev/null +++ b/queue-5.4/tcp-fix-f-rto-may-not-work-correctly-when-receiving-.patch @@ -0,0 +1,88 @@ +From cdcfde045cc316cbfdadde9c321aed1a4f4e43de Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 26 Apr 2022 18:03:39 +0800 +Subject: tcp: fix F-RTO may not work correctly when receiving DSACK + +From: Pengcheng Yang + +[ Upstream commit d9157f6806d1499e173770df1f1b234763de5c79 ] + +Currently DSACK is regarded as a dupack, which may cause +F-RTO to incorrectly enter "loss was real" when receiving +DSACK. + +Packetdrill to demonstrate: + +// Enable F-RTO and TLP + 0 `sysctl -q net.ipv4.tcp_frto=2` + 0 `sysctl -q net.ipv4.tcp_early_retrans=3` + 0 `sysctl -q net.ipv4.tcp_congestion_control=cubic` + +// Establish a connection + +0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3 + +0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0 + +0 bind(3, ..., ...) = 0 + +0 listen(3, 1) = 0 + +// RTT 10ms, RTO 210ms + +.1 < S 0:0(0) win 32792 + +0 > S. 0:0(0) ack 1 <...> + +.01 < . 1:1(0) ack 1 win 257 + +0 accept(3, ..., ...) = 4 + +// Send 2 data segments + +0 write(4, ..., 2000) = 2000 + +0 > P. 1:2001(2000) ack 1 + +// TLP ++.022 > P. 1001:2001(1000) ack 1 + +// Continue to send 8 data segments + +0 write(4, ..., 10000) = 10000 + +0 > P. 2001:10001(8000) ack 1 + +// RTO ++.188 > . 1:1001(1000) ack 1 + +// The original data is acked and new data is sent(F-RTO step 2.b) + +0 < . 1:1(0) ack 2001 win 257 + +0 > P. 10001:12001(2000) ack 1 + +// D-SACK caused by TLP is regarded as a dupack, this results in +// the incorrect judgment of "loss was real"(F-RTO step 3.a) ++.022 < . 1:1(0) ack 2001 win 257 + +// Never-retransmitted data(3001:4001) are acked and +// expect to switch to open state(F-RTO step 3.b) + +0 < . 1:1(0) ack 4001 win 257 ++0 %{ assert tcpi_ca_state == 0, tcpi_ca_state }% + +Fixes: e33099f96d99 ("tcp: implement RFC5682 F-RTO") +Signed-off-by: Pengcheng Yang +Acked-by: Neal Cardwell +Tested-by: Neal Cardwell +Reviewed-by: Eric Dumazet +Link: https://lore.kernel.org/r/1650967419-2150-1-git-send-email-yangpc@wangsu.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + net/ipv4/tcp_input.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c +index f84047aec63c..b0e6fc2c5e10 100644 +--- a/net/ipv4/tcp_input.c ++++ b/net/ipv4/tcp_input.c +@@ -3717,7 +3717,8 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag) + tcp_process_tlp_ack(sk, ack, flag); + + if (tcp_ack_is_dubious(sk, flag)) { +- if (!(flag & (FLAG_SND_UNA_ADVANCED | FLAG_NOT_DUP))) { ++ if (!(flag & (FLAG_SND_UNA_ADVANCED | ++ FLAG_NOT_DUP | FLAG_DSACKING_ACK))) { + num_dupack = 1; + /* Consider if pure acks were aggregated in tcp_add_backlog() */ + if (!(flag & FLAG_DATA)) +-- +2.35.1 + diff --git a/queue-5.4/tcp-fix-potential-xmit-stalls-caused-by-tcp_notsent_.patch b/queue-5.4/tcp-fix-potential-xmit-stalls-caused-by-tcp_notsent_.patch new file mode 100644 index 00000000000..dcbffe5a8c8 --- /dev/null +++ b/queue-5.4/tcp-fix-potential-xmit-stalls-caused-by-tcp_notsent_.patch @@ -0,0 +1,145 @@ +From e153c93fc5dce48c66435cda16a4f589a57d179e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 24 Apr 2022 17:34:07 -0700 +Subject: tcp: fix potential xmit stalls caused by TCP_NOTSENT_LOWAT + +From: Eric Dumazet + +[ Upstream commit 4bfe744ff1644fbc0a991a2677dc874475dd6776 ] + +I had this bug sitting for too long in my pile, it is time to fix it. + +Thanks to Doug Porter for reminding me of it! + +We had various attempts in the past, including commit +0cbe6a8f089e ("tcp: remove SOCK_QUEUE_SHRUNK"), +but the issue is that TCP stack currently only generates +EPOLLOUT from input path, when tp->snd_una has advanced +and skb(s) cleaned from rtx queue. + +If a flow has a big RTT, and/or receives SACKs, it is possible +that the notsent part (tp->write_seq - tp->snd_nxt) reaches 0 +and no more data can be sent until tp->snd_una finally advances. + +What is needed is to also check if POLLOUT needs to be generated +whenever tp->snd_nxt is advanced, from output path. + +This bug triggers more often after an idle period, as +we do not receive ACK for at least one RTT. tcp_notsent_lowat +could be a fraction of what CWND and pacing rate would allow to +send during this RTT. + +In a followup patch, I will remove the bogus call +to tcp_chrono_stop(sk, TCP_CHRONO_SNDBUF_LIMITED) +from tcp_check_space(). Fact that we have decided to generate +an EPOLLOUT does not mean the application has immediately +refilled the transmit queue. This optimistic call +might have been the reason the bug seemed not too serious. + +Tested: + +200 ms rtt, 1% packet loss, 32 MB tcp_rmem[2] and tcp_wmem[2] + +$ echo 500000 >/proc/sys/net/ipv4/tcp_notsent_lowat +$ cat bench_rr.sh +SUM=0 +for i in {1..10} +do + V=`netperf -H remote_host -l30 -t TCP_RR -- -r 10000000,10000 -o LOCAL_BYTES_SENT | egrep -v "MIGRATED|Bytes"` + echo $V + SUM=$(($SUM + $V)) +done +echo SUM=$SUM + +Before patch: +$ bench_rr.sh +130000000 +80000000 +140000000 +140000000 +140000000 +140000000 +130000000 +40000000 +90000000 +110000000 +SUM=1140000000 + +After patch: +$ bench_rr.sh +430000000 +590000000 +530000000 +450000000 +450000000 +350000000 +450000000 +490000000 +480000000 +460000000 +SUM=4680000000 # This is 410 % of the value before patch. + +Fixes: c9bee3b7fdec ("tcp: TCP_NOTSENT_LOWAT socket option") +Signed-off-by: Eric Dumazet +Reported-by: Doug Porter +Cc: Soheil Hassas Yeganeh +Cc: Neal Cardwell +Acked-by: Soheil Hassas Yeganeh +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + include/net/tcp.h | 1 + + net/ipv4/tcp_input.c | 12 +++++++++++- + net/ipv4/tcp_output.c | 1 + + 3 files changed, 13 insertions(+), 1 deletion(-) + +diff --git a/include/net/tcp.h b/include/net/tcp.h +index b686a21a8593..9237362e5606 100644 +--- a/include/net/tcp.h ++++ b/include/net/tcp.h +@@ -603,6 +603,7 @@ void tcp_synack_rtt_meas(struct sock *sk, struct request_sock *req); + void tcp_reset(struct sock *sk); + void tcp_skb_mark_lost_uncond_verify(struct tcp_sock *tp, struct sk_buff *skb); + void tcp_fin(struct sock *sk); ++void tcp_check_space(struct sock *sk); + + /* tcp_timer.c */ + void tcp_init_xmit_timers(struct sock *); +diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c +index c0fcfa296468..f84047aec63c 100644 +--- a/net/ipv4/tcp_input.c ++++ b/net/ipv4/tcp_input.c +@@ -5230,7 +5230,17 @@ static void tcp_new_space(struct sock *sk) + sk->sk_write_space(sk); + } + +-static void tcp_check_space(struct sock *sk) ++/* Caller made space either from: ++ * 1) Freeing skbs in rtx queues (after tp->snd_una has advanced) ++ * 2) Sent skbs from output queue (and thus advancing tp->snd_nxt) ++ * ++ * We might be able to generate EPOLLOUT to the application if: ++ * 1) Space consumed in output/rtx queues is below sk->sk_sndbuf/2 ++ * 2) notsent amount (tp->write_seq - tp->snd_nxt) became ++ * small enough that tcp_stream_memory_free() decides it ++ * is time to generate EPOLLOUT. ++ */ ++void tcp_check_space(struct sock *sk) + { + if (sock_flag(sk, SOCK_QUEUE_SHRUNK)) { + sock_reset_flag(sk, SOCK_QUEUE_SHRUNK); +diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c +index 139e962d1aef..67493ec6318a 100644 +--- a/net/ipv4/tcp_output.c ++++ b/net/ipv4/tcp_output.c +@@ -81,6 +81,7 @@ static void tcp_event_new_data_sent(struct sock *sk, struct sk_buff *skb) + + NET_ADD_STATS(sock_net(sk), LINUX_MIB_TCPORIGDATASENT, + tcp_skb_pcount(skb)); ++ tcp_check_space(sk); + } + + /* SND.NXT, if window was not shrunk or the amount of shrunk was less than one +-- +2.35.1 + diff --git a/queue-5.4/tcp-md5-incorrect-tcp_header_len-for-incoming-connec.patch b/queue-5.4/tcp-md5-incorrect-tcp_header_len-for-incoming-connec.patch new file mode 100644 index 00000000000..fe01230f35b --- /dev/null +++ b/queue-5.4/tcp-md5-incorrect-tcp_header_len-for-incoming-connec.patch @@ -0,0 +1,40 @@ +From 23163966df06cae4b694f2b33d710030021f6932 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 20 Apr 2022 17:50:26 -0700 +Subject: tcp: md5: incorrect tcp_header_len for incoming connections + +From: Francesco Ruggeri + +[ Upstream commit 5b0b9e4c2c895227c8852488b3f09839233bba54 ] + +In tcp_create_openreq_child we adjust tcp_header_len for md5 using the +remote address in newsk. But that address is still 0 in newsk at this +point, and it is only set later by the callers (tcp_v[46]_syn_recv_sock). +Use the address from the request socket instead. + +Fixes: cfb6eeb4c860 ("[TCP]: MD5 Signature Option (RFC2385) support.") +Signed-off-by: Francesco Ruggeri +Reviewed-by: Eric Dumazet +Link: https://lore.kernel.org/r/20220421005026.686A45EC01F2@us226.sjc.aristanetworks.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + net/ipv4/tcp_minisocks.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c +index 194743bd3fc1..9b038cb0a43d 100644 +--- a/net/ipv4/tcp_minisocks.c ++++ b/net/ipv4/tcp_minisocks.c +@@ -538,7 +538,7 @@ struct sock *tcp_create_openreq_child(const struct sock *sk, + newtp->tsoffset = treq->ts_off; + #ifdef CONFIG_TCP_MD5SIG + newtp->md5sig_info = NULL; /*XXX*/ +- if (newtp->af_specific->md5_lookup(sk, newsk)) ++ if (treq->af_specific->req_md5_lookup(sk, req_to_sk(req))) + newtp->tcp_header_len += TCPOLEN_MD5SIG_ALIGNED; + #endif + if (skb->len >= TCP_MSS_DEFAULT + newtp->tcp_header_len) +-- +2.35.1 + diff --git a/queue-5.4/tls-skip-tls_append_frag-on-zero-copy-size.patch b/queue-5.4/tls-skip-tls_append_frag-on-zero-copy-size.patch new file mode 100644 index 00000000000..0a3c6e84aa0 --- /dev/null +++ b/queue-5.4/tls-skip-tls_append_frag-on-zero-copy-size.patch @@ -0,0 +1,59 @@ +From 700bf6a91f6f3d7572c918f7df64aeda79325ff6 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 26 Apr 2022 18:49:49 +0300 +Subject: tls: Skip tls_append_frag on zero copy size + +From: Maxim Mikityanskiy + +[ Upstream commit a0df71948e9548de819a6f1da68f5f1742258a52 ] + +Calling tls_append_frag when max_open_record_len == record->len might +add an empty fragment to the TLS record if the call happens to be on the +page boundary. Normally tls_append_frag coalesces the zero-sized +fragment to the previous one, but not if it's on page boundary. + +If a resync happens then, the mlx5 driver posts dump WQEs in +tx_post_resync_dump, and the empty fragment may become a data segment +with byte_count == 0, which will confuse the NIC and lead to a CQE +error. + +This commit fixes the described issue by skipping tls_append_frag on +zero size to avoid adding empty fragments. The fix is not in the driver, +because an empty fragment is hardly the desired behavior. + +Fixes: e8f69799810c ("net/tls: Add generic NIC offload infrastructure") +Signed-off-by: Maxim Mikityanskiy +Reviewed-by: Tariq Toukan +Link: https://lore.kernel.org/r/20220426154949.159055-1-maximmi@nvidia.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + net/tls/tls_device.c | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +diff --git a/net/tls/tls_device.c b/net/tls/tls_device.c +index 0f034c3bc37d..abb93f7343c5 100644 +--- a/net/tls/tls_device.c ++++ b/net/tls/tls_device.c +@@ -470,11 +470,13 @@ static int tls_push_data(struct sock *sk, + copy = min_t(size_t, size, (pfrag->size - pfrag->offset)); + copy = min_t(size_t, copy, (max_open_record_len - record->len)); + +- rc = tls_device_copy_data(page_address(pfrag->page) + +- pfrag->offset, copy, msg_iter); +- if (rc) +- goto handle_error; +- tls_append_frag(record, pfrag, copy); ++ if (copy) { ++ rc = tls_device_copy_data(page_address(pfrag->page) + ++ pfrag->offset, copy, msg_iter); ++ if (rc) ++ goto handle_error; ++ tls_append_frag(record, pfrag, copy); ++ } + + size -= copy; + if (!size) { +-- +2.35.1 + diff --git a/queue-5.4/usb-fix-xhci-event-ring-dequeue-pointer-erdp-update-.patch b/queue-5.4/usb-fix-xhci-event-ring-dequeue-pointer-erdp-update-.patch new file mode 100644 index 00000000000..e9caff710ee --- /dev/null +++ b/queue-5.4/usb-fix-xhci-event-ring-dequeue-pointer-erdp-update-.patch @@ -0,0 +1,65 @@ +From 815e240645ed3a1c85f135209013b8ae11fbd2df Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 8 Apr 2022 16:48:21 +0300 +Subject: USB: Fix xhci event ring dequeue pointer ERDP update issue + +From: Weitao Wang + +[ Upstream commit e91ac20889d1a26d077cc511365cd7ff4346a6f3 ] + +In some situations software handles TRB events slower than adding TRBs. +If the number of TRB events to be processed in a given interrupt is exactly +the same as the event ring size 256, then the local variable +"event_ring_deq" that holds the initial dequeue position is equal to +software_dequeue after handling all 256 interrupts. + +It will cause driver to not update ERDP to hardware, + +Software dequeue pointer is out of sync with ERDP on interrupt exit. +On the next interrupt, the event ring may full but driver will not +update ERDP as software_dequeue is equal to ERDP. + +[ 536.377115] xhci_hcd 0000:00:12.0: ERROR unknown event type 37 +[ 566.933173] sd 8:0:0:0: [sdb] tag#27 uas_eh_abort_handler 0 uas-tag 7 inflight: CMD OUT +[ 566.933181] sd 8:0:0:0: [sdb] tag#27 CDB: Write(10) 2a 00 17 71 e6 78 00 00 08 00 +[ 572.041186] xhci_hcd On some situataions,the0000:00:12.0: xHCI host not responding to stop endpoint command. +[ 572.057193] xhci_hcd 0000:00:12.0: Host halt failed, -110 +[ 572.057196] xhci_hcd 0000:00:12.0: xHCI host controller not responding, assume dead +[ 572.057236] sd 8:0:0:0: [sdb] tag#26 uas_eh_abort_handler 0 uas-tag 6 inflight: CMD +[ 572.057240] sd 8:0:0:0: [sdb] tag#26 CDB: Write(10) 2a 00 38 eb cc d8 00 00 08 00 +[ 572.057244] sd 8:0:0:0: [sdb] tag#25 uas_eh_abort_handler 0 uas-tag 5 inflight: CMD + +Hardware ERDP is updated mid event handling if there are more than 128 +events in an interrupt (half of ring size). +Fix this by updating the software local variable at the same time as +hardware ERDP. + +[commit message rewording -Mathias] + +Fixes: dc0ffbea5729 ("usb: host: xhci: update event ring dequeue pointer on purpose") +Reviewed-by: Peter Chen +Signed-off-by: Weitao Wang +Signed-off-by: Mathias Nyman +Link: https://lore.kernel.org/r/20220408134823.2527272-2-mathias.nyman@linux.intel.com +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Sasha Levin +--- + drivers/usb/host/xhci-ring.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c +index 7fa27b403756..6cedae902adf 100644 +--- a/drivers/usb/host/xhci-ring.c ++++ b/drivers/usb/host/xhci-ring.c +@@ -2932,6 +2932,8 @@ irqreturn_t xhci_irq(struct usb_hcd *hcd) + if (event_loop++ < TRBS_PER_SEGMENT / 2) + continue; + xhci_update_erst_dequeue(xhci, event_ring_deq); ++ event_ring_deq = xhci->event_ring->dequeue; ++ + event_loop = 0; + } + +-- +2.35.1 + diff --git a/queue-5.4/video-fbdev-udlfb-properly-check-endpoint-type.patch b/queue-5.4/video-fbdev-udlfb-properly-check-endpoint-type.patch new file mode 100644 index 00000000000..b21da1bde7a --- /dev/null +++ b/queue-5.4/video-fbdev-udlfb-properly-check-endpoint-type.patch @@ -0,0 +1,92 @@ +From b75474cfd5a63f506a292eb540368569dfd3e7e1 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 22 Mar 2022 23:04:38 +0300 +Subject: video: fbdev: udlfb: properly check endpoint type + +From: Pavel Skripkin + +[ Upstream commit aaf7dbe07385e0b8deb7237eca2a79926bbc7091 ] + +syzbot reported warning in usb_submit_urb, which is caused by wrong +endpoint type. + +This driver uses out bulk endpoint for communication, so +let's check if this endpoint is present and bail out early if not. + +Fail log: + +usb 1-1: BOGUS urb xfer, pipe 3 != type 1 +WARNING: CPU: 0 PID: 4822 at drivers/usb/core/urb.c:493 usb_submit_urb+0xd27/0x1540 drivers/usb/core/urb.c:493 +Modules linked in: +CPU: 0 PID: 4822 Comm: kworker/0:3 Tainted: G W 5.13.0-syzkaller #0 +... +Workqueue: usb_hub_wq hub_event +RIP: 0010:usb_submit_urb+0xd27/0x1540 drivers/usb/core/urb.c:493 +... +Call Trace: + dlfb_submit_urb+0x89/0x160 drivers/video/fbdev/udlfb.c:1969 + dlfb_set_video_mode+0x21f0/0x2950 drivers/video/fbdev/udlfb.c:315 + dlfb_ops_set_par+0x2a3/0x840 drivers/video/fbdev/udlfb.c:1110 + dlfb_usb_probe.cold+0x113e/0x1f4a drivers/video/fbdev/udlfb.c:1732 + usb_probe_interface+0x315/0x7f0 drivers/usb/core/driver.c:396 + +Fixes: 88e58b1a42f8 ("Staging: add udlfb driver") +Reported-and-tested-by: syzbot+53ce4a4246d0fe0fee34@syzkaller.appspotmail.com +Signed-off-by: Pavel Skripkin +Signed-off-by: Helge Deller +Signed-off-by: Sasha Levin +--- + drivers/video/fbdev/udlfb.c | 14 ++++++++++++-- + 1 file changed, 12 insertions(+), 2 deletions(-) + +diff --git a/drivers/video/fbdev/udlfb.c b/drivers/video/fbdev/udlfb.c +index e269b1391e14..8e8af408998e 100644 +--- a/drivers/video/fbdev/udlfb.c ++++ b/drivers/video/fbdev/udlfb.c +@@ -1650,8 +1650,9 @@ static int dlfb_usb_probe(struct usb_interface *intf, + const struct device_attribute *attr; + struct dlfb_data *dlfb; + struct fb_info *info; +- int retval = -ENOMEM; ++ int retval; + struct usb_device *usbdev = interface_to_usbdev(intf); ++ struct usb_endpoint_descriptor *out; + + /* usb initialization */ + dlfb = kzalloc(sizeof(*dlfb), GFP_KERNEL); +@@ -1665,6 +1666,12 @@ static int dlfb_usb_probe(struct usb_interface *intf, + dlfb->udev = usb_get_dev(usbdev); + usb_set_intfdata(intf, dlfb); + ++ retval = usb_find_common_endpoints(intf->cur_altsetting, NULL, &out, NULL, NULL); ++ if (retval) { ++ dev_err(&intf->dev, "Device should have at lease 1 bulk endpoint!\n"); ++ goto error; ++ } ++ + dev_dbg(&intf->dev, "console enable=%d\n", console); + dev_dbg(&intf->dev, "fb_defio enable=%d\n", fb_defio); + dev_dbg(&intf->dev, "shadow enable=%d\n", shadow); +@@ -1674,6 +1681,7 @@ static int dlfb_usb_probe(struct usb_interface *intf, + if (!dlfb_parse_vendor_descriptor(dlfb, intf)) { + dev_err(&intf->dev, + "firmware not recognized, incompatible device?\n"); ++ retval = -ENODEV; + goto error; + } + +@@ -1687,8 +1695,10 @@ static int dlfb_usb_probe(struct usb_interface *intf, + + /* allocates framebuffer driver structure, not framebuffer memory */ + info = framebuffer_alloc(0, &dlfb->udev->dev); +- if (!info) ++ if (!info) { ++ retval = -ENOMEM; + goto error; ++ } + + dlfb->info = info; + info->par = dlfb; +-- +2.35.1 + diff --git a/queue-5.4/x86-__memcpy_flushcache-fix-wrong-alignment-if-size-.patch b/queue-5.4/x86-__memcpy_flushcache-fix-wrong-alignment-if-size-.patch new file mode 100644 index 00000000000..676b9f45986 --- /dev/null +++ b/queue-5.4/x86-__memcpy_flushcache-fix-wrong-alignment-if-size-.patch @@ -0,0 +1,51 @@ +From 60d72f598bb5dcaa1cde3e92821401412bd631cc Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 19 Apr 2022 09:56:23 -0400 +Subject: x86: __memcpy_flushcache: fix wrong alignment if size > 2^32 + +From: Mikulas Patocka + +[ Upstream commit a6823e4e360fe975bd3da4ab156df7c74c8b07f3 ] + +The first "if" condition in __memcpy_flushcache is supposed to align the +"dest" variable to 8 bytes and copy data up to this alignment. However, +this condition may misbehave if "size" is greater than 4GiB. + +The statement min_t(unsigned, size, ALIGN(dest, 8) - dest); casts both +arguments to unsigned int and selects the smaller one. However, the +cast truncates high bits in "size" and it results in misbehavior. + +For example: + + suppose that size == 0x100000001, dest == 0x200000002 + min_t(unsigned, size, ALIGN(dest, 8) - dest) == min_t(0x1, 0xe) == 0x1; + ... + dest += 0x1; + +so we copy just one byte "and" dest remains unaligned. + +This patch fixes the bug by replacing unsigned with size_t. + +Signed-off-by: Mikulas Patocka +Signed-off-by: Linus Torvalds +Signed-off-by: Sasha Levin +--- + arch/x86/lib/usercopy_64.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/x86/lib/usercopy_64.c b/arch/x86/lib/usercopy_64.c +index 1847e993ac63..f3f7f4cb15a6 100644 +--- a/arch/x86/lib/usercopy_64.c ++++ b/arch/x86/lib/usercopy_64.c +@@ -142,7 +142,7 @@ void __memcpy_flushcache(void *_dst, const void *_src, size_t size) + + /* cache copy and flush to align dest */ + if (!IS_ALIGNED(dest, 8)) { +- unsigned len = min_t(unsigned, size, ALIGN(dest, 8) - dest); ++ size_t len = min_t(size_t, size, ALIGN(dest, 8) - dest); + + memcpy((void *) dest, (void *) source, len); + clean_cache_range((void *) dest, len); +-- +2.35.1 +