]>
Commit | Line | Data |
---|---|---|
2a2a4ae2 SL |
1 | From d6b80113936b9e5ad34e39bfb4e43e6efc9e1f7b 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 | --- | |
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, ð_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); |