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