amd-xgbe: Avoid spurious link down messages during interface toggle
Subsystems (3)
Raju Rangoju
maintainerPATCH 1/1 amd-xgbe: Avoid spurious link down messages during interface toggle
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.
--- drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 1 - drivers/net/ethernet/amd/xgbe/xgbe-mdio.c | 1 + 2 files changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/amd/xgbe/xgbe-drv.c +0 -1
@@ -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);
drivers/net/ethernet/amd/xgbe/xgbe-mdio.c +1 -0
@@ -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;
Signature · 1 line
2.34.1
Quoted 11 lines · Raju Rangoju
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_linkstate 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 <[email protected]>
Quoted 22 lines
--- drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 1 - drivers/net/ethernet/amd/xgbe/xgbe-mdio.c | 1 + 2 files changed, 1 insertion(+), 1 deletion(-)drivers/net/ethernet/amd/xgbe/xgbe-drv.c +0
-1@@ -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);drivers/net/ethernet/amd/xgbe/xgbe-mdio.c +0
-0
drivers/net/ethernet/amd/xgbe/xgbe-mdio.c static int xgbe_phy_init(struct xgbe_prv_data *pdata) · line 1559
Quoted 5 lines
drivers/net/ethernet/amd/xgbe/xgbe-mdio.c +1
-0@@ -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 ;
Took me a sec to spot the difference between the two :)
Quoted 2 lines
drivers/net/ethernet/amd/xgbe/xgbe-mdio.c +0
-0pdata->phy.pause_autoneg = pdata->pause_autoneg;
Quoted 10 lines · Raju Rangoju
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_linkstate 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")
Did this always happen, that is, did this behavior exist before the recent changes to detect short drops in the phy link status? If it didn't exist prior to those changes, then the Fixes: needs to be against that recent change, possibly limiting the amount of backporting required into stable kernels.
Thanks,
Tom
Quoted 30 lines
Signed-off-by Raju Rangoju <[email protected]>--- drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 1 - drivers/net/ethernet/amd/xgbe/xgbe-mdio.c | 1 + 2 files changed, 1 insertion(+), 1 deletion(-)drivers/net/ethernet/amd/xgbe/xgbe-drv.c +0
-1@@ -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);drivers/net/ethernet/amd/xgbe/xgbe-mdio.c +1
-0@@ -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;
Rangoju, Raju
maintainerQuoted 7 lines · Tom Lendacky
Quoted 6 lines · Raju Rangoju
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.
Quoted 7 lines
Quoted 4 lines
Preserve the
phy_linkstate 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")Did this always happen, that is, did this behavior exist before the recent changes to detect short drops in the phy link status?
Yes, this behavior exist before the recent changes to detect short drops.
Quoted 39 lines
If it didn't exist
prior to those changes, then the Fixes: needs to be against that recent change, possibly limiting the amount of backporting required into stable kernels.Thanks,
TomQuoted 30 lines
Signed-off-by Raju Rangoju <[email protected]>--- drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 1 - drivers/net/ethernet/amd/xgbe/xgbe-mdio.c | 1 + 2 files changed, 1 insertion(+), 1 deletion(-)drivers/net/ethernet/amd/xgbe/xgbe-drv.c +0
-1@@ -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);drivers/net/ethernet/amd/xgbe/xgbe-mdio.c +1
-0@@ -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;
This patch was applied to netdev/net.git (main) by Paolo Abeni <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Paolo Abeni <[email protected]>:
Quoted 10 lines · On Fri, 10 Oct 2025 12:21:42 +0530 you wrote:
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_linkstate across interface toggles to avoid treating the -1 sentinel value as a legitimate link state transition.[...]
Here is the summary with links:
- [net] amd-xgbe: Avoid spurious link down messages during interface toggle
https://git.kernel.org/netdev/net/c/2616222e4233
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html