]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
amd-xgbe: Avoid spurious link down messages during interface toggle
authorRaju Rangoju <Raju.Rangoju@amd.com>
Fri, 10 Oct 2025 06:51:42 +0000 (12:21 +0530)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 14 Oct 2025 08:30:34 +0000 (10:30 +0200)
During interface toggle operations (ifdown/ifup), the driver currently
resets the local helper variable 'phy_link' to -1. This causes the link
state machine to incorrectly interpret the state as a link change event,
resulting in spurious "Link is down" messages being logged when the
interface is brought back up.

Preserve the phy_link state across interface toggles to avoid treating
the -1 sentinel value as a legitimate link state transition.

Fixes: 88131a812b16 ("amd-xgbe: Perform phy connect/disconnect at dev open/stop")
Signed-off-by: Raju Rangoju <Raju.Rangoju@amd.com>
Reviewed-by: Dawid Osuchowski <dawid.osuchowski@linux.intel.com>
Link: https://patch.msgid.link/20251010065142.1189310-1-Raju.Rangoju@amd.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/amd/xgbe/xgbe-drv.c
drivers/net/ethernet/amd/xgbe/xgbe-mdio.c

index f0989aa01855d0fe431d99c6b57d931444375279..4dc631af793324130249265c2742eb675e68addf 100644 (file)
@@ -1080,7 +1080,6 @@ static void xgbe_free_rx_data(struct xgbe_prv_data *pdata)
 
 static int xgbe_phy_reset(struct xgbe_prv_data *pdata)
 {
-       pdata->phy_link = -1;
        pdata->phy_speed = SPEED_UNKNOWN;
 
        return pdata->phy_if.phy_reset(pdata);
index 1a37ec45e650201272c5031873cb6ba9137f0471..7675bb98f029564a32866139a3f2edf17ae8efcf 100644 (file)
@@ -1555,6 +1555,7 @@ static int xgbe_phy_init(struct xgbe_prv_data *pdata)
                pdata->phy.duplex = DUPLEX_FULL;
        }
 
+       pdata->phy_link = 0;
        pdata->phy.link = 0;
 
        pdata->phy.pause_autoneg = pdata->pause_autoneg;