From: Sudheesh Mavila <[email protected]>

Signed-off-by: Sudheesh Mavila <[email protected]>
Signed-off-by: Yongxin Liu <[email protected]>
---
 drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c 
b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
index 97e32c0490f8..922ea03ea94a 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
@@ -2628,8 +2628,19 @@ static int xgbe_phy_link_status(struct xgbe_prv_data 
*pdata, int *an_restart)
         */
        reg = XMDIO_READ(pdata, MDIO_MMD_PCS, MDIO_STAT1);
        reg = XMDIO_READ(pdata, MDIO_MMD_PCS, MDIO_STAT1);
-       if (reg & MDIO_STAT1_LSTATUS)
-               return 1;
+
+       if(phy_data->sfp_speed == XGBE_SFP_SPEED_10000) {
+               if ((reg & MDIO_STAT1_LSTATUS) && !(reg & MDIO_STAT1_FAULT)) {
+                       return 1;
+               } else {
+                       *an_restart = 1;
+                       pdata->phy_if.phy_reset(pdata);
+                       return 0;
+               }
+       } else {
+               if (reg & MDIO_STAT1_LSTATUS)
+                       return 1;
+       }
 
        if (pdata->phy.autoneg == AUTONEG_ENABLE &&
            phy_data->port_mode == XGBE_PORT_MODE_BACKPLANE) {
-- 
2.39.2

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#13016): 
https://lists.yoctoproject.org/g/linux-yocto/message/13016
Mute This Topic: https://lists.yoctoproject.org/mt/100956968/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to