From 7f9297e2cedce49708dbe7949c8796284073f4bd Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Sun, 2 Oct 2022 13:51:56 -0400 Subject: [PATCH] Fixes for 5.4 Signed-off-by: Sasha Levin --- ...dts-am33xx-fix-mmchs0-dma-properties.patch | 39 ++ ...3xx-and-am43xx-mmc-nodes-to-sdhci-om.patch | 343 ++++++++++++++++++ ...emove-the-set_rate_parent-flag-for-q.patch | 49 +++ ...-rely-on-node-name-for-correct-pll-s.patch | 82 +++++ ...4-fix-return-value-check-in-mip4_pro.patch | 37 ++ ...-new-line-after-variable-declatation.patch | 52 +++ ...clear-and-ioc_pr_release-ioctls-for-.patch | 63 ++++ ...e-analogix-dp-add-panel-prepare-unpr.patch | 88 +++++ ...e-if-conditions-of-in-test_extra_fil.patch | 37 ++ queue-5.4/series | 15 + ...nxi-sram-actually-claim-sram-regions.patch | 40 ++ ...sram-fix-debugfs-info-for-a64-sram-c.patch | 40 ++ ...m-fix-probe-function-ordering-issues.patch | 74 ++++ ...revent-the-driver-from-being-unbound.patch | 53 +++ ...ake-use-of-the-helper-function-devm_.patch | 48 +++ ...fix-memory-leak-in-usbnet_disconnect.patch | 56 +++ 16 files changed, 1116 insertions(+) create mode 100644 queue-5.4/arm-dts-am33xx-fix-mmchs0-dma-properties.patch create mode 100644 queue-5.4/arm-dts-move-am33xx-and-am43xx-mmc-nodes-to-sdhci-om.patch create mode 100644 queue-5.4/clk-imx-imx6sx-remove-the-set_rate_parent-flag-for-q.patch create mode 100644 queue-5.4/clk-iproc-do-not-rely-on-node-name-for-correct-pll-s.patch create mode 100644 queue-5.4/input-melfas_mip4-fix-return-value-check-in-mip4_pro.patch create mode 100644 queue-5.4/nvme-add-new-line-after-variable-declatation.patch create mode 100644 queue-5.4/nvme-fix-ioc_pr_clear-and-ioc_pr_release-ioctls-for-.patch create mode 100644 queue-5.4/revert-drm-bridge-analogix-dp-add-panel-prepare-unpr.patch create mode 100644 queue-5.4/selftests-fix-the-if-conditions-of-in-test_extra_fil.patch create mode 100644 queue-5.4/soc-sunxi-sram-actually-claim-sram-regions.patch create mode 100644 queue-5.4/soc-sunxi-sram-fix-debugfs-info-for-a64-sram-c.patch create mode 100644 queue-5.4/soc-sunxi-sram-fix-probe-function-ordering-issues.patch create mode 100644 queue-5.4/soc-sunxi-sram-prevent-the-driver-from-being-unbound.patch create mode 100644 queue-5.4/soc-sunxi_sram-make-use-of-the-helper-function-devm_.patch create mode 100644 queue-5.4/usbnet-fix-memory-leak-in-usbnet_disconnect.patch diff --git a/queue-5.4/arm-dts-am33xx-fix-mmchs0-dma-properties.patch b/queue-5.4/arm-dts-am33xx-fix-mmchs0-dma-properties.patch new file mode 100644 index 00000000000..1228dbe00f7 --- /dev/null +++ b/queue-5.4/arm-dts-am33xx-fix-mmchs0-dma-properties.patch @@ -0,0 +1,39 @@ +From df2400b9e8bd3cf24ba2ed11d690101041d67c06 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 20 Jun 2022 05:41:46 -0700 +Subject: ARM: dts: am33xx: Fix MMCHS0 dma properties + +From: YuTong Chang + +[ Upstream commit 2eb502f496f7764027b7958d4e74356fed918059 ] + +According to technical manual(table 11-24), the DMA of MMCHS0 should be +direct mapped. + +Fixes: b5e509066074 ("ARM: DTS: am33xx: Use the new DT bindings for the eDMA3") +Signed-off-by: YuTong Chang +Message-Id: <20220620124146.5330-1-mtwget@gmail.com> +Acked-by: Krzysztof Kozlowski +Signed-off-by: Tony Lindgren +Signed-off-by: Sasha Levin +--- + arch/arm/boot/dts/am33xx-l4.dtsi | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/arch/arm/boot/dts/am33xx-l4.dtsi b/arch/arm/boot/dts/am33xx-l4.dtsi +index b0fe02a91c37..cacd564b4d28 100644 +--- a/arch/arm/boot/dts/am33xx-l4.dtsi ++++ b/arch/arm/boot/dts/am33xx-l4.dtsi +@@ -1335,8 +1335,7 @@ + mmc1: mmc@0 { + compatible = "ti,am335-sdhci"; + ti,needs-special-reset; +- dmas = <&edma_xbar 24 0 0 +- &edma_xbar 25 0 0>; ++ dmas = <&edma 24 0>, <&edma 25 0>; + dma-names = "tx", "rx"; + interrupts = <64>; + reg = <0x0 0x1000>; +-- +2.35.1 + diff --git a/queue-5.4/arm-dts-move-am33xx-and-am43xx-mmc-nodes-to-sdhci-om.patch b/queue-5.4/arm-dts-move-am33xx-and-am43xx-mmc-nodes-to-sdhci-om.patch new file mode 100644 index 00000000000..70293060bc9 --- /dev/null +++ b/queue-5.4/arm-dts-move-am33xx-and-am43xx-mmc-nodes-to-sdhci-om.patch @@ -0,0 +1,343 @@ +From 70443cbed3fd12a24f42eb9a074a1ca3aa224e77 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 13 May 2020 02:08:04 +0530 +Subject: ARM: dts: Move am33xx and am43xx mmc nodes to sdhci-omap driver + +From: Faiz Abbas + +[ Upstream commit 0b4edf111870b83ea77b1d7e16b8ceac29f9f388 ] + +Move mmc nodes to be compatible with the sdhci-omap driver. The following +modifications are required for omap_hsmmc specific properties: + +ti,non-removable: convert to the generic mmc non-removable +ti,needs-special-reset: co-opted into the sdhci-omap driver +ti,dual-volt: removed. Legacy property not used in am335x or am43xx +ti,needs-special-hs-handling: removed. Legacy property not used in am335x +or am43xx + +Also since the sdhci-omap driver does not support runtime PM, explicitly +disable the mmc3 instance in the dtsi. + +Signed-off-by: Faiz Abbas +Signed-off-by: Tony Lindgren +Stable-dep-of: 2eb502f496f7 ("ARM: dts: am33xx: Fix MMCHS0 dma properties") +Signed-off-by: Sasha Levin +--- + arch/arm/boot/dts/am335x-baltos.dtsi | 2 +- + arch/arm/boot/dts/am335x-boneblack-common.dtsi | 1 + + arch/arm/boot/dts/am335x-boneblack-wireless.dts | 1 - + arch/arm/boot/dts/am335x-boneblue.dts | 1 - + arch/arm/boot/dts/am335x-bonegreen-wireless.dts | 1 - + arch/arm/boot/dts/am335x-evm.dts | 3 +-- + arch/arm/boot/dts/am335x-evmsk.dts | 2 +- + arch/arm/boot/dts/am335x-lxm.dts | 2 +- + arch/arm/boot/dts/am335x-moxa-uc-2100-common.dtsi | 2 +- + arch/arm/boot/dts/am335x-moxa-uc-8100-me-t.dts | 2 +- + arch/arm/boot/dts/am335x-pepper.dts | 4 ++-- + arch/arm/boot/dts/am335x-phycore-som.dtsi | 2 +- + arch/arm/boot/dts/am33xx-l4.dtsi | 6 ++---- + arch/arm/boot/dts/am33xx.dtsi | 3 ++- + arch/arm/boot/dts/am4372.dtsi | 3 ++- + arch/arm/boot/dts/am437x-cm-t43.dts | 2 +- + arch/arm/boot/dts/am437x-gp-evm.dts | 4 ++-- + arch/arm/boot/dts/am437x-l4.dtsi | 5 ++--- + arch/arm/boot/dts/am437x-sk-evm.dts | 2 +- + 19 files changed, 22 insertions(+), 26 deletions(-) + +diff --git a/arch/arm/boot/dts/am335x-baltos.dtsi b/arch/arm/boot/dts/am335x-baltos.dtsi +index ed235f263e29..ee84155844ad 100644 +--- a/arch/arm/boot/dts/am335x-baltos.dtsi ++++ b/arch/arm/boot/dts/am335x-baltos.dtsi +@@ -381,7 +381,7 @@ + &mmc2 { + status = "okay"; + vmmc-supply = <&wl12xx_vmmc>; +- ti,non-removable; ++ non-removable; + bus-width = <4>; + cap-power-off-card; + pinctrl-names = "default"; +diff --git a/arch/arm/boot/dts/am335x-boneblack-common.dtsi b/arch/arm/boot/dts/am335x-boneblack-common.dtsi +index 91f93bc89716..dd932220a8bf 100644 +--- a/arch/arm/boot/dts/am335x-boneblack-common.dtsi ++++ b/arch/arm/boot/dts/am335x-boneblack-common.dtsi +@@ -22,6 +22,7 @@ + pinctrl-0 = <&emmc_pins>; + bus-width = <8>; + status = "okay"; ++ non-removable; + }; + + &am33xx_pinmux { +diff --git a/arch/arm/boot/dts/am335x-boneblack-wireless.dts b/arch/arm/boot/dts/am335x-boneblack-wireless.dts +index 3124d94c0b3c..e07dd7979586 100644 +--- a/arch/arm/boot/dts/am335x-boneblack-wireless.dts ++++ b/arch/arm/boot/dts/am335x-boneblack-wireless.dts +@@ -75,7 +75,6 @@ + bus-width = <4>; + non-removable; + cap-power-off-card; +- ti,needs-special-hs-handling; + keep-power-in-suspend; + pinctrl-names = "default"; + pinctrl-0 = <&mmc3_pins &wl18xx_pins>; +diff --git a/arch/arm/boot/dts/am335x-boneblue.dts b/arch/arm/boot/dts/am335x-boneblue.dts +index 2f6652ef9a15..30b62de86b5b 100644 +--- a/arch/arm/boot/dts/am335x-boneblue.dts ++++ b/arch/arm/boot/dts/am335x-boneblue.dts +@@ -389,7 +389,6 @@ + bus-width = <4>; + non-removable; + cap-power-off-card; +- ti,needs-special-hs-handling; + keep-power-in-suspend; + pinctrl-names = "default"; + pinctrl-0 = <&mmc3_pins &wl18xx_pins>; +diff --git a/arch/arm/boot/dts/am335x-bonegreen-wireless.dts b/arch/arm/boot/dts/am335x-bonegreen-wireless.dts +index 4092cd193b8a..609c8db687ec 100644 +--- a/arch/arm/boot/dts/am335x-bonegreen-wireless.dts ++++ b/arch/arm/boot/dts/am335x-bonegreen-wireless.dts +@@ -75,7 +75,6 @@ + bus-width = <4>; + non-removable; + cap-power-off-card; +- ti,needs-special-hs-handling; + keep-power-in-suspend; + pinctrl-names = "default"; + pinctrl-0 = <&mmc3_pins &wl18xx_pins>; +diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts +index a00145705c9b..af25b42e85f4 100644 +--- a/arch/arm/boot/dts/am335x-evm.dts ++++ b/arch/arm/boot/dts/am335x-evm.dts +@@ -782,8 +782,7 @@ + bus-width = <4>; + pinctrl-names = "default"; + pinctrl-0 = <&mmc3_pins &wlan_pins>; +- ti,non-removable; +- ti,needs-special-hs-handling; ++ non-removable; + cap-power-off-card; + keep-power-in-suspend; + +diff --git a/arch/arm/boot/dts/am335x-evmsk.dts b/arch/arm/boot/dts/am335x-evmsk.dts +index e28a5b82fdf3..7805b0618a4f 100644 +--- a/arch/arm/boot/dts/am335x-evmsk.dts ++++ b/arch/arm/boot/dts/am335x-evmsk.dts +@@ -700,7 +700,7 @@ + &mmc2 { + status = "okay"; + vmmc-supply = <&wl12xx_vmmc>; +- ti,non-removable; ++ non-removable; + bus-width = <4>; + cap-power-off-card; + keep-power-in-suspend; +diff --git a/arch/arm/boot/dts/am335x-lxm.dts b/arch/arm/boot/dts/am335x-lxm.dts +index a8005e975ea2..c3bfd8ed5f88 100644 +--- a/arch/arm/boot/dts/am335x-lxm.dts ++++ b/arch/arm/boot/dts/am335x-lxm.dts +@@ -361,7 +361,7 @@ + pinctrl-0 = <&emmc_pins>; + vmmc-supply = <&vmmcsd_fixed>; + bus-width = <8>; +- ti,non-removable; ++ non-removable; + status = "okay"; + }; + +diff --git a/arch/arm/boot/dts/am335x-moxa-uc-2100-common.dtsi b/arch/arm/boot/dts/am335x-moxa-uc-2100-common.dtsi +index 671d4a5da9c4..7749122dad71 100644 +--- a/arch/arm/boot/dts/am335x-moxa-uc-2100-common.dtsi ++++ b/arch/arm/boot/dts/am335x-moxa-uc-2100-common.dtsi +@@ -176,7 +176,7 @@ + vmmc-supply = <&vmmcsd_fixed>; + bus-width = <8>; + pinctrl-0 = <&mmc1_pins_default>; +- ti,non-removable; ++ non-removable; + status = "okay"; + }; + +diff --git a/arch/arm/boot/dts/am335x-moxa-uc-8100-me-t.dts b/arch/arm/boot/dts/am335x-moxa-uc-8100-me-t.dts +index 783d411f2cef..66a5c09ff388 100644 +--- a/arch/arm/boot/dts/am335x-moxa-uc-8100-me-t.dts ++++ b/arch/arm/boot/dts/am335x-moxa-uc-8100-me-t.dts +@@ -473,7 +473,7 @@ + vmmc-supply = <&vmmcsd_fixed>; + bus-width = <8>; + pinctrl-0 = <&mmc2_pins_default>; +- ti,non-removable; ++ non-removable; + status = "okay"; + }; + +diff --git a/arch/arm/boot/dts/am335x-pepper.dts b/arch/arm/boot/dts/am335x-pepper.dts +index e7764ecdf65f..03852eff2b3c 100644 +--- a/arch/arm/boot/dts/am335x-pepper.dts ++++ b/arch/arm/boot/dts/am335x-pepper.dts +@@ -341,7 +341,7 @@ + pinctrl-0 = <&emmc_pins>; + vmmc-supply = <&ldo3_reg>; + bus-width = <8>; +- ti,non-removable; ++ non-removable; + }; + + &mmc3 { +@@ -351,7 +351,7 @@ + pinctrl-0 = <&wireless_pins>; + vmmmc-supply = <&v3v3c_reg>; + bus-width = <4>; +- ti,non-removable; ++ non-removable; + dmas = <&edma_xbar 12 0 1 + &edma_xbar 13 0 2>; + dma-names = "tx", "rx"; +diff --git a/arch/arm/boot/dts/am335x-phycore-som.dtsi b/arch/arm/boot/dts/am335x-phycore-som.dtsi +index 3d0672b53d77..7e46b4c02709 100644 +--- a/arch/arm/boot/dts/am335x-phycore-som.dtsi ++++ b/arch/arm/boot/dts/am335x-phycore-som.dtsi +@@ -69,7 +69,7 @@ + pinctrl-0 = <&emmc_pins>; + vmmc-supply = <&vmmc_reg>; + bus-width = <8>; +- ti,non-removable; ++ non-removable; + status = "disabled"; + }; + +diff --git a/arch/arm/boot/dts/am33xx-l4.dtsi b/arch/arm/boot/dts/am33xx-l4.dtsi +index 7a9eb2b0d45b..b0fe02a91c37 100644 +--- a/arch/arm/boot/dts/am33xx-l4.dtsi ++++ b/arch/arm/boot/dts/am33xx-l4.dtsi +@@ -1333,10 +1333,8 @@ + ranges = <0x0 0x60000 0x1000>; + + mmc1: mmc@0 { +- compatible = "ti,omap4-hsmmc"; +- ti,dual-volt; ++ compatible = "ti,am335-sdhci"; + ti,needs-special-reset; +- ti,needs-special-hs-handling; + dmas = <&edma_xbar 24 0 0 + &edma_xbar 25 0 0>; + dma-names = "tx", "rx"; +@@ -1827,7 +1825,7 @@ + ranges = <0x0 0xd8000 0x1000>; + + mmc2: mmc@0 { +- compatible = "ti,omap4-hsmmc"; ++ compatible = "ti,am335-sdhci"; + ti,needs-special-reset; + dmas = <&edma 2 0 + &edma 3 0>; +diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi +index 77fa7c0f2104..efe36f395bdd 100644 +--- a/arch/arm/boot/dts/am33xx.dtsi ++++ b/arch/arm/boot/dts/am33xx.dtsi +@@ -259,10 +259,11 @@ + ranges = <0x0 0x47810000 0x1000>; + + mmc3: mmc@0 { +- compatible = "ti,omap4-hsmmc"; ++ compatible = "ti,am335-sdhci"; + ti,needs-special-reset; + interrupts = <29>; + reg = <0x0 0x1000>; ++ status = "disabled"; + }; + }; + +diff --git a/arch/arm/boot/dts/am4372.dtsi b/arch/arm/boot/dts/am4372.dtsi +index 14bbc438055f..c5b67993743d 100644 +--- a/arch/arm/boot/dts/am4372.dtsi ++++ b/arch/arm/boot/dts/am4372.dtsi +@@ -250,10 +250,11 @@ + ranges = <0x0 0x47810000 0x1000>; + + mmc3: mmc@0 { +- compatible = "ti,omap4-hsmmc"; ++ compatible = "ti,am437-sdhci"; + ti,needs-special-reset; + interrupts = ; + reg = <0x0 0x1000>; ++ status = "disabled"; + }; + }; + +diff --git a/arch/arm/boot/dts/am437x-cm-t43.dts b/arch/arm/boot/dts/am437x-cm-t43.dts +index 063113a5da2d..a6b4fca8626a 100644 +--- a/arch/arm/boot/dts/am437x-cm-t43.dts ++++ b/arch/arm/boot/dts/am437x-cm-t43.dts +@@ -291,7 +291,7 @@ + pinctrl-0 = <&emmc_pins>; + vmmc-supply = <&vmmc_3v3>; + bus-width = <8>; +- ti,non-removable; ++ non-removable; + }; + + &spi0 { +diff --git a/arch/arm/boot/dts/am437x-gp-evm.dts b/arch/arm/boot/dts/am437x-gp-evm.dts +index 126965a34841..448853701d3d 100644 +--- a/arch/arm/boot/dts/am437x-gp-evm.dts ++++ b/arch/arm/boot/dts/am437x-gp-evm.dts +@@ -872,7 +872,7 @@ + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&emmc_pins_default>; + pinctrl-1 = <&emmc_pins_sleep>; +- ti,non-removable; ++ non-removable; + }; + + &mmc3 { +@@ -889,7 +889,7 @@ + pinctrl-1 = <&mmc3_pins_sleep>; + cap-power-off-card; + keep-power-in-suspend; +- ti,non-removable; ++ non-removable; + + #address-cells = <1>; + #size-cells = <0>; +diff --git a/arch/arm/boot/dts/am437x-l4.dtsi b/arch/arm/boot/dts/am437x-l4.dtsi +index 64fdd5079d49..8c9e7e723fc9 100644 +--- a/arch/arm/boot/dts/am437x-l4.dtsi ++++ b/arch/arm/boot/dts/am437x-l4.dtsi +@@ -1104,9 +1104,8 @@ + ranges = <0x0 0x60000 0x1000>; + + mmc1: mmc@0 { +- compatible = "ti,omap4-hsmmc"; ++ compatible = "ti,am437-sdhci"; + reg = <0x0 0x1000>; +- ti,dual-volt; + ti,needs-special-reset; + dmas = <&edma 24 0>, + <&edma 25 0>; +@@ -1641,7 +1640,7 @@ + ranges = <0x0 0xd8000 0x1000>; + + mmc2: mmc@0 { +- compatible = "ti,omap4-hsmmc"; ++ compatible = "ti,am437-sdhci"; + reg = <0x0 0x1000>; + ti,needs-special-reset; + dmas = <&edma 2 0>, +diff --git a/arch/arm/boot/dts/am437x-sk-evm.dts b/arch/arm/boot/dts/am437x-sk-evm.dts +index 74eaa6a3b258..292153c6cb5d 100644 +--- a/arch/arm/boot/dts/am437x-sk-evm.dts ++++ b/arch/arm/boot/dts/am437x-sk-evm.dts +@@ -694,7 +694,7 @@ + pinctrl-1 = <&mmc3_pins_sleep>; + cap-power-off-card; + keep-power-in-suspend; +- ti,non-removable; ++ non-removable; + + #address-cells = <1>; + #size-cells = <0>; +-- +2.35.1 + diff --git a/queue-5.4/clk-imx-imx6sx-remove-the-set_rate_parent-flag-for-q.patch b/queue-5.4/clk-imx-imx6sx-remove-the-set_rate_parent-flag-for-q.patch new file mode 100644 index 00000000000..c36c28fd374 --- /dev/null +++ b/queue-5.4/clk-imx-imx6sx-remove-the-set_rate_parent-flag-for-q.patch @@ -0,0 +1,49 @@ +From 5fc4ce0ee84c54e5287a06a1a4b99fe46e0a84ee Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 15 Sep 2022 10:09:59 -0500 +Subject: clk: imx: imx6sx: remove the SET_RATE_PARENT flag for QSPI clocks + +From: Han Xu + +[ Upstream commit b1ff1bfe81e763420afd5f3f25f0b3cbfd97055c ] + +There is no dedicate parent clock for QSPI so SET_RATE_PARENT flag +should not be used. For instance, the default parent clock for QSPI is +pll2_bus, which is also the parent clock for quite a few modules, such +as MMDC, once GPMI NAND set clock rate for EDO5 mode can cause system +hang due to pll2_bus rate changed. + +Fixes: f1541e15e38e ("clk: imx6sx: Switch to clk_hw based API") +Signed-off-by: Han Xu +Link: https://lore.kernel.org/r/20220915150959.3646702-1-han.xu@nxp.com +Tested-by: Fabio Estevam +Reviewed-by: Abel Vesa +Signed-off-by: Stephen Boyd +Signed-off-by: Sasha Levin +--- + drivers/clk/imx/clk-imx6sx.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/clk/imx/clk-imx6sx.c b/drivers/clk/imx/clk-imx6sx.c +index c4685c01929a..579b638b09b8 100644 +--- a/drivers/clk/imx/clk-imx6sx.c ++++ b/drivers/clk/imx/clk-imx6sx.c +@@ -287,13 +287,13 @@ static void __init imx6sx_clocks_init(struct device_node *ccm_node) + hws[IMX6SX_CLK_SSI3_SEL] = imx_clk_hw_mux("ssi3_sel", base + 0x1c, 14, 2, ssi_sels, ARRAY_SIZE(ssi_sels)); + hws[IMX6SX_CLK_SSI2_SEL] = imx_clk_hw_mux("ssi2_sel", base + 0x1c, 12, 2, ssi_sels, ARRAY_SIZE(ssi_sels)); + hws[IMX6SX_CLK_SSI1_SEL] = imx_clk_hw_mux("ssi1_sel", base + 0x1c, 10, 2, ssi_sels, ARRAY_SIZE(ssi_sels)); +- hws[IMX6SX_CLK_QSPI1_SEL] = imx_clk_hw_mux_flags("qspi1_sel", base + 0x1c, 7, 3, qspi1_sels, ARRAY_SIZE(qspi1_sels), CLK_SET_RATE_PARENT); ++ hws[IMX6SX_CLK_QSPI1_SEL] = imx_clk_hw_mux("qspi1_sel", base + 0x1c, 7, 3, qspi1_sels, ARRAY_SIZE(qspi1_sels)); + hws[IMX6SX_CLK_PERCLK_SEL] = imx_clk_hw_mux("perclk_sel", base + 0x1c, 6, 1, perclk_sels, ARRAY_SIZE(perclk_sels)); + hws[IMX6SX_CLK_VID_SEL] = imx_clk_hw_mux("vid_sel", base + 0x20, 21, 3, vid_sels, ARRAY_SIZE(vid_sels)); + hws[IMX6SX_CLK_ESAI_SEL] = imx_clk_hw_mux("esai_sel", base + 0x20, 19, 2, audio_sels, ARRAY_SIZE(audio_sels)); + hws[IMX6SX_CLK_CAN_SEL] = imx_clk_hw_mux("can_sel", base + 0x20, 8, 2, can_sels, ARRAY_SIZE(can_sels)); + hws[IMX6SX_CLK_UART_SEL] = imx_clk_hw_mux("uart_sel", base + 0x24, 6, 1, uart_sels, ARRAY_SIZE(uart_sels)); +- hws[IMX6SX_CLK_QSPI2_SEL] = imx_clk_hw_mux_flags("qspi2_sel", base + 0x2c, 15, 3, qspi2_sels, ARRAY_SIZE(qspi2_sels), CLK_SET_RATE_PARENT); ++ hws[IMX6SX_CLK_QSPI2_SEL] = imx_clk_hw_mux("qspi2_sel", base + 0x2c, 15, 3, qspi2_sels, ARRAY_SIZE(qspi2_sels)); + hws[IMX6SX_CLK_SPDIF_SEL] = imx_clk_hw_mux("spdif_sel", base + 0x30, 20, 2, audio_sels, ARRAY_SIZE(audio_sels)); + hws[IMX6SX_CLK_AUDIO_SEL] = imx_clk_hw_mux("audio_sel", base + 0x30, 7, 2, audio_sels, ARRAY_SIZE(audio_sels)); + hws[IMX6SX_CLK_ENET_PRE_SEL] = imx_clk_hw_mux("enet_pre_sel", base + 0x34, 15, 3, enet_pre_sels, ARRAY_SIZE(enet_pre_sels)); +-- +2.35.1 + diff --git a/queue-5.4/clk-iproc-do-not-rely-on-node-name-for-correct-pll-s.patch b/queue-5.4/clk-iproc-do-not-rely-on-node-name-for-correct-pll-s.patch new file mode 100644 index 00000000000..6f1870b7206 --- /dev/null +++ b/queue-5.4/clk-iproc-do-not-rely-on-node-name-for-correct-pll-s.patch @@ -0,0 +1,82 @@ +From 3e389d52b4df11e16c26ddd632f7bf92b0dc4e6d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 5 Sep 2022 09:15:03 -0700 +Subject: clk: iproc: Do not rely on node name for correct PLL setup +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Florian Fainelli + +[ Upstream commit 1b24a132eba7a1c19475ba2510ec1c00af3ff914 ] + +After commit 31fd9b79dc58 ("ARM: dts: BCM5301X: update CRU block +description") a warning from clk-iproc-pll.c was generated due to a +duplicate PLL name as well as the console stopped working. Upon closer +inspection it became clear that iproc_pll_clk_setup() used the Device +Tree node unit name as an unique identifier as well as a parent name to +parent all clocks under the PLL. + +BCM5301X was the first platform on which that got noticed because of the +DT node unit name renaming but the same assumptions hold true for any +user of the iproc_pll_clk_setup() function. + +The first 'clock-output-names' property is always guaranteed to be +unique as well as providing the actual desired PLL clock name, so we +utilize that to register the PLL and as a parent name of all children +clock. + +Fixes: 5fe225c105fd ("clk: iproc: add initial common clock support") +Signed-off-by: Florian Fainelli +Acked-by: Rafał Miłecki +Link: https://lore.kernel.org/r/20220905161504.1526-1-f.fainelli@gmail.com +Signed-off-by: Stephen Boyd +Signed-off-by: Sasha Levin +--- + drivers/clk/bcm/clk-iproc-pll.c | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +diff --git a/drivers/clk/bcm/clk-iproc-pll.c b/drivers/clk/bcm/clk-iproc-pll.c +index 274441e2ddb2..8f0619f362e3 100644 +--- a/drivers/clk/bcm/clk-iproc-pll.c ++++ b/drivers/clk/bcm/clk-iproc-pll.c +@@ -736,6 +736,7 @@ void iproc_pll_clk_setup(struct device_node *node, + const char *parent_name; + struct iproc_clk *iclk_array; + struct clk_hw_onecell_data *clk_data; ++ const char *clk_name; + + if (WARN_ON(!pll_ctrl) || WARN_ON(!clk_ctrl)) + return; +@@ -783,7 +784,12 @@ void iproc_pll_clk_setup(struct device_node *node, + iclk = &iclk_array[0]; + iclk->pll = pll; + +- init.name = node->name; ++ ret = of_property_read_string_index(node, "clock-output-names", ++ 0, &clk_name); ++ if (WARN_ON(ret)) ++ goto err_pll_register; ++ ++ init.name = clk_name; + init.ops = &iproc_pll_ops; + init.flags = 0; + parent_name = of_clk_get_parent_name(node, 0); +@@ -803,13 +809,11 @@ void iproc_pll_clk_setup(struct device_node *node, + goto err_pll_register; + + clk_data->hws[0] = &iclk->hw; ++ parent_name = clk_name; + + /* now initialize and register all leaf clocks */ + for (i = 1; i < num_clks; i++) { +- const char *clk_name; +- + memset(&init, 0, sizeof(init)); +- parent_name = node->name; + + ret = of_property_read_string_index(node, "clock-output-names", + i, &clk_name); +-- +2.35.1 + diff --git a/queue-5.4/input-melfas_mip4-fix-return-value-check-in-mip4_pro.patch b/queue-5.4/input-melfas_mip4-fix-return-value-check-in-mip4_pro.patch new file mode 100644 index 00000000000..1d9895a179c --- /dev/null +++ b/queue-5.4/input-melfas_mip4-fix-return-value-check-in-mip4_pro.patch @@ -0,0 +1,37 @@ +From 5ef2e260a46c6ac3fbb851bba6c47b2384304a75 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 24 Sep 2022 11:07:15 +0800 +Subject: Input: melfas_mip4 - fix return value check in mip4_probe() + +From: Yang Yingliang + +[ Upstream commit a54dc27bd25f20ee3ea2009584b3166d25178243 ] + +devm_gpiod_get_optional() may return ERR_PTR(-EPROBE_DEFER), +add a minus sign to fix it. + +Fixes: 6ccb1d8f78bd ("Input: add MELFAS MIP4 Touchscreen driver") +Signed-off-by: Yang Yingliang +Link: https://lore.kernel.org/r/20220924030715.1653538-1-yangyingliang@huawei.com +Signed-off-by: Dmitry Torokhov +Signed-off-by: Sasha Levin +--- + drivers/input/touchscreen/melfas_mip4.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/input/touchscreen/melfas_mip4.c b/drivers/input/touchscreen/melfas_mip4.c +index 247c3aaba2d8..0588b8f04dac 100644 +--- a/drivers/input/touchscreen/melfas_mip4.c ++++ b/drivers/input/touchscreen/melfas_mip4.c +@@ -1453,7 +1453,7 @@ static int mip4_probe(struct i2c_client *client, const struct i2c_device_id *id) + "ce", GPIOD_OUT_LOW); + if (IS_ERR(ts->gpio_ce)) { + error = PTR_ERR(ts->gpio_ce); +- if (error != EPROBE_DEFER) ++ if (error != -EPROBE_DEFER) + dev_err(&client->dev, + "Failed to get gpio: %d\n", error); + return error; +-- +2.35.1 + diff --git a/queue-5.4/nvme-add-new-line-after-variable-declatation.patch b/queue-5.4/nvme-add-new-line-after-variable-declatation.patch new file mode 100644 index 00000000000..3ac036b7f31 --- /dev/null +++ b/queue-5.4/nvme-add-new-line-after-variable-declatation.patch @@ -0,0 +1,52 @@ +From 1eddbfb32b87a3057e33f5326cb5209270b79f96 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 28 Feb 2021 18:06:11 -0800 +Subject: nvme: add new line after variable declatation + +From: Chaitanya Kulkarni + +[ Upstream commit f1c772d581843e3a14bbd62ef7e40b56fc307f27 ] + +Add a new line in functions nvme_pr_preempt(), nvme_pr_clear(), and +nvme_pr_release() after variable declaration which follows the rest of +the code in the nvme/host/core.c. + +No functional change(s) in this patch. + +Signed-off-by: Chaitanya Kulkarni +Signed-off-by: Christoph Hellwig +Stable-dep-of: c292a337d0e4 ("nvme: Fix IOC_PR_CLEAR and IOC_PR_RELEASE ioctls for nvme devices") +Signed-off-by: Sasha Levin +--- + drivers/nvme/host/core.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c +index d2ea6ca37c41..c80ce7c1b6a8 100644 +--- a/drivers/nvme/host/core.c ++++ b/drivers/nvme/host/core.c +@@ -2018,18 +2018,21 @@ static int nvme_pr_preempt(struct block_device *bdev, u64 old, u64 new, + enum pr_type type, bool abort) + { + u32 cdw10 = nvme_pr_type(type) << 8 | (abort ? 2 : 1); ++ + return nvme_pr_command(bdev, cdw10, old, new, nvme_cmd_resv_acquire); + } + + static int nvme_pr_clear(struct block_device *bdev, u64 key) + { + u32 cdw10 = 1 | (key ? 1 << 3 : 0); ++ + return nvme_pr_command(bdev, cdw10, key, 0, nvme_cmd_resv_register); + } + + static int nvme_pr_release(struct block_device *bdev, u64 key, enum pr_type type) + { + u32 cdw10 = nvme_pr_type(type) << 8 | (key ? 1 << 3 : 0); ++ + return nvme_pr_command(bdev, cdw10, key, 0, nvme_cmd_resv_release); + } + +-- +2.35.1 + diff --git a/queue-5.4/nvme-fix-ioc_pr_clear-and-ioc_pr_release-ioctls-for-.patch b/queue-5.4/nvme-fix-ioc_pr_clear-and-ioc_pr_release-ioctls-for-.patch new file mode 100644 index 00000000000..dd4896c84e1 --- /dev/null +++ b/queue-5.4/nvme-fix-ioc_pr_clear-and-ioc_pr_release-ioctls-for-.patch @@ -0,0 +1,63 @@ +From 999c70a987c8fffabd070e935af110cd8f2c352c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 22 Sep 2022 21:49:09 -0700 +Subject: nvme: Fix IOC_PR_CLEAR and IOC_PR_RELEASE ioctls for nvme devices + +From: Michael Kelley + +[ Upstream commit c292a337d0e45a292c301e3cd51c35aa0ae91e95 ] + +The IOC_PR_CLEAR and IOC_PR_RELEASE ioctls are +non-functional on NVMe devices because the nvme_pr_clear() +and nvme_pr_release() functions set the IEKEY field incorrectly. +The IEKEY field should be set only when the key is zero (i.e, +not specified). The current code does it backwards. + +Furthermore, the NVMe spec describes the persistent +reservation "clear" function as an option on the reservation +release command. The current implementation of nvme_pr_clear() +erroneously uses the reservation register command. + +Fix these errors. Note that NVMe version 1.3 and later specify +that setting the IEKEY field will return an error of Invalid +Field in Command. The fix will set IEKEY when the key is zero, +which is appropriate as these ioctls consider a zero key to +be "unspecified", and the intention of the spec change is +to require a valid key. + +Tested on a version 1.4 PCI NVMe device in an Azure VM. + +Fixes: 1673f1f08c88 ("nvme: move block_device_operations and ns/ctrl freeing to common code") +Fixes: 1d277a637a71 ("NVMe: Add persistent reservation ops") +Signed-off-by: Michael Kelley +Signed-off-by: Christoph Hellwig +Signed-off-by: Sasha Levin +--- + drivers/nvme/host/core.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c +index c80ce7c1b6a8..f1717f34b2f3 100644 +--- a/drivers/nvme/host/core.c ++++ b/drivers/nvme/host/core.c +@@ -2024,14 +2024,14 @@ static int nvme_pr_preempt(struct block_device *bdev, u64 old, u64 new, + + static int nvme_pr_clear(struct block_device *bdev, u64 key) + { +- u32 cdw10 = 1 | (key ? 1 << 3 : 0); ++ u32 cdw10 = 1 | (key ? 0 : 1 << 3); + +- return nvme_pr_command(bdev, cdw10, key, 0, nvme_cmd_resv_register); ++ return nvme_pr_command(bdev, cdw10, key, 0, nvme_cmd_resv_release); + } + + static int nvme_pr_release(struct block_device *bdev, u64 key, enum pr_type type) + { +- u32 cdw10 = nvme_pr_type(type) << 8 | (key ? 1 << 3 : 0); ++ u32 cdw10 = nvme_pr_type(type) << 8 | (key ? 0 : 1 << 3); + + return nvme_pr_command(bdev, cdw10, key, 0, nvme_cmd_resv_release); + } +-- +2.35.1 + diff --git a/queue-5.4/revert-drm-bridge-analogix-dp-add-panel-prepare-unpr.patch b/queue-5.4/revert-drm-bridge-analogix-dp-add-panel-prepare-unpr.patch new file mode 100644 index 00000000000..b82fb0c9202 --- /dev/null +++ b/queue-5.4/revert-drm-bridge-analogix-dp-add-panel-prepare-unpr.patch @@ -0,0 +1,88 @@ +From af5d7614564654b059e0682c366b184ff97d8d9f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 22 Aug 2022 18:08:04 -0700 +Subject: Revert "drm: bridge: analogix/dp: add panel prepare/unprepare in + suspend/resume time" + +From: Brian Norris + +[ Upstream commit cc62d98bd56d45de4531844ca23913a15136c05b ] + +This reverts commit 211f276ed3d96e964d2d1106a198c7f4a4b3f4c0. + +For quite some time, core DRM helpers already ensure that any relevant +connectors/CRTCs/etc. are disabled, as well as their associated +components (e.g., bridges) when suspending the system. Thus, +analogix_dp_bridge_{enable,disable}() already get called, which in turn +call drm_panel_{prepare,unprepare}(). This makes these drm_panel_*() +calls redundant. + +Besides redundancy, there are a few problems with this handling: + +(1) drm_panel_{prepare,unprepare}() are *not* reference-counted APIs and +are not in general designed to be handled by multiple callers -- +although some panel drivers have a coarse 'prepared' flag that mitigates +some damage, at least. So at a minimum this is redundant and confusing, +but in some cases, this could be actively harmful. + +(2) The error-handling is a bit non-standard. We ignored errors in +suspend(), but handled errors in resume(). And recently, people noticed +that the clk handling is unbalanced in error paths, and getting *that* +right is not actually trivial, given the current way errors are mostly +ignored. + +(3) In the particular way analogix_dp_{suspend,resume}() get used (e.g., +in rockchip_dp_*(), as a late/early callback), we don't necessarily have +a proper PM relationship between the DP/bridge device and the panel +device. So while the DP bridge gets resumed, the panel's parent device +(e.g., platform_device) may still be suspended, and so any prepare() +calls may fail. + +So remove the superfluous, possibly-harmful suspend()/resume() handling +of panel state. + +Fixes: 211f276ed3d9 ("drm: bridge: analogix/dp: add panel prepare/unprepare in suspend/resume time") +Link: https://lore.kernel.org/all/Yv2CPBD3Picg%2FgVe@google.com/ +Signed-off-by: Brian Norris +Reviewed-by: Douglas Anderson +Signed-off-by: Douglas Anderson +Link: https://patchwork.freedesktop.org/patch/msgid/20220822180729.1.I8ac5abe3a4c1c6fd5c061686c6e883c22f69022c@changeid +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 13 ------------- + 1 file changed, 13 deletions(-) + +diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +index c6a51d1c7ec9..df606a567566 100644 +--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c ++++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +@@ -1823,12 +1823,6 @@ EXPORT_SYMBOL_GPL(analogix_dp_remove); + int analogix_dp_suspend(struct analogix_dp_device *dp) + { + clk_disable_unprepare(dp->clock); +- +- if (dp->plat_data->panel) { +- if (drm_panel_unprepare(dp->plat_data->panel)) +- DRM_ERROR("failed to turnoff the panel\n"); +- } +- + return 0; + } + EXPORT_SYMBOL_GPL(analogix_dp_suspend); +@@ -1843,13 +1837,6 @@ int analogix_dp_resume(struct analogix_dp_device *dp) + return ret; + } + +- if (dp->plat_data->panel) { +- if (drm_panel_prepare(dp->plat_data->panel)) { +- DRM_ERROR("failed to setup the panel\n"); +- return -EBUSY; +- } +- } +- + return 0; + } + EXPORT_SYMBOL_GPL(analogix_dp_resume); +-- +2.35.1 + diff --git a/queue-5.4/selftests-fix-the-if-conditions-of-in-test_extra_fil.patch b/queue-5.4/selftests-fix-the-if-conditions-of-in-test_extra_fil.patch new file mode 100644 index 00000000000..3db00b707a2 --- /dev/null +++ b/queue-5.4/selftests-fix-the-if-conditions-of-in-test_extra_fil.patch @@ -0,0 +1,37 @@ +From a5ca6efcef471987df2911567d0b53e95593edd3 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 23 Sep 2022 15:02:37 +0800 +Subject: selftests: Fix the if conditions of in test_extra_filter() + +From: Wang Yufen + +[ Upstream commit bc7a319844891746135dc1f34ab9df78d636a3ac ] + +The socket 2 bind the addr in use, bind should fail with EADDRINUSE. So +if bind success or errno != EADDRINUSE, testcase should be failed. + +Fixes: 3ca8e4029969 ("soreuseport: BPF selection functional test") +Signed-off-by: Wang Yufen +Link: https://lore.kernel.org/r/1663916557-10730-1-git-send-email-wangyufen@huawei.com +Signed-off-by: Paolo Abeni +Signed-off-by: Sasha Levin +--- + tools/testing/selftests/net/reuseport_bpf.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tools/testing/selftests/net/reuseport_bpf.c b/tools/testing/selftests/net/reuseport_bpf.c +index b5277106df1f..b0cc082fbb84 100644 +--- a/tools/testing/selftests/net/reuseport_bpf.c ++++ b/tools/testing/selftests/net/reuseport_bpf.c +@@ -330,7 +330,7 @@ static void test_extra_filter(const struct test_params p) + if (bind(fd1, addr, sockaddr_size())) + error(1, errno, "failed to bind recv socket 1"); + +- if (!bind(fd2, addr, sockaddr_size()) && errno != EADDRINUSE) ++ if (!bind(fd2, addr, sockaddr_size()) || errno != EADDRINUSE) + error(1, errno, "bind socket 2 should fail with EADDRINUSE"); + + free(addr); +-- +2.35.1 + diff --git a/queue-5.4/series b/queue-5.4/series index bc20d4d6d17..28b3ec64171 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -13,3 +13,18 @@ mm-prevent-page_frag_alloc-from-corrupting-the-memory.patch mm-migrate_device.c-flush-tlb-while-holding-ptl.patch mm-fix-madivse_pageout-mishandling-on-non-lru-page.patch media-dvb_vb2-fix-possible-out-of-bound-access.patch +arm-dts-move-am33xx-and-am43xx-mmc-nodes-to-sdhci-om.patch +arm-dts-am33xx-fix-mmchs0-dma-properties.patch +soc-sunxi-sram-actually-claim-sram-regions.patch +soc-sunxi-sram-prevent-the-driver-from-being-unbound.patch +soc-sunxi_sram-make-use-of-the-helper-function-devm_.patch +soc-sunxi-sram-fix-probe-function-ordering-issues.patch +soc-sunxi-sram-fix-debugfs-info-for-a64-sram-c.patch +revert-drm-bridge-analogix-dp-add-panel-prepare-unpr.patch +input-melfas_mip4-fix-return-value-check-in-mip4_pro.patch +usbnet-fix-memory-leak-in-usbnet_disconnect.patch +nvme-add-new-line-after-variable-declatation.patch +nvme-fix-ioc_pr_clear-and-ioc_pr_release-ioctls-for-.patch +selftests-fix-the-if-conditions-of-in-test_extra_fil.patch +clk-imx-imx6sx-remove-the-set_rate_parent-flag-for-q.patch +clk-iproc-do-not-rely-on-node-name-for-correct-pll-s.patch diff --git a/queue-5.4/soc-sunxi-sram-actually-claim-sram-regions.patch b/queue-5.4/soc-sunxi-sram-actually-claim-sram-regions.patch new file mode 100644 index 00000000000..87229253e0a --- /dev/null +++ b/queue-5.4/soc-sunxi-sram-actually-claim-sram-regions.patch @@ -0,0 +1,40 @@ +From c2f391ca3955cea8fafaf36fd9e0c31ecc792c0b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 14 Aug 2022 23:12:40 -0500 +Subject: soc: sunxi: sram: Actually claim SRAM regions + +From: Samuel Holland + +[ Upstream commit fd362baad2e659ef0fb5652f023a606b248f1781 ] + +sunxi_sram_claim() checks the sram_desc->claimed flag before updating +the register, with the intent that only one device can claim a region. +However, this was ineffective because the flag was never set. + +Fixes: 4af34b572a85 ("drivers: soc: sunxi: Introduce SoC driver to map SRAMs") +Reviewed-by: Jernej Skrabec +Signed-off-by: Samuel Holland +Reviewed-by: Heiko Stuebner +Tested-by: Heiko Stuebner +Signed-off-by: Jernej Skrabec +Link: https://lore.kernel.org/r/20220815041248.53268-4-samuel@sholland.org +Signed-off-by: Sasha Levin +--- + drivers/soc/sunxi/sunxi_sram.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/soc/sunxi/sunxi_sram.c b/drivers/soc/sunxi/sunxi_sram.c +index 1b0d50f36349..55f2d4dd42e8 100644 +--- a/drivers/soc/sunxi/sunxi_sram.c ++++ b/drivers/soc/sunxi/sunxi_sram.c +@@ -254,6 +254,7 @@ int sunxi_sram_claim(struct device *dev) + writel(val | ((device << sram_data->offset) & mask), + base + sram_data->reg); + ++ sram_desc->claimed = true; + spin_unlock(&sram_lock); + + return 0; +-- +2.35.1 + diff --git a/queue-5.4/soc-sunxi-sram-fix-debugfs-info-for-a64-sram-c.patch b/queue-5.4/soc-sunxi-sram-fix-debugfs-info-for-a64-sram-c.patch new file mode 100644 index 00000000000..19c1c8ab3e9 --- /dev/null +++ b/queue-5.4/soc-sunxi-sram-fix-debugfs-info-for-a64-sram-c.patch @@ -0,0 +1,40 @@ +From 043321f1c2a7b94faa0f35d8cf7b5b0495169f9f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 14 Aug 2022 23:12:43 -0500 +Subject: soc: sunxi: sram: Fix debugfs info for A64 SRAM C + +From: Samuel Holland + +[ Upstream commit e3c95edb1bd8b9c2cb0caa6ae382fc8080f6a0ed ] + +The labels were backward with respect to the register values. The SRAM +is mapped to the CPU when the register value is 1. + +Fixes: 5e4fb6429761 ("drivers: soc: sunxi: add support for A64 and its SRAM C") +Acked-by: Jernej Skrabec +Signed-off-by: Samuel Holland +Signed-off-by: Jernej Skrabec +Link: https://lore.kernel.org/r/20220815041248.53268-7-samuel@sholland.org +Signed-off-by: Sasha Levin +--- + drivers/soc/sunxi/sunxi_sram.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/soc/sunxi/sunxi_sram.c b/drivers/soc/sunxi/sunxi_sram.c +index 08fe49b766bd..33139c7817c2 100644 +--- a/drivers/soc/sunxi/sunxi_sram.c ++++ b/drivers/soc/sunxi/sunxi_sram.c +@@ -78,8 +78,8 @@ static struct sunxi_sram_desc sun4i_a10_sram_d = { + + static struct sunxi_sram_desc sun50i_a64_sram_c = { + .data = SUNXI_SRAM_DATA("C", 0x4, 24, 1, +- SUNXI_SRAM_MAP(0, 1, "cpu"), +- SUNXI_SRAM_MAP(1, 0, "de2")), ++ SUNXI_SRAM_MAP(1, 0, "cpu"), ++ SUNXI_SRAM_MAP(0, 1, "de2")), + }; + + static const struct of_device_id sunxi_sram_dt_ids[] = { +-- +2.35.1 + diff --git a/queue-5.4/soc-sunxi-sram-fix-probe-function-ordering-issues.patch b/queue-5.4/soc-sunxi-sram-fix-probe-function-ordering-issues.patch new file mode 100644 index 00000000000..b1fee3a4a96 --- /dev/null +++ b/queue-5.4/soc-sunxi-sram-fix-probe-function-ordering-issues.patch @@ -0,0 +1,74 @@ +From 7f7b18f7750e77ce202157646ae7726e4e7b8a23 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 14 Aug 2022 23:12:42 -0500 +Subject: soc: sunxi: sram: Fix probe function ordering issues + +From: Samuel Holland + +[ Upstream commit 49fad91a7b8941979c3e9a35f9894ac45bc5d3d6 ] + +Errors from debugfs are intended to be non-fatal, and should not prevent +the driver from probing. + +Since debugfs file creation is treated as infallible, move it below the +parts of the probe function that can fail. This prevents an error +elsewhere in the probe function from causing the file to leak. Do the +same for the call to of_platform_populate(). + +Finally, checkpatch suggests an octal literal for the file permissions. + +Fixes: 4af34b572a85 ("drivers: soc: sunxi: Introduce SoC driver to map SRAMs") +Fixes: 5828729bebbb ("soc: sunxi: export a regmap for EMAC clock reg on A64") +Reviewed-by: Jernej Skrabec +Signed-off-by: Samuel Holland +Tested-by: Heiko Stuebner +Signed-off-by: Jernej Skrabec +Link: https://lore.kernel.org/r/20220815041248.53268-6-samuel@sholland.org +Signed-off-by: Sasha Levin +--- + drivers/soc/sunxi/sunxi_sram.c | 13 +++++-------- + 1 file changed, 5 insertions(+), 8 deletions(-) + +diff --git a/drivers/soc/sunxi/sunxi_sram.c b/drivers/soc/sunxi/sunxi_sram.c +index 3a350828965e..08fe49b766bd 100644 +--- a/drivers/soc/sunxi/sunxi_sram.c ++++ b/drivers/soc/sunxi/sunxi_sram.c +@@ -321,9 +321,9 @@ static struct regmap_config sunxi_sram_emac_clock_regmap = { + + static int __init sunxi_sram_probe(struct platform_device *pdev) + { +- struct dentry *d; + struct regmap *emac_clock; + const struct sunxi_sramc_variant *variant; ++ struct device *dev = &pdev->dev; + + sram_dev = &pdev->dev; + +@@ -335,13 +335,6 @@ static int __init sunxi_sram_probe(struct platform_device *pdev) + if (IS_ERR(base)) + return PTR_ERR(base); + +- of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev); +- +- d = debugfs_create_file("sram", S_IRUGO, NULL, NULL, +- &sunxi_sram_fops); +- if (!d) +- return -ENOMEM; +- + if (variant->has_emac_clock) { + emac_clock = devm_regmap_init_mmio(&pdev->dev, base, + &sunxi_sram_emac_clock_regmap); +@@ -350,6 +343,10 @@ static int __init sunxi_sram_probe(struct platform_device *pdev) + return PTR_ERR(emac_clock); + } + ++ of_platform_populate(dev->of_node, NULL, NULL, dev); ++ ++ debugfs_create_file("sram", 0444, NULL, NULL, &sunxi_sram_fops); ++ + return 0; + } + +-- +2.35.1 + diff --git a/queue-5.4/soc-sunxi-sram-prevent-the-driver-from-being-unbound.patch b/queue-5.4/soc-sunxi-sram-prevent-the-driver-from-being-unbound.patch new file mode 100644 index 00000000000..ad707db80cb --- /dev/null +++ b/queue-5.4/soc-sunxi-sram-prevent-the-driver-from-being-unbound.patch @@ -0,0 +1,53 @@ +From c27dc0490832551e50360ec2eba3730d5f94ecab Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 14 Aug 2022 23:12:41 -0500 +Subject: soc: sunxi: sram: Prevent the driver from being unbound + +From: Samuel Holland + +[ Upstream commit 90e10a1fcd9b24b4ba8c0d35136127473dcd829e ] + +This driver exports a regmap tied to the platform device (as opposed to +a syscon, which exports a regmap tied to the OF node). Because of this, +the driver can never be unbound, as that would destroy the regmap. Use +builtin_platform_driver_probe() to enforce this limitation. + +Fixes: 5828729bebbb ("soc: sunxi: export a regmap for EMAC clock reg on A64") +Reviewed-by: Jernej Skrabec +Signed-off-by: Samuel Holland +Reviewed-by: Heiko Stuebner +Tested-by: Heiko Stuebner +Signed-off-by: Jernej Skrabec +Link: https://lore.kernel.org/r/20220815041248.53268-5-samuel@sholland.org +Signed-off-by: Sasha Levin +--- + drivers/soc/sunxi/sunxi_sram.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/drivers/soc/sunxi/sunxi_sram.c b/drivers/soc/sunxi/sunxi_sram.c +index 55f2d4dd42e8..50f6af90017b 100644 +--- a/drivers/soc/sunxi/sunxi_sram.c ++++ b/drivers/soc/sunxi/sunxi_sram.c +@@ -319,7 +319,7 @@ static struct regmap_config sunxi_sram_emac_clock_regmap = { + .writeable_reg = sunxi_sram_regmap_accessible_reg, + }; + +-static int sunxi_sram_probe(struct platform_device *pdev) ++static int __init sunxi_sram_probe(struct platform_device *pdev) + { + struct resource *res; + struct dentry *d; +@@ -397,9 +397,8 @@ static struct platform_driver sunxi_sram_driver = { + .name = "sunxi-sram", + .of_match_table = sunxi_sram_dt_match, + }, +- .probe = sunxi_sram_probe, + }; +-module_platform_driver(sunxi_sram_driver); ++builtin_platform_driver_probe(sunxi_sram_driver, sunxi_sram_probe); + + MODULE_AUTHOR("Maxime Ripard "); + MODULE_DESCRIPTION("Allwinner sunXi SRAM Controller Driver"); +-- +2.35.1 + diff --git a/queue-5.4/soc-sunxi_sram-make-use-of-the-helper-function-devm_.patch b/queue-5.4/soc-sunxi_sram-make-use-of-the-helper-function-devm_.patch new file mode 100644 index 00000000000..5b35800e66c --- /dev/null +++ b/queue-5.4/soc-sunxi_sram-make-use-of-the-helper-function-devm_.patch @@ -0,0 +1,48 @@ +From 7fc5eda0a229ae155b823ad412bd330f937314bf Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 8 Sep 2021 15:17:15 +0800 +Subject: soc: sunxi_sram: Make use of the helper function + devm_platform_ioremap_resource() + +From: Cai Huoqing + +[ Upstream commit 1f3753a5f042fea6539986f9caf2552877527d8a ] + +Use the devm_platform_ioremap_resource() helper instead of +calling platform_get_resource() and devm_ioremap_resource() +separately + +Signed-off-by: Cai Huoqing +Signed-off-by: Maxime Ripard +Link: https://lore.kernel.org/r/20210908071716.772-1-caihuoqing@baidu.com +Stable-dep-of: 49fad91a7b89 ("soc: sunxi: sram: Fix probe function ordering issues") +Signed-off-by: Sasha Levin +--- + drivers/soc/sunxi/sunxi_sram.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/drivers/soc/sunxi/sunxi_sram.c b/drivers/soc/sunxi/sunxi_sram.c +index 50f6af90017b..3a350828965e 100644 +--- a/drivers/soc/sunxi/sunxi_sram.c ++++ b/drivers/soc/sunxi/sunxi_sram.c +@@ -321,7 +321,6 @@ static struct regmap_config sunxi_sram_emac_clock_regmap = { + + static int __init sunxi_sram_probe(struct platform_device *pdev) + { +- struct resource *res; + struct dentry *d; + struct regmap *emac_clock; + const struct sunxi_sramc_variant *variant; +@@ -332,8 +331,7 @@ static int __init sunxi_sram_probe(struct platform_device *pdev) + if (!variant) + return -EINVAL; + +- res = platform_get_resource(pdev, IORESOURCE_MEM, 0); +- base = devm_ioremap_resource(&pdev->dev, res); ++ base = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(base)) + return PTR_ERR(base); + +-- +2.35.1 + diff --git a/queue-5.4/usbnet-fix-memory-leak-in-usbnet_disconnect.patch b/queue-5.4/usbnet-fix-memory-leak-in-usbnet_disconnect.patch new file mode 100644 index 00000000000..36a9158abb5 --- /dev/null +++ b/queue-5.4/usbnet-fix-memory-leak-in-usbnet_disconnect.patch @@ -0,0 +1,56 @@ +From b053242e61b8f03893db68c67c40d92dcac5e258 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 22 Sep 2022 21:25:51 -0700 +Subject: usbnet: Fix memory leak in usbnet_disconnect() + +From: Peilin Ye + +[ Upstream commit a43206156263fbaf1f2b7f96257441f331e91bb7 ] + +Currently usbnet_disconnect() unanchors and frees all deferred URBs +using usb_scuttle_anchored_urbs(), which does not free urb->context, +causing a memory leak as reported by syzbot. + +Use a usb_get_from_anchor() while loop instead, similar to what we did +in commit 19cfe912c37b ("Bluetooth: btusb: Fix memory leak in +play_deferred"). Also free urb->sg. + +Reported-and-tested-by: syzbot+dcd3e13cf4472f2e0ba1@syzkaller.appspotmail.com +Fixes: 69ee472f2706 ("usbnet & cdc-ether: Autosuspend for online devices") +Fixes: 638c5115a794 ("USBNET: support DMA SG") +Signed-off-by: Peilin Ye +Link: https://lore.kernel.org/r/20220923042551.2745-1-yepeilin.cs@gmail.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + drivers/net/usb/usbnet.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c +index 7a8324d2a968..7af8c3a8f3f1 100644 +--- a/drivers/net/usb/usbnet.c ++++ b/drivers/net/usb/usbnet.c +@@ -1585,6 +1585,7 @@ void usbnet_disconnect (struct usb_interface *intf) + struct usbnet *dev; + struct usb_device *xdev; + struct net_device *net; ++ struct urb *urb; + + dev = usb_get_intfdata(intf); + usb_set_intfdata(intf, NULL); +@@ -1601,7 +1602,11 @@ void usbnet_disconnect (struct usb_interface *intf) + net = dev->net; + unregister_netdev (net); + +- usb_scuttle_anchored_urbs(&dev->deferred); ++ while ((urb = usb_get_from_anchor(&dev->deferred))) { ++ dev_kfree_skb(urb->context); ++ kfree(urb->sg); ++ usb_free_urb(urb); ++ } + + if (dev->driver_info->unbind) + dev->driver_info->unbind (dev, intf); +-- +2.35.1 + -- 2.47.3