Subject: [PATCH net] amd-xgbe: read STAT1 register twice to get correct value

From: Raju Rangoju <[email-masked]>
Date: Thu, 14 Sep 2023 09:49:44 +0530

Link status is latched low, so read once to clear
and then read again to get current state.

Fixes: 4f3b20bfbb75 ("amd-xgbe: add support for rx-adaptation")
Signed-off-by: Raju Rangoju <[email-masked]>
Acked-by: Shyam Sundar S K <[email-masked]>
---
 drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
index 6a716337f48b..c83085285e8c 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
@@ -2930,6 +2930,7 @@ static int xgbe_phy_link_status(struct xgbe_prv_data *pdata, int *an_restart)
 
 		/* check again for the link and adaptation status */
 		reg = XMDIO_READ(pdata, MDIO_MMD_PCS, MDIO_STAT1);
+		reg = XMDIO_READ(pdata, MDIO_MMD_PCS, MDIO_STAT1);
 		if ((reg & MDIO_STAT1_LSTATUS) && pdata->rx_adapt_done)
 			return 1;
 	} else if (reg & MDIO_STAT1_LSTATUS)
-- 
2.25.1