From 634c53e9de5e99fb0dccf68a10c9c181894d95f6 Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Sun, 2 Oct 2022 13:51:56 -0400 Subject: [PATCH] Fixes for 5.10 Signed-off-by: Sasha Levin --- ...dts-am33xx-fix-mmchs0-dma-properties.patch | 39 ++++++ ...soc-tas2770-reinit-regcache-on-reset.patch | 50 +++++++ ...emove-the-set_rate_parent-flag-for-q.patch | 49 +++++++ ...-rely-on-node-name-for-correct-pll-s.patch | 82 +++++++++++ ...g-unlock-on-ethofld-desc-collect-fai.patch | 121 ++++++++++++++++ ...4-fix-return-value-check-in-mip4_pro.patch | 37 +++++ ...2_platform_dca_cap-31-0-from-the-gue.patch | 40 ++++++ ...-fix-possible-refcount-leak-in-tcf_c.patch | 47 +++++++ ...-up-down-serdes-in-stmmac_open-relea.patch | 130 ++++++++++++++++++ ...-new-line-after-variable-declatation.patch | 52 +++++++ ...clear-and-ioc_pr_release-ioctls-for-.patch | 63 +++++++++ ...ix-the-imx8mp-pcie-phy-perst-support.patch | 44 ++++++ ...e-analogix-dp-add-panel-prepare-unpr.patch | 88 ++++++++++++ ...e-if-conditions-of-in-test_extra_fil.patch | 37 +++++ queue-5.10/series | 20 +++ ...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 ++++++++ 21 files changed, 1210 insertions(+) create mode 100644 queue-5.10/arm-dts-am33xx-fix-mmchs0-dma-properties.patch create mode 100644 queue-5.10/asoc-tas2770-reinit-regcache-on-reset.patch create mode 100644 queue-5.10/clk-imx-imx6sx-remove-the-set_rate_parent-flag-for-q.patch create mode 100644 queue-5.10/clk-iproc-do-not-rely-on-node-name-for-correct-pll-s.patch create mode 100644 queue-5.10/cxgb4-fix-missing-unlock-on-ethofld-desc-collect-fai.patch create mode 100644 queue-5.10/input-melfas_mip4-fix-return-value-check-in-mip4_pro.patch create mode 100644 queue-5.10/kvm-x86-hide-ia32_platform_dca_cap-31-0-from-the-gue.patch create mode 100644 queue-5.10/net-sched-act_ct-fix-possible-refcount-leak-in-tcf_c.patch create mode 100644 queue-5.10/net-stmmac-power-up-down-serdes-in-stmmac_open-relea.patch create mode 100644 queue-5.10/nvme-add-new-line-after-variable-declatation.patch create mode 100644 queue-5.10/nvme-fix-ioc_pr_clear-and-ioc_pr_release-ioctls-for-.patch create mode 100644 queue-5.10/reset-imx7-fix-the-imx8mp-pcie-phy-perst-support.patch create mode 100644 queue-5.10/revert-drm-bridge-analogix-dp-add-panel-prepare-unpr.patch create mode 100644 queue-5.10/selftests-fix-the-if-conditions-of-in-test_extra_fil.patch create mode 100644 queue-5.10/soc-sunxi-sram-actually-claim-sram-regions.patch create mode 100644 queue-5.10/soc-sunxi-sram-fix-debugfs-info-for-a64-sram-c.patch create mode 100644 queue-5.10/soc-sunxi-sram-fix-probe-function-ordering-issues.patch create mode 100644 queue-5.10/soc-sunxi-sram-prevent-the-driver-from-being-unbound.patch create mode 100644 queue-5.10/soc-sunxi_sram-make-use-of-the-helper-function-devm_.patch create mode 100644 queue-5.10/usbnet-fix-memory-leak-in-usbnet_disconnect.patch diff --git a/queue-5.10/arm-dts-am33xx-fix-mmchs0-dma-properties.patch b/queue-5.10/arm-dts-am33xx-fix-mmchs0-dma-properties.patch new file mode 100644 index 00000000000..337792408b6 --- /dev/null +++ b/queue-5.10/arm-dts-am33xx-fix-mmchs0-dma-properties.patch @@ -0,0 +1,39 @@ +From c44cc882238e7bbc8d35830ed49cef59b6e81b0d 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 29fafb67cfaa..0d36e9dd14a4 100644 +--- a/arch/arm/boot/dts/am33xx-l4.dtsi ++++ b/arch/arm/boot/dts/am33xx-l4.dtsi +@@ -1352,8 +1352,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.10/asoc-tas2770-reinit-regcache-on-reset.patch b/queue-5.10/asoc-tas2770-reinit-regcache-on-reset.patch new file mode 100644 index 00000000000..8507492be74 --- /dev/null +++ b/queue-5.10/asoc-tas2770-reinit-regcache-on-reset.patch @@ -0,0 +1,50 @@ +From 21968eb40aadd963a0340d33e0347e6e822b4e54 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 19 Sep 2022 19:34:53 +0200 +Subject: ASoC: tas2770: Reinit regcache on reset +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Martin Povišer + +[ Upstream commit 0a0342ede303fc420f3a388e1ae82da3ae8ff6bd ] + +On probe of the ASoC component, the device is reset but the regcache is +retained. This means the regcache gets out of sync if the codec is +rebound to a sound card for a second time. Fix it by reinitializing the +regcache to defaults after the device is reset. + +Fixes: b0bcbe615756 ("ASoC: tas2770: Fix calling reset in probe") +Signed-off-by: Martin Povišer +Link: https://lore.kernel.org/r/20220919173453.84292-1-povik+lin@cutebit.org +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/codecs/tas2770.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/sound/soc/codecs/tas2770.c b/sound/soc/codecs/tas2770.c +index 024ec68e8d35..171bbcc919d5 100644 +--- a/sound/soc/codecs/tas2770.c ++++ b/sound/soc/codecs/tas2770.c +@@ -495,6 +495,8 @@ static struct snd_soc_dai_driver tas2770_dai_driver[] = { + }, + }; + ++static const struct regmap_config tas2770_i2c_regmap; ++ + static int tas2770_codec_probe(struct snd_soc_component *component) + { + struct tas2770_priv *tas2770 = +@@ -508,6 +510,7 @@ static int tas2770_codec_probe(struct snd_soc_component *component) + } + + tas2770_reset(tas2770); ++ regmap_reinit_cache(tas2770->regmap, &tas2770_i2c_regmap); + + return 0; + } +-- +2.35.1 + diff --git a/queue-5.10/clk-imx-imx6sx-remove-the-set_rate_parent-flag-for-q.patch b/queue-5.10/clk-imx-imx6sx-remove-the-set_rate_parent-flag-for-q.patch new file mode 100644 index 00000000000..a40e7f90003 --- /dev/null +++ b/queue-5.10/clk-imx-imx6sx-remove-the-set_rate_parent-flag-for-q.patch @@ -0,0 +1,49 @@ +From 0f9aa0be435caa00f09eccdddf93fc30fd2abb5c 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 fc1bd23d4583..598f3cf4eba4 100644 +--- a/drivers/clk/imx/clk-imx6sx.c ++++ b/drivers/clk/imx/clk-imx6sx.c +@@ -280,13 +280,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.10/clk-iproc-do-not-rely-on-node-name-for-correct-pll-s.patch b/queue-5.10/clk-iproc-do-not-rely-on-node-name-for-correct-pll-s.patch new file mode 100644 index 00000000000..109bbf59d20 --- /dev/null +++ b/queue-5.10/clk-iproc-do-not-rely-on-node-name-for-correct-pll-s.patch @@ -0,0 +1,82 @@ +From f641d28edc434097c8153adcb9a1216d672b842a 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.10/cxgb4-fix-missing-unlock-on-ethofld-desc-collect-fai.patch b/queue-5.10/cxgb4-fix-missing-unlock-on-ethofld-desc-collect-fai.patch new file mode 100644 index 00000000000..8366c51767e --- /dev/null +++ b/queue-5.10/cxgb4-fix-missing-unlock-on-ethofld-desc-collect-fai.patch @@ -0,0 +1,121 @@ +From db7be98dfb6b8d9f971c792358be4cce549aae21 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 22 Sep 2022 14:51:08 -0300 +Subject: cxgb4: fix missing unlock on ETHOFLD desc collect fail path + +From: Rafael Mendonca + +[ Upstream commit c635ebe8d911a93bd849a9419b01a58783de76f1 ] + +The label passed to the QDESC_GET for the ETHOFLD TXQ, RXQ, and FLQ, is the +'out' one, which skips the 'out_unlock' label, and thus doesn't unlock the +'uld_mutex' before returning. Additionally, since commit 5148e5950c67 +("cxgb4: add EOTID tracking and software context dump"), the access to +these ETHOFLD hardware queues should be protected by the 'mqprio_mutex' +instead. + +Fixes: 2d0cb84dd973 ("cxgb4: add ETHOFLD hardware queue support") +Fixes: 5148e5950c67 ("cxgb4: add EOTID tracking and software context dump") +Signed-off-by: Rafael Mendonca +Reviewed-by: Rahul Lakkireddy +Link: https://lore.kernel.org/r/20220922175109.764898-1-rafaelmendsr@gmail.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + .../net/ethernet/chelsio/cxgb4/cudbg_lib.c | 28 +++++++++++++------ + 1 file changed, 19 insertions(+), 9 deletions(-) + +diff --git a/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c b/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c +index c5b0e725b238..2169351b6afc 100644 +--- a/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c ++++ b/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c +@@ -14,6 +14,7 @@ + #include "cudbg_entity.h" + #include "cudbg_lib.h" + #include "cudbg_zlib.h" ++#include "cxgb4_tc_mqprio.h" + + static const u32 t6_tp_pio_array[][IREG_NUM_ELEM] = { + {0x7e40, 0x7e44, 0x020, 28}, /* t6_tp_pio_regs_20_to_3b */ +@@ -3476,7 +3477,7 @@ int cudbg_collect_qdesc(struct cudbg_init *pdbg_init, + for (i = 0; i < utxq->ntxq; i++) + QDESC_GET_TXQ(&utxq->uldtxq[i].q, + cudbg_uld_txq_to_qtype(j), +- out_unlock); ++ out_unlock_uld); + } + } + +@@ -3493,7 +3494,7 @@ int cudbg_collect_qdesc(struct cudbg_init *pdbg_init, + for (i = 0; i < urxq->nrxq; i++) + QDESC_GET_RXQ(&urxq->uldrxq[i].rspq, + cudbg_uld_rxq_to_qtype(j), +- out_unlock); ++ out_unlock_uld); + } + + /* ULD FLQ */ +@@ -3505,7 +3506,7 @@ int cudbg_collect_qdesc(struct cudbg_init *pdbg_init, + for (i = 0; i < urxq->nrxq; i++) + QDESC_GET_FLQ(&urxq->uldrxq[i].fl, + cudbg_uld_flq_to_qtype(j), +- out_unlock); ++ out_unlock_uld); + } + + /* ULD CIQ */ +@@ -3518,29 +3519,34 @@ int cudbg_collect_qdesc(struct cudbg_init *pdbg_init, + for (i = 0; i < urxq->nciq; i++) + QDESC_GET_RXQ(&urxq->uldrxq[base + i].rspq, + cudbg_uld_ciq_to_qtype(j), +- out_unlock); ++ out_unlock_uld); + } + } ++ mutex_unlock(&uld_mutex); ++ ++ if (!padap->tc_mqprio) ++ goto out; + ++ mutex_lock(&padap->tc_mqprio->mqprio_mutex); + /* ETHOFLD TXQ */ + if (s->eohw_txq) + for (i = 0; i < s->eoqsets; i++) + QDESC_GET_TXQ(&s->eohw_txq[i].q, +- CUDBG_QTYPE_ETHOFLD_TXQ, out); ++ CUDBG_QTYPE_ETHOFLD_TXQ, out_unlock_mqprio); + + /* ETHOFLD RXQ and FLQ */ + if (s->eohw_rxq) { + for (i = 0; i < s->eoqsets; i++) + QDESC_GET_RXQ(&s->eohw_rxq[i].rspq, +- CUDBG_QTYPE_ETHOFLD_RXQ, out); ++ CUDBG_QTYPE_ETHOFLD_RXQ, out_unlock_mqprio); + + for (i = 0; i < s->eoqsets; i++) + QDESC_GET_FLQ(&s->eohw_rxq[i].fl, +- CUDBG_QTYPE_ETHOFLD_FLQ, out); ++ CUDBG_QTYPE_ETHOFLD_FLQ, out_unlock_mqprio); + } + +-out_unlock: +- mutex_unlock(&uld_mutex); ++out_unlock_mqprio: ++ mutex_unlock(&padap->tc_mqprio->mqprio_mutex); + + out: + qdesc_info->qdesc_entry_size = sizeof(*qdesc_entry); +@@ -3578,6 +3584,10 @@ int cudbg_collect_qdesc(struct cudbg_init *pdbg_init, + #undef QDESC_GET + + return rc; ++ ++out_unlock_uld: ++ mutex_unlock(&uld_mutex); ++ goto out; + } + + int cudbg_collect_flash(struct cudbg_init *pdbg_init, +-- +2.35.1 + diff --git a/queue-5.10/input-melfas_mip4-fix-return-value-check-in-mip4_pro.patch b/queue-5.10/input-melfas_mip4-fix-return-value-check-in-mip4_pro.patch new file mode 100644 index 00000000000..a5f7fa0724e --- /dev/null +++ b/queue-5.10/input-melfas_mip4-fix-return-value-check-in-mip4_pro.patch @@ -0,0 +1,37 @@ +From 56528882cd622c0c2bd9cf18cfb346848ad5db08 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 f67efdd040b2..43fcc8c84e2f 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.10/kvm-x86-hide-ia32_platform_dca_cap-31-0-from-the-gue.patch b/queue-5.10/kvm-x86-hide-ia32_platform_dca_cap-31-0-from-the-gue.patch new file mode 100644 index 00000000000..9676bd1ee11 --- /dev/null +++ b/queue-5.10/kvm-x86-hide-ia32_platform_dca_cap-31-0-from-the-gue.patch @@ -0,0 +1,40 @@ +From 68d34145dfb2896c6418f144acce919560f80f01 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 22 Sep 2022 16:18:54 -0700 +Subject: KVM: x86: Hide IA32_PLATFORM_DCA_CAP[31:0] from the guest + +From: Jim Mattson + +[ Upstream commit aae2e72229cdb21f90df2dbe4244c977e5d3265b ] + +The only thing reported by CPUID.9 is the value of +IA32_PLATFORM_DCA_CAP[31:0] in EAX. This MSR doesn't even exist in the +guest, since CPUID.1:ECX.DCA[bit 18] is clear in the guest. + +Clear CPUID.9 in KVM_GET_SUPPORTED_CPUID. + +Fixes: 24c82e576b78 ("KVM: Sanitize cpuid") +Signed-off-by: Jim Mattson +Message-Id: <20220922231854.249383-1-jmattson@google.com> +Signed-off-by: Paolo Bonzini +Signed-off-by: Sasha Levin +--- + arch/x86/kvm/cpuid.c | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c +index 6e1ea5e85e59..6f44274aa949 100644 +--- a/arch/x86/kvm/cpuid.c ++++ b/arch/x86/kvm/cpuid.c +@@ -661,8 +661,6 @@ static inline int __do_cpuid_func(struct kvm_cpuid_array *array, u32 function) + entry->edx = 0; + } + break; +- case 9: +- break; + case 0xa: { /* Architectural Performance Monitoring */ + struct x86_pmu_capability cap; + union cpuid10_eax eax; +-- +2.35.1 + diff --git a/queue-5.10/net-sched-act_ct-fix-possible-refcount-leak-in-tcf_c.patch b/queue-5.10/net-sched-act_ct-fix-possible-refcount-leak-in-tcf_c.patch new file mode 100644 index 00000000000..8a6e8f84f99 --- /dev/null +++ b/queue-5.10/net-sched-act_ct-fix-possible-refcount-leak-in-tcf_c.patch @@ -0,0 +1,47 @@ +From 99a617d2d0e0ebd223bb0eb141de24045f97afbe Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 23 Sep 2022 10:00:46 +0800 +Subject: net: sched: act_ct: fix possible refcount leak in tcf_ct_init() + +From: Hangyu Hua + +[ Upstream commit 6e23ec0ba92d426c77a73a9ccab16346e5e0ef49 ] + +nf_ct_put need to be called to put the refcount got by tcf_ct_fill_params +to avoid possible refcount leak when tcf_ct_flow_table_get fails. + +Fixes: c34b961a2492 ("net/sched: act_ct: Create nf flow table per zone") +Signed-off-by: Hangyu Hua +Link: https://lore.kernel.org/r/20220923020046.8021-1-hbh25y@gmail.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + net/sched/act_ct.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/net/sched/act_ct.c b/net/sched/act_ct.c +index 825b3e9b55f7..f7e88d7466c3 100644 +--- a/net/sched/act_ct.c ++++ b/net/sched/act_ct.c +@@ -1293,7 +1293,7 @@ static int tcf_ct_init(struct net *net, struct nlattr *nla, + + err = tcf_ct_flow_table_get(params); + if (err) +- goto cleanup; ++ goto cleanup_params; + + spin_lock_bh(&c->tcf_lock); + goto_ch = tcf_action_set_ctrlact(*a, parm->action, goto_ch); +@@ -1308,6 +1308,9 @@ static int tcf_ct_init(struct net *net, struct nlattr *nla, + + return res; + ++cleanup_params: ++ if (params->tmpl) ++ nf_ct_put(params->tmpl); + cleanup: + if (goto_ch) + tcf_chain_put_by_act(goto_ch); +-- +2.35.1 + diff --git a/queue-5.10/net-stmmac-power-up-down-serdes-in-stmmac_open-relea.patch b/queue-5.10/net-stmmac-power-up-down-serdes-in-stmmac_open-relea.patch new file mode 100644 index 00000000000..4302d11555d --- /dev/null +++ b/queue-5.10/net-stmmac-power-up-down-serdes-in-stmmac_open-relea.patch @@ -0,0 +1,130 @@ +From 0fde1369833c4bafbc44d6ba087d94d540a4171e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 23 Sep 2022 13:04:48 +0800 +Subject: net: stmmac: power up/down serdes in stmmac_open/release + +From: Junxiao Chang + +[ Upstream commit 49725ffc15fc4e9fae68c55b691fd25168cbe5c1 ] + +This commit fixes DMA engine reset timeout issue in suspend/resume +with ADLink I-Pi SMARC Plus board which dmesg shows: +... +[ 54.678271] PM: suspend exit +[ 54.754066] intel-eth-pci 0000:00:1d.2 enp0s29f2: PHY [stmmac-3:01] driver [Maxlinear Ethernet GPY215B] (irq=POLL) +[ 54.755808] intel-eth-pci 0000:00:1d.2 enp0s29f2: Register MEM_TYPE_PAGE_POOL RxQ-0 +... +[ 54.780482] intel-eth-pci 0000:00:1d.2 enp0s29f2: Register MEM_TYPE_PAGE_POOL RxQ-7 +[ 55.784098] intel-eth-pci 0000:00:1d.2: Failed to reset the dma +[ 55.784111] intel-eth-pci 0000:00:1d.2 enp0s29f2: stmmac_hw_setup: DMA engine initialization failed +[ 55.784115] intel-eth-pci 0000:00:1d.2 enp0s29f2: stmmac_open: Hw setup failed +... + +The issue is related with serdes which impacts clock. There is +serdes in ADLink I-Pi SMARC board ethernet controller. Please refer to +commit b9663b7ca6ff78 ("net: stmmac: Enable SERDES power up/down sequence") +for detial. When issue is reproduced, DMA engine clock is not ready +because serdes is not powered up. + +To reproduce DMA engine reset timeout issue with hardware which has +serdes in GBE controller, install Ubuntu. In Ubuntu GUI, click +"Power Off/Log Out" -> "Suspend" menu, it disables network interface, +then goes to sleep mode. When it wakes up, it enables network +interface again. Stmmac driver is called in this way: + +1. stmmac_release: Stop network interface. In this function, it + disables DMA engine and network interface; +2. stmmac_suspend: It is called in kernel suspend flow. But because + network interface has been disabled(netif_running(ndev) is + false), it does nothing and returns directly; +3. System goes into S3 or S0ix state. Some time later, system is + waken up by keyboard or mouse; +4. stmmac_resume: It does nothing because network interface has + been disabled; +5. stmmac_open: It is called to enable network interace again. DMA + engine is initialized in this API, but serdes is not power on so + there will be DMA engine reset timeout issue. + +Similarly, serdes powerdown should be added in stmmac_release. +Network interface might be disabled by cmd "ifconfig eth0 down", +DMA engine, phy and mac have been disabled in ndo_stop callback, +serdes should be powered down as well. It doesn't make sense that +serdes is on while other components have been turned off. + +If ethernet interface is in enabled state(netif_running(ndev) is true) +before suspend/resume, the issue couldn't be reproduced because serdes +could be powered up in stmmac_resume. + +Because serdes_powerup is added in stmmac_open, it doesn't need to be +called in probe function. + +Fixes: b9663b7ca6ff78 ("net: stmmac: Enable SERDES power up/down sequence") +Signed-off-by: Junxiao Chang +Reviewed-by: Voon Weifeng +Tested-by: Jimmy JS Chen +Tested-by: Looi, Hong Aun +Link: https://lore.kernel.org/r/20220923050448.1220250-1-junxiao.chang@intel.com +Signed-off-by: Paolo Abeni +Signed-off-by: Sasha Levin +--- + .../net/ethernet/stmicro/stmmac/stmmac_main.c | 23 +++++++++++-------- + 1 file changed, 13 insertions(+), 10 deletions(-) + +diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +index 27b7bb64a028..41e71a26b1ad 100644 +--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c ++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +@@ -2907,6 +2907,15 @@ static int stmmac_open(struct net_device *dev) + goto init_error; + } + ++ if (priv->plat->serdes_powerup) { ++ ret = priv->plat->serdes_powerup(dev, priv->plat->bsp_priv); ++ if (ret < 0) { ++ netdev_err(priv->dev, "%s: Serdes powerup failed\n", ++ __func__); ++ goto init_error; ++ } ++ } ++ + ret = stmmac_hw_setup(dev, true); + if (ret < 0) { + netdev_err(priv->dev, "%s: Hw setup failed\n", __func__); +@@ -3022,6 +3031,10 @@ static int stmmac_release(struct net_device *dev) + /* Disable the MAC Rx/Tx */ + stmmac_mac_set(priv, priv->ioaddr, false); + ++ /* Powerdown Serdes if there is */ ++ if (priv->plat->serdes_powerdown) ++ priv->plat->serdes_powerdown(dev, priv->plat->bsp_priv); ++ + netif_carrier_off(dev); + + stmmac_release_ptp(priv); +@@ -5178,14 +5191,6 @@ int stmmac_dvr_probe(struct device *device, + goto error_netdev_register; + } + +- if (priv->plat->serdes_powerup) { +- ret = priv->plat->serdes_powerup(ndev, +- priv->plat->bsp_priv); +- +- if (ret < 0) +- goto error_serdes_powerup; +- } +- + #ifdef CONFIG_DEBUG_FS + stmmac_init_fs(ndev); + #endif +@@ -5197,8 +5202,6 @@ int stmmac_dvr_probe(struct device *device, + + return ret; + +-error_serdes_powerup: +- unregister_netdev(ndev); + error_netdev_register: + phylink_destroy(priv->phylink); + error_phy_setup: +-- +2.35.1 + diff --git a/queue-5.10/nvme-add-new-line-after-variable-declatation.patch b/queue-5.10/nvme-add-new-line-after-variable-declatation.patch new file mode 100644 index 00000000000..93bc3673143 --- /dev/null +++ b/queue-5.10/nvme-add-new-line-after-variable-declatation.patch @@ -0,0 +1,52 @@ +From 474e59d5fe71359429ae2e2633128ec0a6fb2329 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 ab060b4911ff..af30bfecbafd 100644 +--- a/drivers/nvme/host/core.c ++++ b/drivers/nvme/host/core.c +@@ -2285,18 +2285,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.10/nvme-fix-ioc_pr_clear-and-ioc_pr_release-ioctls-for-.patch b/queue-5.10/nvme-fix-ioc_pr_clear-and-ioc_pr_release-ioctls-for-.patch new file mode 100644 index 00000000000..46c2f0c03c7 --- /dev/null +++ b/queue-5.10/nvme-fix-ioc_pr_clear-and-ioc_pr_release-ioctls-for-.patch @@ -0,0 +1,63 @@ +From 0336d3a624619c9764865a7b5d5ca60ac2ea294d 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 af30bfecbafd..265d9199b657 100644 +--- a/drivers/nvme/host/core.c ++++ b/drivers/nvme/host/core.c +@@ -2291,14 +2291,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.10/reset-imx7-fix-the-imx8mp-pcie-phy-perst-support.patch b/queue-5.10/reset-imx7-fix-the-imx8mp-pcie-phy-perst-support.patch new file mode 100644 index 00000000000..450e719071f --- /dev/null +++ b/queue-5.10/reset-imx7-fix-the-imx8mp-pcie-phy-perst-support.patch @@ -0,0 +1,44 @@ +From c5fafc974238fce39973e046a6304de5147dc699 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 30 Aug 2022 15:46:01 +0800 +Subject: reset: imx7: Fix the iMX8MP PCIe PHY PERST support + +From: Richard Zhu + +[ Upstream commit 051d9eb403887bb11852b7a4f744728a6a4b1b58 ] + +On i.MX7/iMX8MM/iMX8MQ, the initialized default value of PERST bit(BIT3) +of SRC_PCIEPHY_RCR is 1b'1. +But i.MX8MP has one inversed default value 1b'0 of PERST bit. + +And the PERST bit should be kept 1b'1 after power and clocks are stable. +So fix the i.MX8MP PCIe PHY PERST support here. + +Fixes: e08672c03981 ("reset: imx7: Add support for i.MX8MP SoC") +Signed-off-by: Richard Zhu +Reviewed-by: Philipp Zabel +Tested-by: Marek Vasut +Tested-by: Richard Leitner +Tested-by: Alexander Stein +Signed-off-by: Philipp Zabel +Link: https://lore.kernel.org/r/1661845564-11373-5-git-send-email-hongxing.zhu@nxp.com +Signed-off-by: Sasha Levin +--- + drivers/reset/reset-imx7.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/reset/reset-imx7.c b/drivers/reset/reset-imx7.c +index 185a333df66c..d2408725eb2c 100644 +--- a/drivers/reset/reset-imx7.c ++++ b/drivers/reset/reset-imx7.c +@@ -329,6 +329,7 @@ static int imx8mp_reset_set(struct reset_controller_dev *rcdev, + break; + + case IMX8MP_RESET_PCIE_CTRL_APPS_EN: ++ case IMX8MP_RESET_PCIEPHY_PERST: + value = assert ? 0 : bit; + break; + } +-- +2.35.1 + diff --git a/queue-5.10/revert-drm-bridge-analogix-dp-add-panel-prepare-unpr.patch b/queue-5.10/revert-drm-bridge-analogix-dp-add-panel-prepare-unpr.patch new file mode 100644 index 00000000000..f419868582a --- /dev/null +++ b/queue-5.10/revert-drm-bridge-analogix-dp-add-panel-prepare-unpr.patch @@ -0,0 +1,88 @@ +From df2eec4641b25579cd381d79f49f3e8e85d26456 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 a7bcb429c02b..e8baa07450b7 100644 +--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c ++++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +@@ -1865,12 +1865,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); +@@ -1885,13 +1879,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.10/selftests-fix-the-if-conditions-of-in-test_extra_fil.patch b/queue-5.10/selftests-fix-the-if-conditions-of-in-test_extra_fil.patch new file mode 100644 index 00000000000..292025e49ca --- /dev/null +++ b/queue-5.10/selftests-fix-the-if-conditions-of-in-test_extra_fil.patch @@ -0,0 +1,37 @@ +From c866c2519ba2ab027a59f7f272866996c9ac02a1 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.10/series b/queue-5.10/series index ab9ed14ee85..5e459db03c0 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -28,3 +28,23 @@ media-dvb_vb2-fix-possible-out-of-bound-access.patch media-rkvdec-disable-h.264-error-detection.patch swiotlb-max-mapping-size-takes-min-align-mask-into-account.patch scsi-hisi_sas-revert-scsi-hisi_sas-limit-max-hw-sectors-for-v3-hw.patch +arm-dts-am33xx-fix-mmchs0-dma-properties.patch +reset-imx7-fix-the-imx8mp-pcie-phy-perst-support.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 +asoc-tas2770-reinit-regcache-on-reset.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 +net-sched-act_ct-fix-possible-refcount-leak-in-tcf_c.patch +cxgb4-fix-missing-unlock-on-ethofld-desc-collect-fai.patch +nvme-add-new-line-after-variable-declatation.patch +nvme-fix-ioc_pr_clear-and-ioc_pr_release-ioctls-for-.patch +net-stmmac-power-up-down-serdes-in-stmmac_open-relea.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 +kvm-x86-hide-ia32_platform_dca_cap-31-0-from-the-gue.patch diff --git a/queue-5.10/soc-sunxi-sram-actually-claim-sram-regions.patch b/queue-5.10/soc-sunxi-sram-actually-claim-sram-regions.patch new file mode 100644 index 00000000000..cd65663c92b --- /dev/null +++ b/queue-5.10/soc-sunxi-sram-actually-claim-sram-regions.patch @@ -0,0 +1,40 @@ +From 164e288bb000cca2ea721e608f63bc4587bdebb5 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 d4c7bd59429e..5d1305483542 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.10/soc-sunxi-sram-fix-debugfs-info-for-a64-sram-c.patch b/queue-5.10/soc-sunxi-sram-fix-debugfs-info-for-a64-sram-c.patch new file mode 100644 index 00000000000..0f1838b18b9 --- /dev/null +++ b/queue-5.10/soc-sunxi-sram-fix-debugfs-info-for-a64-sram-c.patch @@ -0,0 +1,40 @@ +From 0127b917c3f485a40d8822157d6938c299866460 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 ef1620ea4bdb..443e38e9f30a 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.10/soc-sunxi-sram-fix-probe-function-ordering-issues.patch b/queue-5.10/soc-sunxi-sram-fix-probe-function-ordering-issues.patch new file mode 100644 index 00000000000..702386da8a1 --- /dev/null +++ b/queue-5.10/soc-sunxi-sram-fix-probe-function-ordering-issues.patch @@ -0,0 +1,74 @@ +From be79a8e0ee64541df8e6e97a44db57fd7ef6baf1 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 ba05727b2614..ef1620ea4bdb 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.10/soc-sunxi-sram-prevent-the-driver-from-being-unbound.patch b/queue-5.10/soc-sunxi-sram-prevent-the-driver-from-being-unbound.patch new file mode 100644 index 00000000000..04a5a328a3d --- /dev/null +++ b/queue-5.10/soc-sunxi-sram-prevent-the-driver-from-being-unbound.patch @@ -0,0 +1,53 @@ +From b249c8897b62a1f9cd67d302a068e1db855669df 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 5d1305483542..ccf42086f6ca 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.10/soc-sunxi_sram-make-use-of-the-helper-function-devm_.patch b/queue-5.10/soc-sunxi_sram-make-use-of-the-helper-function-devm_.patch new file mode 100644 index 00000000000..bd0596b0528 --- /dev/null +++ b/queue-5.10/soc-sunxi_sram-make-use-of-the-helper-function-devm_.patch @@ -0,0 +1,48 @@ +From 9fce3743d99779af831f5784785fa7e608d18358 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 ccf42086f6ca..ba05727b2614 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.10/usbnet-fix-memory-leak-in-usbnet_disconnect.patch b/queue-5.10/usbnet-fix-memory-leak-in-usbnet_disconnect.patch new file mode 100644 index 00000000000..28ddb1fce6e --- /dev/null +++ b/queue-5.10/usbnet-fix-memory-leak-in-usbnet_disconnect.patch @@ -0,0 +1,56 @@ +From b8432ad3a587afa48ff2517e378e94e3c3ab8d4d 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 1239fd57514b..43d70348343b 100644 +--- a/drivers/net/usb/usbnet.c ++++ b/drivers/net/usb/usbnet.c +@@ -1567,6 +1567,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); +@@ -1583,7 +1584,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