]> git.baikalelectronics.ru Git - kernel.git/commit
mlxsw: spectrum: Fix autoneg status in ethtool
authorAmit Cohen <amitc@mellanox.com>
Thu, 18 Apr 2019 07:14:16 +0000 (07:14 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 18 Apr 2019 17:37:30 +0000 (10:37 -0700)
commitc06c38dda65d982ee76a3226a528ff4abfad48bc
tree075c347029c40ece5982047aaeaaee35c9611720
parent2d969e54553adbef4516aef74dfa22a4f7cffff1
mlxsw: spectrum: Fix autoneg status in ethtool

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: a3f159160767 ("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>
drivers/net/ethernet/mellanox/mlxsw/spectrum.c