Skip to content

Commit 7a2323a

Browse files
RajuRangojuPaolo Abeni
authored andcommitted
amd-xgbe: propagate the correct speed and duplex status
xgbe_get_link_ksettings() does not propagate correct speed and duplex information to ethtool during cable unplug. Due to which ethtool reports incorrect values for speed and duplex. Address this by propagating correct information. Fixes: 7c12aa0 ("amd-xgbe: Move the PHY support into amd-xgbe") Acked-by: Shyam Sundar S K <[email protected]> Signed-off-by: Raju Rangoju <[email protected]> Reviewed-by: Wojciech Drewek <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
1 parent 7121205 commit 7a2323a

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,10 +314,15 @@ static int xgbe_get_link_ksettings(struct net_device *netdev,
314314

315315
cmd->base.phy_address = pdata->phy.address;
316316

317-
cmd->base.autoneg = pdata->phy.autoneg;
318-
cmd->base.speed = pdata->phy.speed;
319-
cmd->base.duplex = pdata->phy.duplex;
317+
if (netif_carrier_ok(netdev)) {
318+
cmd->base.speed = pdata->phy.speed;
319+
cmd->base.duplex = pdata->phy.duplex;
320+
} else {
321+
cmd->base.speed = SPEED_UNKNOWN;
322+
cmd->base.duplex = DUPLEX_UNKNOWN;
323+
}
320324

325+
cmd->base.autoneg = pdata->phy.autoneg;
321326
cmd->base.port = PORT_NONE;
322327

323328
XGBE_LM_COPY(cmd, supported, lks, supported);

0 commit comments

Comments
 (0)