[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <7918fdf6bbe6505a64e54ae360c59c905aa3fe1d.1584106347.git.Jose.Abreu@synopsys.com>
Date: Fri, 13 Mar 2020 14:39:41 +0100
From: Jose Abreu <Jose.Abreu@...opsys.com>
To: netdev@...r.kernel.org
Cc: Joao Pinto <Joao.Pinto@...opsys.com>,
Jose Abreu <Jose.Abreu@...opsys.com>,
Andrew Lunn <andrew@...n.ch>,
Florian Fainelli <f.fainelli@...il.com>,
Heiner Kallweit <hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>,
"David S. Miller" <davem@...emloft.net>,
linux-kernel@...r.kernel.org
Subject: [PATCH net-next 2/4] net: phy: xpcs: Return error upon RX/TX fault
RX/TX fault status results in link errors. Return error upon these cases
so that XPCS can be correctly resumed.
Signed-off-by: Jose Abreu <Jose.Abreu@...opsys.com>
---
Cc: Jose Abreu <Jose.Abreu@...opsys.com>
Cc: Andrew Lunn <andrew@...n.ch>
Cc: Florian Fainelli <f.fainelli@...il.com>
Cc: Heiner Kallweit <hkallweit1@...il.com>
Cc: Russell King <linux@...linux.org.uk>
Cc: "David S. Miller" <davem@...emloft.net>
Cc: netdev@...r.kernel.org
Cc: linux-kernel@...r.kernel.org
---
drivers/net/phy/mdio-xpcs.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/net/phy/mdio-xpcs.c b/drivers/net/phy/mdio-xpcs.c
index a4cbeecc6d42..23516397b982 100644
--- a/drivers/net/phy/mdio-xpcs.c
+++ b/drivers/net/phy/mdio-xpcs.c
@@ -190,10 +190,14 @@ static int xpcs_read_fault(struct mdio_xpcs_args *xpcs,
if (ret < 0)
return ret;
- if (ret & MDIO_STAT2_RXFAULT)
+ if (ret & MDIO_STAT2_RXFAULT) {
xpcs_warn(xpcs, state, "Receiver fault detected!\n");
- if (ret & MDIO_STAT2_TXFAULT)
+ return -EFAULT;
+ }
+ if (ret & MDIO_STAT2_TXFAULT) {
xpcs_warn(xpcs, state, "Transmitter fault detected!\n");
+ return -EFAULT;
+ }
ret = xpcs_read_vendor(xpcs, MDIO_MMD_PCS, DW_VR_XS_PCS_DIG_STS);
if (ret < 0)
--
2.7.4
Powered by blists - more mailing lists