]>
Commit | Line | Data |
---|---|---|
84d0c25e GKH |
1 | From foo@baz Tue 30 Apr 2019 11:31:40 AM CEST |
2 | From: Amit Cohen <amitc@mellanox.com> | |
3 | Date: Thu, 18 Apr 2019 07:14:16 +0000 | |
4 | Subject: mlxsw: spectrum: Fix autoneg status in ethtool | |
5 | ||
6 | From: Amit Cohen <amitc@mellanox.com> | |
7 | ||
8 | [ Upstream commit 151f0dddbbfe4c35c9c5b64873115aafd436af9d ] | |
9 | ||
10 | If link is down and autoneg is set to on/off, the status in ethtool does | |
11 | not change. | |
12 | ||
13 | The reason is when the link is down the function returns with zero | |
14 | before changing autoneg value. | |
15 | ||
16 | Move the checking of link state (up/down) to be performed after setting | |
17 | autoneg value, in order to be sure that autoneg will change in any case. | |
18 | ||
19 | Fixes: 56ade8fe3fe1 ("mlxsw: spectrum: Add initial support for Spectrum ASIC") | |
20 | Signed-off-by: Amit Cohen <amitc@mellanox.com> | |
21 | Signed-off-by: Ido Schimmel <idosch@mellanox.com> | |
22 | Acked-by: Jiri Pirko <jiri@mellanox.com> | |
23 | Signed-off-by: David S. Miller <davem@davemloft.net> | |
24 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
25 | --- | |
26 | drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 4 ++-- | |
27 | 1 file changed, 2 insertions(+), 2 deletions(-) | |
28 | ||
29 | --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c | |
30 | +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c | |
31 | @@ -2059,11 +2059,11 @@ mlxsw_sp_port_set_link_ksettings(struct | |
32 | if (err) | |
33 | return err; | |
34 | ||
35 | + mlxsw_sp_port->link.autoneg = autoneg; | |
36 | + | |
37 | if (!netif_running(dev)) | |
38 | return 0; | |
39 | ||
40 | - mlxsw_sp_port->link.autoneg = autoneg; | |
41 | - | |
42 | mlxsw_sp_port_admin_status_set(mlxsw_sp_port, false); | |
43 | mlxsw_sp_port_admin_status_set(mlxsw_sp_port, true); | |
44 |