mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 02:21:52 +09:00
mlxsw: spectrum: Fix autoneg status in ethtool
[ Upstream commit151f0dddbb] If link is down and autoneg is set to on/off, the status in ethtool does not change. The reason is when the link is down the function returns with zero before changing autoneg value. Move the checking of link state (up/down) to be performed after setting autoneg value, in order to be sure that autoneg will change in any case. Fixes:56ade8fe3f("mlxsw: spectrum: Add initial support for Spectrum ASIC") Signed-off-by: Amit Cohen <amitc@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
748ed75029
commit
3ff13dbace
@@ -2521,11 +2521,11 @@ mlxsw_sp_port_set_link_ksettings(struct net_device *dev,
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
mlxsw_sp_port->link.autoneg = autoneg;
|
||||
|
||||
if (!netif_running(dev))
|
||||
return 0;
|
||||
|
||||
mlxsw_sp_port->link.autoneg = autoneg;
|
||||
|
||||
mlxsw_sp_port_admin_status_set(mlxsw_sp_port, false);
|
||||
mlxsw_sp_port_admin_status_set(mlxsw_sp_port, true);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user