aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/backport-5.10/610-v5.13-41-net-ethernet-mtk_eth_soc-reduce-MDIO-bus-access-late.patch
diff options
context:
space:
mode:
authorIlya Lipnitskiy <ilya.lipnitskiy@gmail.com>2021-04-23 17:19:22 -0700
committerHauke Mehrtens <hauke@hauke-m.de>2021-04-30 23:48:37 +0200
commit0d6f20723047c02bd624f0384df9dc74ee075bc7 (patch)
treef8ecc404999fafdf99475653201802143f1c60f2 /target/linux/generic/backport-5.10/610-v5.13-41-net-ethernet-mtk_eth_soc-reduce-MDIO-bus-access-late.patch
parent4b14b42abfe263ea9f67ff4e29e563e1160005fc (diff)
downloadupstream-0d6f20723047c02bd624f0384df9dc74ee075bc7.tar.gz
upstream-0d6f20723047c02bd624f0384df9dc74ee075bc7.tar.bz2
upstream-0d6f20723047c02bd624f0384df9dc74ee075bc7.zip
kernel: backport mtk_soc_eth fixes from v5.13
Fixes logic that leads to this error when booting mt7621 and other devices that use the mediatek ethernet driver: [ 23.144378] mtk_soc_eth 1e100000.ethernet: PPE table busy The rest are mostly moved from pending-5.10 to backport-5.10 with a couple of cleanups and improvements from upstream. Refresh patches. Links: https://git.kernel.org/netdev/net-next/c/c5d66587b890 https://git.kernel.org/netdev/net-next/c/3f57d8c40fea https://git.kernel.org/netdev/net-next/c/5196c4178549 https://git.kernel.org/netdev/net-next/c/787082ab9f7b https://git.kernel.org/netdev/net-next/c/c30c4a827390 https://git.kernel.org/netdev/net-next/c/3630d519d7c3 https://git.kernel.org/netdev/net-next/c/16ef670789b2 https://git.kernel.org/netdev/net-next/c/59555a8d0dd3 https://git.kernel.org/netdev/net-next/c/6b4423b258b9 https://git.kernel.org/netdev/net-next/c/e9229ffd550b https://git.kernel.org/netdev/net-next/c/4e6bf609569c https://git.kernel.org/netdev/net-next/c/816ac3e6e67b https://git.kernel.org/netdev/net-next/c/16769a8923fa https://git.kernel.org/netdev/net-next/c/db2c7b353db3 https://git.kernel.org/netdev/net-next/c/fa817272c37e https://git.kernel.org/netdev/net-next/c/3bc8e0aff23b Fixes: f07fe36f22fc ("kernel: update flow offload patches to upstream version") Cc: Felix Fietkau <nbd@nbd.name> Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
Diffstat (limited to 'target/linux/generic/backport-5.10/610-v5.13-41-net-ethernet-mtk_eth_soc-reduce-MDIO-bus-access-late.patch')
-rw-r--r--target/linux/generic/backport-5.10/610-v5.13-41-net-ethernet-mtk_eth_soc-reduce-MDIO-bus-access-late.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/target/linux/generic/backport-5.10/610-v5.13-41-net-ethernet-mtk_eth_soc-reduce-MDIO-bus-access-late.patch b/target/linux/generic/backport-5.10/610-v5.13-41-net-ethernet-mtk_eth_soc-reduce-MDIO-bus-access-late.patch
new file mode 100644
index 0000000000..7ebc3fa903
--- /dev/null
+++ b/target/linux/generic/backport-5.10/610-v5.13-41-net-ethernet-mtk_eth_soc-reduce-MDIO-bus-access-late.patch
@@ -0,0 +1,30 @@
+From 3630d519d7c3eab92567658690e44ffe0517d109 Mon Sep 17 00:00:00 2001
+From: Felix Fietkau <nbd@nbd.name>
+Date: Thu, 22 Apr 2021 22:20:58 -0700
+Subject: [PATCH] net: ethernet: mtk_eth_soc: reduce MDIO bus access latency
+
+usleep_range often ends up sleeping much longer than the 10-20us provided
+as a range here. This causes significant latency in mdio bus acceses,
+which easily adds multiple seconds to the boot time on MT7621 when polling
+DSA slave ports.
+Use cond_resched instead of usleep_range, since the MDIO access does not
+take much time
+
+Signed-off-by: Felix Fietkau <nbd@nbd.name>
+Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/ethernet/mediatek/mtk_eth_soc.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+@@ -86,7 +86,7 @@ static int mtk_mdio_busy_wait(struct mtk
+ return 0;
+ if (time_after(jiffies, t_start + PHY_IAC_TIMEOUT))
+ break;
+- usleep_range(10, 20);
++ cond_resched();
+ }
+
+ dev_err(eth->dev, "mdio: MDIO timeout\n");