]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.9.172/mlxsw-spectrum-fix-autoneg-status-in-ethtool.patch
Linux 4.9.172
[thirdparty/kernel/stable-queue.git] / releases / 4.9.172 / mlxsw-spectrum-fix-autoneg-status-in-ethtool.patch
CommitLineData
84d0c25e
GKH
1From foo@baz Tue 30 Apr 2019 11:31:40 AM CEST
2From: Amit Cohen <amitc@mellanox.com>
3Date: Thu, 18 Apr 2019 07:14:16 +0000
4Subject: mlxsw: spectrum: Fix autoneg status in ethtool
5
6From: Amit Cohen <amitc@mellanox.com>
7
8[ Upstream commit 151f0dddbbfe4c35c9c5b64873115aafd436af9d ]
9
10If link is down and autoneg is set to on/off, the status in ethtool does
11not change.
12
13The reason is when the link is down the function returns with zero
14before changing autoneg value.
15
16Move the checking of link state (up/down) to be performed after setting
17autoneg value, in order to be sure that autoneg will change in any case.
18
19Fixes: 56ade8fe3fe1 ("mlxsw: spectrum: Add initial support for Spectrum ASIC")
20Signed-off-by: Amit Cohen <amitc@mellanox.com>
21Signed-off-by: Ido Schimmel <idosch@mellanox.com>
22Acked-by: Jiri Pirko <jiri@mellanox.com>
23Signed-off-by: David S. Miller <davem@davemloft.net>
24Signed-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