aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/backport-5.15/765-1-net-next-net-dsa-reorder-PHY-initialization-with-MTU-setup-in.patch
diff options
context:
space:
mode:
authorAnsuel Smith <ansuelsmth@gmail.com>2022-02-02 22:32:57 +0100
committerDaniel Golle <daniel@makrotopia.org>2022-03-27 04:51:38 +0100
commit327b6dbd98ed98be04eb891d9682ae212fe9f09d (patch)
treef2634d6e3390d83b405c55a66c6205c3961ef477 /target/linux/generic/backport-5.15/765-1-net-next-net-dsa-reorder-PHY-initialization-with-MTU-setup-in.patch
parent30a5e073906ab671c31063cb0deed00686369277 (diff)
downloadupstream-327b6dbd98ed98be04eb891d9682ae212fe9f09d.tar.gz
upstream-327b6dbd98ed98be04eb891d9682ae212fe9f09d.tar.bz2
upstream-327b6dbd98ed98be04eb891d9682ae212fe9f09d.zip
generic: 5.15: backport mdio improvement patch for qca8k
Backport qca8k mdio improvement patch merged upstream, where we use eth packet when available to send mdio commands. This should improve speed and cause less load on the CPU. Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
Diffstat (limited to 'target/linux/generic/backport-5.15/765-1-net-next-net-dsa-reorder-PHY-initialization-with-MTU-setup-in.patch')
-rw-r--r--target/linux/generic/backport-5.15/765-1-net-next-net-dsa-reorder-PHY-initialization-with-MTU-setup-in.patch57
1 files changed, 57 insertions, 0 deletions
diff --git a/target/linux/generic/backport-5.15/765-1-net-next-net-dsa-reorder-PHY-initialization-with-MTU-setup-in.patch b/target/linux/generic/backport-5.15/765-1-net-next-net-dsa-reorder-PHY-initialization-with-MTU-setup-in.patch
new file mode 100644
index 0000000000..25c6ac2e8f
--- /dev/null
+++ b/target/linux/generic/backport-5.15/765-1-net-next-net-dsa-reorder-PHY-initialization-with-MTU-setup-in.patch
@@ -0,0 +1,57 @@
+From 904e112ad431492b34f235f59738e8312802bbf9 Mon Sep 17 00:00:00 2001
+From: Vladimir Oltean <vladimir.oltean@nxp.com>
+Date: Thu, 6 Jan 2022 01:11:12 +0200
+Subject: [PATCH 1/6] net: dsa: reorder PHY initialization with MTU setup in
+ slave.c
+
+In dsa_slave_create() there are 2 sections that take rtnl_lock():
+MTU change and netdev registration. They are separated by PHY
+initialization.
+
+There isn't any strict ordering requirement except for the fact that
+netdev registration should be last. Therefore, we can perform the MTU
+change a bit later, after the PHY setup. A future change will then be
+able to merge the two rtnl_lock sections into one.
+
+Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
+Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ net/dsa/slave.c | 14 +++++++-------
+ 1 file changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/net/dsa/slave.c b/net/dsa/slave.c
+index 88f7b8686dac..88bcdba92fa7 100644
+--- a/net/dsa/slave.c
++++ b/net/dsa/slave.c
+@@ -2011,13 +2011,6 @@ int dsa_slave_create(struct dsa_port *port)
+ port->slave = slave_dev;
+ dsa_slave_setup_tagger(slave_dev);
+
+- rtnl_lock();
+- ret = dsa_slave_change_mtu(slave_dev, ETH_DATA_LEN);
+- rtnl_unlock();
+- if (ret && ret != -EOPNOTSUPP)
+- dev_warn(ds->dev, "nonfatal error %d setting MTU to %d on port %d\n",
+- ret, ETH_DATA_LEN, port->index);
+-
+ netif_carrier_off(slave_dev);
+
+ ret = dsa_slave_phy_setup(slave_dev);
+@@ -2028,6 +2021,13 @@ int dsa_slave_create(struct dsa_port *port)
+ goto out_gcells;
+ }
+
++ rtnl_lock();
++ ret = dsa_slave_change_mtu(slave_dev, ETH_DATA_LEN);
++ rtnl_unlock();
++ if (ret && ret != -EOPNOTSUPP)
++ dev_warn(ds->dev, "nonfatal error %d setting MTU to %d on port %d\n",
++ ret, ETH_DATA_LEN, port->index);
++
+ rtnl_lock();
+
+ ret = register_netdevice(slave_dev);
+--
+2.34.1
+