]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.19/mlxsw-spectrum-prevent-force-of-56g.patch
Linux 5.1.13
[thirdparty/kernel/stable-queue.git] / queue-4.19 / mlxsw-spectrum-prevent-force-of-56g.patch
1 From 9fc80880cd167f5dea33f9626dbb31cd8f014dd7 Mon Sep 17 00:00:00 2001
2 From: Amit Cohen <amitc@mellanox.com>
3 Date: Wed, 29 May 2019 10:59:45 +0300
4 Subject: mlxsw: spectrum: Prevent force of 56G
5
6 [ Upstream commit 275e928f19117d22f6d26dee94548baf4041b773 ]
7
8 Force of 56G is not supported by hardware in Ethernet devices. This
9 configuration fails with a bad parameter error from firmware.
10
11 Add check of this case. Instead of trying to set 56G with autoneg off,
12 return a meaningful error.
13
14 Fixes: 56ade8fe3fe1 ("mlxsw: spectrum: Add initial support for Spectrum ASIC")
15 Signed-off-by: Amit Cohen <amitc@mellanox.com>
16 Acked-by: Jiri Pirko <jiri@mellanox.com>
17 Signed-off-by: Ido Schimmel <idosch@mellanox.com>
18 Signed-off-by: David S. Miller <davem@davemloft.net>
19 Signed-off-by: Sasha Levin <sashal@kernel.org>
20 ---
21 drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 4 ++++
22 1 file changed, 4 insertions(+)
23
24 diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
25 index c5b82e283d13..ff2f6b8e2fab 100644
26 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
27 +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
28 @@ -2488,6 +2488,10 @@ mlxsw_sp_port_set_link_ksettings(struct net_device *dev,
29 mlxsw_reg_ptys_eth_unpack(ptys_pl, &eth_proto_cap, NULL, NULL);
30
31 autoneg = cmd->base.autoneg == AUTONEG_ENABLE;
32 + if (!autoneg && cmd->base.speed == SPEED_56000) {
33 + netdev_err(dev, "56G not supported with autoneg off\n");
34 + return -EINVAL;
35 + }
36 eth_proto_new = autoneg ?
37 mlxsw_sp_to_ptys_advert_link(cmd) :
38 mlxsw_sp_to_ptys_speed(cmd->base.speed);
39 --
40 2.20.1
41