]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.11-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 12 Mar 2021 12:16:40 +0000 (13:16 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 12 Mar 2021 12:16:40 +0000 (13:16 +0100)
added patches:
net-dsa-tag_rtl4_a-fix-egress-tags.patch
net-enetc-don-t-overwrite-the-rss-indirection-table-when-initializing.patch
net-enetc-initialize-rfs-rss-memories-for-unused-ports-too.patch
net-enetc-take-the-mdio-lock-only-once-per-napi-poll-cycle.patch
sh_eth-fix-trscer-mask-for-sh771x.patch

queue-5.11/net-dsa-tag_rtl4_a-fix-egress-tags.patch [new file with mode: 0644]
queue-5.11/net-enetc-don-t-overwrite-the-rss-indirection-table-when-initializing.patch [new file with mode: 0644]
queue-5.11/net-enetc-initialize-rfs-rss-memories-for-unused-ports-too.patch [new file with mode: 0644]
queue-5.11/net-enetc-take-the-mdio-lock-only-once-per-napi-poll-cycle.patch [new file with mode: 0644]
queue-5.11/series
queue-5.11/sh_eth-fix-trscer-mask-for-sh771x.patch [new file with mode: 0644]

diff --git a/queue-5.11/net-dsa-tag_rtl4_a-fix-egress-tags.patch b/queue-5.11/net-dsa-tag_rtl4_a-fix-egress-tags.patch
new file mode 100644 (file)
index 0000000..0386192
--- /dev/null
@@ -0,0 +1,67 @@
+From 9eb8bc593a5eed167dac2029abef343854c5ba75 Mon Sep 17 00:00:00 2001
+From: DENG Qingfang <dqfext@gmail.com>
+Date: Mon, 1 Mar 2021 01:08:23 +0800
+Subject: net: dsa: tag_rtl4_a: fix egress tags
+
+From: DENG Qingfang <dqfext@gmail.com>
+
+commit 9eb8bc593a5eed167dac2029abef343854c5ba75 upstream.
+
+Commit 86dd9868b878 has several issues, but was accepted too soon
+before anyone could take a look.
+
+- Double free. dsa_slave_xmit() will free the skb if the xmit function
+  returns NULL, but the skb is already freed by eth_skb_pad(). Use
+  __skb_put_padto() to avoid that.
+- Unnecessary allocation. It has been done by DSA core since commit
+  a3b0b6479700.
+- A u16 pointer points to skb data. It should be __be16 for network
+  byte order.
+- Typo in comments. "numer" -> "number".
+
+Fixes: 86dd9868b878 ("net: dsa: tag_rtl4_a: Support also egress tags")
+Signed-off-by: DENG Qingfang <dqfext@gmail.com>
+Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
+Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/dsa/tag_rtl4_a.c |   12 +++++-------
+ 1 file changed, 5 insertions(+), 7 deletions(-)
+
+--- a/net/dsa/tag_rtl4_a.c
++++ b/net/dsa/tag_rtl4_a.c
+@@ -35,14 +35,12 @@ static struct sk_buff *rtl4a_tag_xmit(st
+                                     struct net_device *dev)
+ {
+       struct dsa_port *dp = dsa_slave_to_port(dev);
++      __be16 *p;
+       u8 *tag;
+-      u16 *p;
+       u16 out;
+       /* Pad out to at least 60 bytes */
+-      if (unlikely(eth_skb_pad(skb)))
+-              return NULL;
+-      if (skb_cow_head(skb, RTL4_A_HDR_LEN) < 0)
++      if (unlikely(__skb_put_padto(skb, ETH_ZLEN, false)))
+               return NULL;
+       netdev_dbg(dev, "add realtek tag to package to port %d\n",
+@@ -53,13 +51,13 @@ static struct sk_buff *rtl4a_tag_xmit(st
+       tag = skb->data + 2 * ETH_ALEN;
+       /* Set Ethertype */
+-      p = (u16 *)tag;
++      p = (__be16 *)tag;
+       *p = htons(RTL4_A_ETHERTYPE);
+       out = (RTL4_A_PROTOCOL_RTL8366RB << 12) | (2 << 8);
+-      /* The lower bits is the port numer */
++      /* The lower bits is the port number */
+       out |= (u8)dp->index;
+-      p = (u16 *)(tag + 2);
++      p = (__be16 *)(tag + 2);
+       *p = htons(out);
+       return skb;
diff --git a/queue-5.11/net-enetc-don-t-overwrite-the-rss-indirection-table-when-initializing.patch b/queue-5.11/net-enetc-don-t-overwrite-the-rss-indirection-table-when-initializing.patch
new file mode 100644 (file)
index 0000000..ca390a8
--- /dev/null
@@ -0,0 +1,145 @@
+From c646d10dda2dcde82c6ce5a474522621ab2b8b19 Mon Sep 17 00:00:00 2001
+From: Vladimir Oltean <vladimir.oltean@nxp.com>
+Date: Mon, 1 Mar 2021 13:18:11 +0200
+Subject: net: enetc: don't overwrite the RSS indirection table when initializing
+
+From: Vladimir Oltean <vladimir.oltean@nxp.com>
+
+commit c646d10dda2dcde82c6ce5a474522621ab2b8b19 upstream.
+
+After the blamed patch, all RX traffic gets hashed to CPU 0 because the
+hashing indirection table set up in:
+
+enetc_pf_probe
+-> enetc_alloc_si_resources
+   -> enetc_configure_si
+      -> enetc_setup_default_rss_table
+
+is overwritten later in:
+
+enetc_pf_probe
+-> enetc_init_port_rss_memory
+
+which zero-initializes the entire port RSS table in order to avoid ECC errors.
+
+The trouble really is that enetc_init_port_rss_memory really neads
+enetc_alloc_si_resources to be called, because it depends upon
+enetc_alloc_cbdr and enetc_setup_cbdr. But that whole enetc_configure_si
+thing could have been better thought out, it has nothing to do in a
+function called "alloc_si_resources", especially since its counterpart,
+"free_si_resources", does nothing to unwind the configuration of the SI.
+
+The point is, we need to pull out enetc_configure_si out of
+enetc_alloc_resources, and move it after enetc_init_port_rss_memory.
+This allows us to set up the default RSS indirection table after
+initializing the memory.
+
+Fixes: 07bf34a50e32 ("net: enetc: initialize the RFS and RSS memories")
+Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>
+Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/freescale/enetc/enetc.c    |   11 +++--------
+ drivers/net/ethernet/freescale/enetc/enetc.h    |    1 +
+ drivers/net/ethernet/freescale/enetc/enetc_pf.c |    7 +++++++
+ drivers/net/ethernet/freescale/enetc/enetc_vf.c |    7 +++++++
+ 4 files changed, 18 insertions(+), 8 deletions(-)
+
+--- a/drivers/net/ethernet/freescale/enetc/enetc.c
++++ b/drivers/net/ethernet/freescale/enetc/enetc.c
+@@ -1058,13 +1058,12 @@ static int enetc_setup_default_rss_table
+       return 0;
+ }
+-static int enetc_configure_si(struct enetc_ndev_priv *priv)
++int enetc_configure_si(struct enetc_ndev_priv *priv)
+ {
+       struct enetc_si *si = priv->si;
+       struct enetc_hw *hw = &si->hw;
+       int err;
+-      enetc_setup_cbdr(hw, &si->cbd_ring);
+       /* set SI cache attributes */
+       enetc_wr(hw, ENETC_SICAR0,
+                ENETC_SICAR_RD_COHERENT | ENETC_SICAR_WR_COHERENT);
+@@ -1112,6 +1111,8 @@ int enetc_alloc_si_resources(struct enet
+       if (err)
+               return err;
++      enetc_setup_cbdr(&si->hw, &si->cbd_ring);
++
+       priv->cls_rules = kcalloc(si->num_fs_entries, sizeof(*priv->cls_rules),
+                                 GFP_KERNEL);
+       if (!priv->cls_rules) {
+@@ -1119,14 +1120,8 @@ int enetc_alloc_si_resources(struct enet
+               goto err_alloc_cls;
+       }
+-      err = enetc_configure_si(priv);
+-      if (err)
+-              goto err_config_si;
+-
+       return 0;
+-err_config_si:
+-      kfree(priv->cls_rules);
+ err_alloc_cls:
+       enetc_clear_cbdr(&si->hw);
+       enetc_free_cbdr(priv->dev, &si->cbd_ring);
+--- a/drivers/net/ethernet/freescale/enetc/enetc.h
++++ b/drivers/net/ethernet/freescale/enetc/enetc.h
+@@ -292,6 +292,7 @@ void enetc_get_si_caps(struct enetc_si *
+ void enetc_init_si_rings_params(struct enetc_ndev_priv *priv);
+ int enetc_alloc_si_resources(struct enetc_ndev_priv *priv);
+ void enetc_free_si_resources(struct enetc_ndev_priv *priv);
++int enetc_configure_si(struct enetc_ndev_priv *priv);
+ int enetc_open(struct net_device *ndev);
+ int enetc_close(struct net_device *ndev);
+--- a/drivers/net/ethernet/freescale/enetc/enetc_pf.c
++++ b/drivers/net/ethernet/freescale/enetc/enetc_pf.c
+@@ -1108,6 +1108,12 @@ static int enetc_pf_probe(struct pci_dev
+               goto err_init_port_rss;
+       }
++      err = enetc_configure_si(priv);
++      if (err) {
++              dev_err(&pdev->dev, "Failed to configure SI\n");
++              goto err_config_si;
++      }
++
+       err = enetc_alloc_msix(priv);
+       if (err) {
+               dev_err(&pdev->dev, "MSIX alloc failed\n");
+@@ -1136,6 +1142,7 @@ err_phylink_create:
+       enetc_mdiobus_destroy(pf);
+ err_mdiobus_create:
+       enetc_free_msix(priv);
++err_config_si:
+ err_init_port_rss:
+ err_init_port_rfs:
+ err_alloc_msix:
+--- a/drivers/net/ethernet/freescale/enetc/enetc_vf.c
++++ b/drivers/net/ethernet/freescale/enetc/enetc_vf.c
+@@ -171,6 +171,12 @@ static int enetc_vf_probe(struct pci_dev
+               goto err_alloc_si_res;
+       }
++      err = enetc_configure_si(priv);
++      if (err) {
++              dev_err(&pdev->dev, "Failed to configure SI\n");
++              goto err_config_si;
++      }
++
+       err = enetc_alloc_msix(priv);
+       if (err) {
+               dev_err(&pdev->dev, "MSIX alloc failed\n");
+@@ -187,6 +193,7 @@ static int enetc_vf_probe(struct pci_dev
+ err_reg_netdev:
+       enetc_free_msix(priv);
++err_config_si:
+ err_alloc_msix:
+       enetc_free_si_resources(priv);
+ err_alloc_si_res:
diff --git a/queue-5.11/net-enetc-initialize-rfs-rss-memories-for-unused-ports-too.patch b/queue-5.11/net-enetc-initialize-rfs-rss-memories-for-unused-ports-too.patch
new file mode 100644 (file)
index 0000000..2a31cb3
--- /dev/null
@@ -0,0 +1,165 @@
+From 3222b5b613db558e9a494bbf53f3c984d90f71ea Mon Sep 17 00:00:00 2001
+From: Vladimir Oltean <vladimir.oltean@nxp.com>
+Date: Mon, 1 Mar 2021 13:18:12 +0200
+Subject: net: enetc: initialize RFS/RSS memories for unused ports too
+
+From: Vladimir Oltean <vladimir.oltean@nxp.com>
+
+commit 3222b5b613db558e9a494bbf53f3c984d90f71ea upstream.
+
+Michael reports that since linux-next-20210211, the AER messages for ECC
+errors have started reappearing, and this time they can be reliably
+reproduced with the first ping on one of his LS1028A boards.
+
+$ ping 1[   33.258069] pcieport 0000:00:1f.0: AER: Multiple Corrected error received: 0000:00:00.0
+72.16.0.1
+PING [   33.267050] pcieport 0000:00:1f.0: AER: can't find device of ID0000
+172.16.0.1 (172.16.0.1): 56 data bytes
+64 bytes from 172.16.0.1: seq=0 ttl=64 time=17.124 ms
+64 bytes from 172.16.0.1: seq=1 ttl=64 time=0.273 ms
+
+$ devmem 0x1f8010e10 32
+0xC0000006
+
+It isn't clear why this is necessary, but it seems that for the errors
+to go away, we must clear the entire RFS and RSS memory, not just for
+the ports in use.
+
+Sadly the code is structured in such a way that we can't have unified
+logic for the used and unused ports. For the minimal initialization of
+an unused port, we need just to enable and ioremap the PF memory space,
+and a control buffer descriptor ring. Unused ports must then free the
+CBDR because the driver will exit, but used ports can not pick up from
+where that code path left, since the CBDR API does not reinitialize a
+ring when setting it up, so its producer and consumer indices are out of
+sync between the software and hardware state. So a separate
+enetc_init_unused_port function was created, and it gets called right
+after the PF memory space is enabled.
+
+Fixes: 07bf34a50e32 ("net: enetc: initialize the RFS and RSS memories")
+Reported-by: Michael Walle <michael@walle.cc>
+Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>
+Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
+Tested-by: Michael Walle <michael@walle.cc>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/freescale/enetc/enetc.c    |    8 ++---
+ drivers/net/ethernet/freescale/enetc/enetc.h    |    4 ++
+ drivers/net/ethernet/freescale/enetc/enetc_pf.c |   33 ++++++++++++++++++++----
+ 3 files changed, 36 insertions(+), 9 deletions(-)
+
+--- a/drivers/net/ethernet/freescale/enetc/enetc.c
++++ b/drivers/net/ethernet/freescale/enetc/enetc.c
+@@ -984,7 +984,7 @@ static void enetc_free_rxtx_rings(struct
+               enetc_free_tx_ring(priv->tx_ring[i]);
+ }
+-static int enetc_alloc_cbdr(struct device *dev, struct enetc_cbdr *cbdr)
++int enetc_alloc_cbdr(struct device *dev, struct enetc_cbdr *cbdr)
+ {
+       int size = cbdr->bd_count * sizeof(struct enetc_cbd);
+@@ -1005,7 +1005,7 @@ static int enetc_alloc_cbdr(struct devic
+       return 0;
+ }
+-static void enetc_free_cbdr(struct device *dev, struct enetc_cbdr *cbdr)
++void enetc_free_cbdr(struct device *dev, struct enetc_cbdr *cbdr)
+ {
+       int size = cbdr->bd_count * sizeof(struct enetc_cbd);
+@@ -1013,7 +1013,7 @@ static void enetc_free_cbdr(struct devic
+       cbdr->bd_base = NULL;
+ }
+-static void enetc_setup_cbdr(struct enetc_hw *hw, struct enetc_cbdr *cbdr)
++void enetc_setup_cbdr(struct enetc_hw *hw, struct enetc_cbdr *cbdr)
+ {
+       /* set CBDR cache attributes */
+       enetc_wr(hw, ENETC_SICAR2,
+@@ -1033,7 +1033,7 @@ static void enetc_setup_cbdr(struct enet
+       cbdr->cir = hw->reg + ENETC_SICBDRCIR;
+ }
+-static void enetc_clear_cbdr(struct enetc_hw *hw)
++void enetc_clear_cbdr(struct enetc_hw *hw)
+ {
+       enetc_wr(hw, ENETC_SICBDRMR, 0);
+ }
+--- a/drivers/net/ethernet/freescale/enetc/enetc.h
++++ b/drivers/net/ethernet/freescale/enetc/enetc.h
+@@ -310,6 +310,10 @@ int enetc_setup_tc(struct net_device *nd
+ void enetc_set_ethtool_ops(struct net_device *ndev);
+ /* control buffer descriptor ring (CBDR) */
++int enetc_alloc_cbdr(struct device *dev, struct enetc_cbdr *cbdr);
++void enetc_free_cbdr(struct device *dev, struct enetc_cbdr *cbdr);
++void enetc_setup_cbdr(struct enetc_hw *hw, struct enetc_cbdr *cbdr);
++void enetc_clear_cbdr(struct enetc_hw *hw);
+ int enetc_set_mac_flt_entry(struct enetc_si *si, int index,
+                           char *mac_addr, int si_map);
+ int enetc_clear_mac_flt_entry(struct enetc_si *si, int index);
+--- a/drivers/net/ethernet/freescale/enetc/enetc_pf.c
++++ b/drivers/net/ethernet/freescale/enetc/enetc_pf.c
+@@ -1041,6 +1041,26 @@ static int enetc_init_port_rss_memory(st
+       return err;
+ }
++static void enetc_init_unused_port(struct enetc_si *si)
++{
++      struct device *dev = &si->pdev->dev;
++      struct enetc_hw *hw = &si->hw;
++      int err;
++
++      si->cbd_ring.bd_count = ENETC_CBDR_DEFAULT_SIZE;
++      err = enetc_alloc_cbdr(dev, &si->cbd_ring);
++      if (err)
++              return;
++
++      enetc_setup_cbdr(hw, &si->cbd_ring);
++
++      enetc_init_port_rfs_memory(si);
++      enetc_init_port_rss_memory(si);
++
++      enetc_clear_cbdr(hw);
++      enetc_free_cbdr(dev, &si->cbd_ring);
++}
++
+ static int enetc_pf_probe(struct pci_dev *pdev,
+                         const struct pci_device_id *ent)
+ {
+@@ -1051,11 +1071,6 @@ static int enetc_pf_probe(struct pci_dev
+       struct enetc_pf *pf;
+       int err;
+-      if (node && !of_device_is_available(node)) {
+-              dev_info(&pdev->dev, "device is disabled, skipping\n");
+-              return -ENODEV;
+-      }
+-
+       err = enetc_pci_probe(pdev, KBUILD_MODNAME, sizeof(*pf));
+       if (err) {
+               dev_err(&pdev->dev, "PCI probing failed\n");
+@@ -1069,6 +1084,13 @@ static int enetc_pf_probe(struct pci_dev
+               goto err_map_pf_space;
+       }
++      if (node && !of_device_is_available(node)) {
++              enetc_init_unused_port(si);
++              dev_info(&pdev->dev, "device is disabled, skipping\n");
++              err = -ENODEV;
++              goto err_device_disabled;
++      }
++
+       pf = enetc_si_priv(si);
+       pf->si = si;
+       pf->total_vfs = pci_sriov_get_totalvfs(pdev);
+@@ -1151,6 +1173,7 @@ err_alloc_si_res:
+       si->ndev = NULL;
+       free_netdev(ndev);
+ err_alloc_netdev:
++err_device_disabled:
+ err_map_pf_space:
+       enetc_pci_remove(pdev);
diff --git a/queue-5.11/net-enetc-take-the-mdio-lock-only-once-per-napi-poll-cycle.patch b/queue-5.11/net-enetc-take-the-mdio-lock-only-once-per-napi-poll-cycle.patch
new file mode 100644 (file)
index 0000000..528d0e9
--- /dev/null
@@ -0,0 +1,173 @@
+From 6d36ecdbc4410e61a0e02adc5d3abeee22a8ffd3 Mon Sep 17 00:00:00 2001
+From: Vladimir Oltean <vladimir.oltean@nxp.com>
+Date: Mon, 1 Mar 2021 13:18:13 +0200
+Subject: net: enetc: take the MDIO lock only once per NAPI poll cycle
+
+From: Vladimir Oltean <vladimir.oltean@nxp.com>
+
+commit 6d36ecdbc4410e61a0e02adc5d3abeee22a8ffd3 upstream.
+
+The workaround for the ENETC MDIO erratum caused a performance
+degradation of 82 Kpps (seen with IP forwarding of two 1Gbps streams of
+64B packets). This is due to excessive locking and unlocking in the fast
+path, which can be avoided.
+
+By taking the MDIO read-side lock only once per NAPI poll cycle, we are
+able to regain 54 Kpps (65%) of the performance hit. The rest of the
+performance degradation comes from the TX data path, but unfortunately
+it doesn't look like we can optimize that away easily, even with
+netdev_xmit_more(), there just isn't any skb batching done, to help with
+taking the MDIO lock less often than once per packet.
+
+We need to change the register accessor type for enetc_get_tx_tstamp,
+because it now runs under the enetc_lock_mdio as per the new call path
+detailed below:
+
+enetc_msix
+-> napi_schedule
+   -> enetc_poll
+      -> enetc_lock_mdio
+      -> enetc_clean_tx_ring
+         -> enetc_get_tx_tstamp
+      -> enetc_clean_rx_ring
+      -> enetc_unlock_mdio
+
+Fixes: fd5736bf9f23 ("enetc: Workaround for MDIO register access issue")
+Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/freescale/enetc/enetc.c    |   31 ++++++------------------
+ drivers/net/ethernet/freescale/enetc/enetc_hw.h |    2 +
+ 2 files changed, 11 insertions(+), 22 deletions(-)
+
+--- a/drivers/net/ethernet/freescale/enetc/enetc.c
++++ b/drivers/net/ethernet/freescale/enetc/enetc.c
+@@ -281,6 +281,8 @@ static int enetc_poll(struct napi_struct
+       int work_done;
+       int i;
++      enetc_lock_mdio();
++
+       for (i = 0; i < v->count_tx_rings; i++)
+               if (!enetc_clean_tx_ring(&v->tx_ring[i], budget))
+                       complete = false;
+@@ -291,8 +293,10 @@ static int enetc_poll(struct napi_struct
+       if (work_done)
+               v->rx_napi_work = true;
+-      if (!complete)
++      if (!complete) {
++              enetc_unlock_mdio();
+               return budget;
++      }
+       napi_complete_done(napi, work_done);
+@@ -301,8 +305,6 @@ static int enetc_poll(struct napi_struct
+       v->rx_napi_work = false;
+-      enetc_lock_mdio();
+-
+       /* enable interrupts */
+       enetc_wr_reg_hot(v->rbier, ENETC_RBIER_RXTIE);
+@@ -327,8 +329,8 @@ static void enetc_get_tx_tstamp(struct e
+ {
+       u32 lo, hi, tstamp_lo;
+-      lo = enetc_rd(hw, ENETC_SICTR0);
+-      hi = enetc_rd(hw, ENETC_SICTR1);
++      lo = enetc_rd_hot(hw, ENETC_SICTR0);
++      hi = enetc_rd_hot(hw, ENETC_SICTR1);
+       tstamp_lo = le32_to_cpu(txbd->wb.tstamp);
+       if (lo <= tstamp_lo)
+               hi -= 1;
+@@ -358,9 +360,7 @@ static bool enetc_clean_tx_ring(struct e
+       i = tx_ring->next_to_clean;
+       tx_swbd = &tx_ring->tx_swbd[i];
+-      enetc_lock_mdio();
+       bds_to_clean = enetc_bd_ready_count(tx_ring, i);
+-      enetc_unlock_mdio();
+       do_tstamp = false;
+@@ -403,8 +403,6 @@ static bool enetc_clean_tx_ring(struct e
+                       tx_swbd = tx_ring->tx_swbd;
+               }
+-              enetc_lock_mdio();
+-
+               /* BD iteration loop end */
+               if (is_eof) {
+                       tx_frm_cnt++;
+@@ -415,8 +413,6 @@ static bool enetc_clean_tx_ring(struct e
+               if (unlikely(!bds_to_clean))
+                       bds_to_clean = enetc_bd_ready_count(tx_ring, i);
+-
+-              enetc_unlock_mdio();
+       }
+       tx_ring->next_to_clean = i;
+@@ -660,8 +656,6 @@ static int enetc_clean_rx_ring(struct en
+               u32 bd_status;
+               u16 size;
+-              enetc_lock_mdio();
+-
+               if (cleaned_cnt >= ENETC_RXBD_BUNDLE) {
+                       int count = enetc_refill_rx_ring(rx_ring, cleaned_cnt);
+@@ -672,19 +666,15 @@ static int enetc_clean_rx_ring(struct en
+               rxbd = enetc_rxbd(rx_ring, i);
+               bd_status = le32_to_cpu(rxbd->r.lstatus);
+-              if (!bd_status) {
+-                      enetc_unlock_mdio();
++              if (!bd_status)
+                       break;
+-              }
+               enetc_wr_reg_hot(rx_ring->idr, BIT(rx_ring->index));
+               dma_rmb(); /* for reading other rxbd fields */
+               size = le16_to_cpu(rxbd->r.buf_len);
+               skb = enetc_map_rx_buff_to_skb(rx_ring, i, size);
+-              if (!skb) {
+-                      enetc_unlock_mdio();
++              if (!skb)
+                       break;
+-              }
+               enetc_get_offloads(rx_ring, rxbd, skb);
+@@ -696,7 +686,6 @@ static int enetc_clean_rx_ring(struct en
+               if (unlikely(bd_status &
+                            ENETC_RXBD_LSTATUS(ENETC_RXBD_ERR_MASK))) {
+-                      enetc_unlock_mdio();
+                       dev_kfree_skb(skb);
+                       while (!(bd_status & ENETC_RXBD_LSTATUS_F)) {
+                               dma_rmb();
+@@ -736,8 +725,6 @@ static int enetc_clean_rx_ring(struct en
+               enetc_process_skb(rx_ring, skb);
+-              enetc_unlock_mdio();
+-
+               napi_gro_receive(napi, skb);
+               rx_frm_cnt++;
+--- a/drivers/net/ethernet/freescale/enetc/enetc_hw.h
++++ b/drivers/net/ethernet/freescale/enetc/enetc_hw.h
+@@ -453,6 +453,8 @@ static inline u64 _enetc_rd_reg64_wa(voi
+ #define enetc_wr_reg(reg, val)                _enetc_wr_reg_wa((reg), (val))
+ #define enetc_rd(hw, off)             enetc_rd_reg((hw)->reg + (off))
+ #define enetc_wr(hw, off, val)                enetc_wr_reg((hw)->reg + (off), val)
++#define enetc_rd_hot(hw, off)         enetc_rd_reg_hot((hw)->reg + (off))
++#define enetc_wr_hot(hw, off, val)    enetc_wr_reg_hot((hw)->reg + (off), val)
+ #define enetc_rd64(hw, off)           _enetc_rd_reg64_wa((hw)->reg + (off))
+ /* port register accessors - PF only */
+ #define enetc_port_rd(hw, off)                enetc_rd_reg((hw)->port + (off))
index 97781ecc680a762b792d218cee99f2402a0afea9..1e99ea7f8b14520803ff380e3da99f0bce913c49 100644 (file)
@@ -41,3 +41,8 @@ cifs-fix-credit-accounting-for-extra-channel.patch
 cifs-return-proper-error-code-in-statfs-2.patch
 revert-mm-slub-consider-rest-of-partial-list-if-acquire_slab-fails.patch
 docs-networking-drop-special-stable-handling.patch
+net-dsa-tag_rtl4_a-fix-egress-tags.patch
+sh_eth-fix-trscer-mask-for-sh771x.patch
+net-enetc-don-t-overwrite-the-rss-indirection-table-when-initializing.patch
+net-enetc-initialize-rfs-rss-memories-for-unused-ports-too.patch
+net-enetc-take-the-mdio-lock-only-once-per-napi-poll-cycle.patch
diff --git a/queue-5.11/sh_eth-fix-trscer-mask-for-sh771x.patch b/queue-5.11/sh_eth-fix-trscer-mask-for-sh771x.patch
new file mode 100644 (file)
index 0000000..abaa70e
--- /dev/null
@@ -0,0 +1,36 @@
+From 8c91bc3d44dfef8284af384877fbe61117e8b7d1 Mon Sep 17 00:00:00 2001
+From: Sergey Shtylyov <s.shtylyov@omprussia.ru>
+Date: Sun, 28 Feb 2021 23:25:43 +0300
+Subject: sh_eth: fix TRSCER mask for SH771x
+
+From: Sergey Shtylyov <s.shtylyov@omprussia.ru>
+
+commit 8c91bc3d44dfef8284af384877fbe61117e8b7d1 upstream.
+
+According  to  the SH7710, SH7712, SH7713 Group User's Manual: Hardware,
+Rev. 3.00, the TRSCER register actually has only bit 7 valid (and named
+differently), with all the other bits reserved. Apparently, this was not
+the case with some early revisions of the manual as we have the other
+bits declared (and set) in the original driver.  Follow the suit and add
+the explicit sh_eth_cpu_data::trscer_err_mask initializer for SH771x...
+
+Fixes: 86a74ff21a7a ("net: sh_eth: add support for Renesas SuperH Ethernet")
+Signed-off-by: Sergey Shtylyov <s.shtylyov@omprussia.ru>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/renesas/sh_eth.c |    3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/drivers/net/ethernet/renesas/sh_eth.c
++++ b/drivers/net/ethernet/renesas/sh_eth.c
+@@ -1089,6 +1089,9 @@ static struct sh_eth_cpu_data sh771x_dat
+                         EESIPR_CEEFIP | EESIPR_CELFIP |
+                         EESIPR_RRFIP | EESIPR_RTLFIP | EESIPR_RTSFIP |
+                         EESIPR_PREIP | EESIPR_CERFIP,
++
++      .trscer_err_mask = DESC_I_RINT8,
++
+       .tsu            = 1,
+       .dual_port      = 1,
+ };