[openwrt/openwrt] bcm4908: fix b53 regression regarding RGMII reg(s)
LEDE Commits
lede-commits at lists.infradead.org
Mon Nov 8 08:52:40 PST 2021
rmilecki pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/c4ff53b971380dca094e94631bbb4044458c9ded
commit c4ff53b971380dca094e94631bbb4044458c9ded
Author: Rafał Miłecki <rafal at milecki.pl>
AuthorDate: Mon Nov 8 17:23:09 2021 +0100
bcm4908: fix b53 regression regarding RGMII reg(s)
This fixes:
[ 35.308550] WARNING: CPU: 0 PID: 230 at bcm_sf2_reg_rgmii_cntrl.isra.0+0x84/0x90
Signed-off-by: Rafał Miłecki <rafal at milecki.pl>
---
..._sf2-Fix-bcm_sf2_reg_rgmii_cntrl-call-for.patch | 46 ++++++++++++++++++++++
...sa-bcm_sf2-enable-GPHY-for-switch-probing.patch | 2 +-
...-bcm_sf2-keep-GPHY-enabled-on-the-BCM4908.patch | 2 +-
3 files changed, 48 insertions(+), 2 deletions(-)
diff --git a/target/linux/bcm4908/patches-5.10/075-v5.13-0006-net-dsa-bcm_sf2-Fix-bcm_sf2_reg_rgmii_cntrl-call-for.patch b/target/linux/bcm4908/patches-5.10/075-v5.13-0006-net-dsa-bcm_sf2-Fix-bcm_sf2_reg_rgmii_cntrl-call-for.patch
new file mode 100644
index 0000000000..7a670d7011
--- /dev/null
+++ b/target/linux/bcm4908/patches-5.10/075-v5.13-0006-net-dsa-bcm_sf2-Fix-bcm_sf2_reg_rgmii_cntrl-call-for.patch
@@ -0,0 +1,46 @@
+From fc516d3a6aa2c6ffe27d0da8818d13839e023e7e Mon Sep 17 00:00:00 2001
+From: Florian Fainelli <f.fainelli at gmail.com>
+Date: Fri, 21 May 2021 10:46:14 -0700
+Subject: [PATCH] net: dsa: bcm_sf2: Fix bcm_sf2_reg_rgmii_cntrl() call for
+ non-RGMII port
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+We cannot call bcm_sf2_reg_rgmii_cntrl() for a port that is not RGMII,
+yet we do that in bcm_sf2_sw_mac_link_up() irrespective of the port's
+interface. Move that read until we have properly qualified the PHY
+interface mode. This avoids triggering a warning on 7278 platforms that
+have GMII ports.
+
+Fixes: 55cfeb396965 ("net: dsa: bcm_sf2: add function finding RGMII register")
+Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
+Acked-by: Rafał Miłecki <rafal at milecki.pl>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/dsa/bcm_sf2.c | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+--- a/drivers/net/dsa/bcm_sf2.c
++++ b/drivers/net/dsa/bcm_sf2.c
+@@ -821,11 +821,9 @@ static void bcm_sf2_sw_mac_link_up(struc
+ bcm_sf2_sw_mac_link_set(ds, port, interface, true);
+
+ if (port != core_readl(priv, CORE_IMP0_PRT_ID)) {
+- u32 reg_rgmii_ctrl;
++ u32 reg_rgmii_ctrl = 0;
+ u32 reg, offset;
+
+- reg_rgmii_ctrl = bcm_sf2_reg_rgmii_cntrl(priv, port);
+-
+ if (priv->type == BCM4908_DEVICE_ID ||
+ priv->type == BCM7445_DEVICE_ID)
+ offset = CORE_STS_OVERRIDE_GMIIP_PORT(port);
+@@ -836,6 +834,7 @@ static void bcm_sf2_sw_mac_link_up(struc
+ interface == PHY_INTERFACE_MODE_RGMII_TXID ||
+ interface == PHY_INTERFACE_MODE_MII ||
+ interface == PHY_INTERFACE_MODE_REVMII) {
++ reg_rgmii_ctrl = bcm_sf2_reg_rgmii_cntrl(priv, port);
+ reg = reg_readl(priv, reg_rgmii_ctrl);
+ reg &= ~(RX_PAUSE_EN | TX_PAUSE_EN);
+
diff --git a/target/linux/bcm4908/patches-5.10/700-net-dsa-bcm_sf2-enable-GPHY-for-switch-probing.patch b/target/linux/bcm4908/patches-5.10/700-net-dsa-bcm_sf2-enable-GPHY-for-switch-probing.patch
index a47ae2f738..d3714dfa7a 100644
--- a/target/linux/bcm4908/patches-5.10/700-net-dsa-bcm_sf2-enable-GPHY-for-switch-probing.patch
+++ b/target/linux/bcm4908/patches-5.10/700-net-dsa-bcm_sf2-enable-GPHY-for-switch-probing.patch
@@ -29,7 +29,7 @@ Signed-off-by: Rafał Miłecki <rafal at milecki.pl>
--- a/drivers/net/dsa/bcm_sf2.c
+++ b/drivers/net/dsa/bcm_sf2.c
-@@ -1488,10 +1488,14 @@ static int bcm_sf2_sw_probe(struct platf
+@@ -1487,10 +1487,14 @@ static int bcm_sf2_sw_probe(struct platf
rev = reg_readl(priv, REG_PHY_REVISION);
priv->hw_params.gphy_rev = rev & PHY_REVISION_MASK;
diff --git a/target/linux/bcm4908/patches-5.10/701-net-dsa-bcm_sf2-keep-GPHY-enabled-on-the-BCM4908.patch b/target/linux/bcm4908/patches-5.10/701-net-dsa-bcm_sf2-keep-GPHY-enabled-on-the-BCM4908.patch
index be21421cf1..b027fe3672 100644
--- a/target/linux/bcm4908/patches-5.10/701-net-dsa-bcm_sf2-keep-GPHY-enabled-on-the-BCM4908.patch
+++ b/target/linux/bcm4908/patches-5.10/701-net-dsa-bcm_sf2-keep-GPHY-enabled-on-the-BCM4908.patch
@@ -15,7 +15,7 @@ Signed-off-by: Rafał Miłecki <rafal at milecki.pl>
--- a/drivers/net/dsa/bcm_sf2.c
+++ b/drivers/net/dsa/bcm_sf2.c
-@@ -1502,6 +1502,12 @@ static int bcm_sf2_sw_probe(struct platf
+@@ -1501,6 +1501,12 @@ static int bcm_sf2_sw_probe(struct platf
priv->hw_params.core_rev >> 8, priv->hw_params.core_rev & 0xff,
priv->irq0, priv->irq1);
More information about the lede-commits
mailing list