net: phy: xpcs: Return error when 10GKR link errors are found
authorJose Abreu <Jose.Abreu@synopsys.com>
Fri, 20 Mar 2020 09:53:34 +0000 (10:53 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 24 Mar 2020 04:01:58 +0000 (21:01 -0700)
For 10GKR rate, when link errors are found we need to return fault
status so that XPCS is correctly resumed.

Signed-off-by: Jose Abreu <Jose.Abreu@synopsys.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/mdio-xpcs.c

index 2f4cdf8..c04e9bf 100644 (file)
@@ -255,8 +255,10 @@ static int xpcs_read_fault(struct mdio_xpcs_args *xpcs,
        if (ret < 0)
                return ret;
 
-       if (ret & MDIO_PCS_10GBRT_STAT2_ERR)
+       if (ret & MDIO_PCS_10GBRT_STAT2_ERR) {
                xpcs_warn(xpcs, state, "Link has errors!\n");
+               return -EFAULT;
+       }
 
        return 0;
 }