From: Greg Kroah-Hartman Date: Mon, 9 May 2022 11:17:33 +0000 (+0200) Subject: 5.4-stable patches X-Git-Tag: v4.9.313~58 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=99bdaca6dd19ce80b860f825495cbf1aca907d05;p=thirdparty%2Fkernel%2Fstable-queue.git 5.4-stable patches added patches: bnxt_en-fix-possible-bnxt_open-failure-caused-by-wrong-rfs-flag.patch selftests-mirror_gre_bridge_1q-avoid-changing-pvid-while-interface-is-operational.patch smsc911x-allow-using-irq0.patch --- diff --git a/queue-5.4/bnxt_en-fix-possible-bnxt_open-failure-caused-by-wrong-rfs-flag.patch b/queue-5.4/bnxt_en-fix-possible-bnxt_open-failure-caused-by-wrong-rfs-flag.patch new file mode 100644 index 00000000000..08c5c038c5f --- /dev/null +++ b/queue-5.4/bnxt_en-fix-possible-bnxt_open-failure-caused-by-wrong-rfs-flag.patch @@ -0,0 +1,76 @@ +From 13ba794397e45e52893cfc21d7a69cb5f341b407 Mon Sep 17 00:00:00 2001 +From: Somnath Kotur +Date: Mon, 2 May 2022 21:13:10 -0400 +Subject: bnxt_en: Fix possible bnxt_open() failure caused by wrong RFS flag + +From: Somnath Kotur + +commit 13ba794397e45e52893cfc21d7a69cb5f341b407 upstream. + +bnxt_open() can fail in this code path, especially on a VF when +it fails to reserve default rings: + +bnxt_open() + __bnxt_open_nic() + bnxt_clear_int_mode() + bnxt_init_dflt_ring_mode() + +RX rings would be set to 0 when we hit this error path. + +It is possible for a subsequent bnxt_open() call to potentially succeed +with a code path like this: + +bnxt_open() + bnxt_hwrm_if_change() + bnxt_fw_init_one() + bnxt_fw_init_one_p3() + bnxt_set_dflt_rfs() + bnxt_rfs_capable() + bnxt_hwrm_reserve_rings() + +On older chips, RFS is capable if we can reserve the number of vnics that +is equal to RX rings + 1. But since RX rings is still set to 0 in this +code path, we may mistakenly think that RFS is supported for 0 RX rings. + +Later, when the default RX rings are reserved and we try to enable +RFS, it would fail and cause bnxt_open() to fail unnecessarily. + +We fix this in 2 places. bnxt_rfs_capable() will always return false if +RX rings is not yet set. bnxt_init_dflt_ring_mode() will call +bnxt_set_dflt_rfs() which will always clear the RFS flags if RFS is not +supported. + +Fixes: 20d7d1c5c9b1 ("bnxt_en: reliably allocate IRQ table on reset to avoid crash") +Signed-off-by: Somnath Kotur +Signed-off-by: Michael Chan +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/broadcom/bnxt/bnxt.c | 9 ++++----- + 1 file changed, 4 insertions(+), 5 deletions(-) + +--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c ++++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c +@@ -9791,7 +9791,7 @@ static bool bnxt_rfs_capable(struct bnxt + + if (bp->flags & BNXT_FLAG_CHIP_P5) + return bnxt_rfs_supported(bp); +- if (!(bp->flags & BNXT_FLAG_MSIX_CAP) || !bnxt_can_reserve_rings(bp)) ++ if (!(bp->flags & BNXT_FLAG_MSIX_CAP) || !bnxt_can_reserve_rings(bp) || !bp->rx_nr_rings) + return false; + + vnics = 1 + bp->rx_nr_rings; +@@ -11725,10 +11725,9 @@ static int bnxt_init_dflt_ring_mode(stru + goto init_dflt_ring_err; + + bp->tx_nr_rings_per_tc = bp->tx_nr_rings; +- if (bnxt_rfs_supported(bp) && bnxt_rfs_capable(bp)) { +- bp->flags |= BNXT_FLAG_RFS; +- bp->dev->features |= NETIF_F_NTUPLE; +- } ++ ++ bnxt_set_dflt_rfs(bp); ++ + init_dflt_ring_err: + bnxt_ulp_irq_restart(bp, rc); + return rc; diff --git a/queue-5.4/selftests-mirror_gre_bridge_1q-avoid-changing-pvid-while-interface-is-operational.patch b/queue-5.4/selftests-mirror_gre_bridge_1q-avoid-changing-pvid-while-interface-is-operational.patch new file mode 100644 index 00000000000..24e6ef89677 --- /dev/null +++ b/queue-5.4/selftests-mirror_gre_bridge_1q-avoid-changing-pvid-while-interface-is-operational.patch @@ -0,0 +1,50 @@ +From 3122257c02afd9f199a8fc84ae981e1fc4958532 Mon Sep 17 00:00:00 2001 +From: Ido Schimmel +Date: Mon, 2 May 2022 11:45:07 +0300 +Subject: selftests: mirror_gre_bridge_1q: Avoid changing PVID while interface is operational + +From: Ido Schimmel + +commit 3122257c02afd9f199a8fc84ae981e1fc4958532 upstream. + +In emulated environments, the bridge ports enslaved to br1 get a carrier +before changing br1's PVID. This means that by the time the PVID is +changed, br1 is already operational and configured with an IPv6 +link-local address. + +When the test is run with netdevs registered by mlxsw, changing the PVID +is vetoed, as changing the VID associated with an existing L3 interface +is forbidden. This restriction is similar to the 8021q driver's +restriction of changing the VID of an existing interface. + +Fix this by taking br1 down and bringing it back up when it is fully +configured. + +With this fix, the test reliably passes on top of both the SW and HW +data paths (emulated or not). + +Fixes: 239e754af854 ("selftests: forwarding: Test mirror-to-gretap w/ UL 802.1q") +Signed-off-by: Ido Schimmel +Reviewed-by: Petr Machata +Link: https://lore.kernel.org/r/20220502084507.364774-1-idosch@nvidia.com +Signed-off-by: Paolo Abeni +Signed-off-by: Greg Kroah-Hartman +--- + tools/testing/selftests/net/forwarding/mirror_gre_bridge_1q.sh | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/tools/testing/selftests/net/forwarding/mirror_gre_bridge_1q.sh ++++ b/tools/testing/selftests/net/forwarding/mirror_gre_bridge_1q.sh +@@ -61,9 +61,12 @@ setup_prepare() + + vrf_prepare + mirror_gre_topo_create ++ # Avoid changing br1's PVID while it is operational as a L3 interface. ++ ip link set dev br1 down + + ip link set dev $swp3 master br1 + bridge vlan add dev br1 vid 555 pvid untagged self ++ ip link set dev br1 up + ip address add dev br1 192.0.2.129/28 + ip address add dev br1 2001:db8:2::1/64 + diff --git a/queue-5.4/series b/queue-5.4/series index 90dc4899d3f..e9dac8dd207 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -27,3 +27,6 @@ rdma-siw-fix-a-condition-race-issue-in-mpa-request-processing.patch net-ethernet-mediatek-add-missing-of_node_put-in-mtk_sgmii_init.patch net-stmmac-dwmac-sun8i-add-missing-of_node_put-in-sun8i_dwmac_register_mdio_mux.patch net-emaclite-add-error-handling-for-of_address_to_resource.patch +selftests-mirror_gre_bridge_1q-avoid-changing-pvid-while-interface-is-operational.patch +bnxt_en-fix-possible-bnxt_open-failure-caused-by-wrong-rfs-flag.patch +smsc911x-allow-using-irq0.patch diff --git a/queue-5.4/smsc911x-allow-using-irq0.patch b/queue-5.4/smsc911x-allow-using-irq0.patch new file mode 100644 index 00000000000..c6eae4818d5 --- /dev/null +++ b/queue-5.4/smsc911x-allow-using-irq0.patch @@ -0,0 +1,42 @@ +From 5ef9b803a4af0f5e42012176889b40bb2a978b18 Mon Sep 17 00:00:00 2001 +From: Sergey Shtylyov +Date: Mon, 2 May 2022 23:14:09 +0300 +Subject: smsc911x: allow using IRQ0 + +From: Sergey Shtylyov + +commit 5ef9b803a4af0f5e42012176889b40bb2a978b18 upstream. + +The AlphaProject AP-SH4A-3A/AP-SH4AD-0A SH boards use IRQ0 for their SMSC +LAN911x Ethernet chip, so the networking on them must have been broken by +commit 965b2aa78fbc ("net/smsc911x: fix irq resource allocation failure") +which filtered out 0 as well as the negative error codes -- it was kinda +correct at the time, as platform_get_irq() could return 0 on of_irq_get() +failure and on the actual 0 in an IRQ resource. This issue was fixed by +me (back in 2016!), so we should be able to fix this driver to allow IRQ0 +usage again... + +When merging this to the stable kernels, make sure you also merge commit +e330b9a6bb35 ("platform: don't return 0 from platform_get_irq[_byname]() +on error") -- that's my fix to platform_get_irq() for the DT platforms... + +Fixes: 965b2aa78fbc ("net/smsc911x: fix irq resource allocation failure") +Signed-off-by: Sergey Shtylyov +Link: https://lore.kernel.org/r/656036e4-6387-38df-b8a7-6ba683b16e63@omp.ru +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/smsc/smsc911x.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/ethernet/smsc/smsc911x.c ++++ b/drivers/net/ethernet/smsc/smsc911x.c +@@ -2433,7 +2433,7 @@ static int smsc911x_drv_probe(struct pla + if (irq == -EPROBE_DEFER) { + retval = -EPROBE_DEFER; + goto out_0; +- } else if (irq <= 0) { ++ } else if (irq < 0) { + pr_warn("Could not allocate irq resource\n"); + retval = -ENODEV; + goto out_0;