aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmit Cohen <amitc@mellanox.com>2019-05-29 10:59:45 +0300
committerPaul Gortmaker <paul.gortmaker@windriver.com>2019-09-16 12:21:44 -0400
commit409347c45d3993776b9891ffb2cc40b2b8b8236d (patch)
treea80b89eed5563abe9f32e734c307be55d62bffa4
parentcaa794239706ea0ef50d8bb78ce822b310c8ff0f (diff)
downloadlinux-yocto-409347c45d3993776b9891ffb2cc40b2b8b8236d.tar.gz
linux-yocto-409347c45d3993776b9891ffb2cc40b2b8b8236d.tar.bz2
linux-yocto-409347c45d3993776b9891ffb2cc40b2b8b8236d.zip
mlxsw: spectrum: Prevent force of 56G
commit 275e928f19117d22f6d26dee94548baf4041b773 upstream. Force of 56G is not supported by hardware in Ethernet devices. This configuration fails with a bad parameter error from firmware. Add check of this case. Instead of trying to set 56G with autoneg off, return a meaningful error. Fixes: 56ade8fe3fe1 ("mlxsw: spectrum: Add initial support for Spectrum ASIC") Signed-off-by: Amit Cohen <amitc@mellanox.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/spectrum.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
index e7a487635bc2..3e02dd3b0758 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
@@ -2427,6 +2427,10 @@ mlxsw_sp_port_set_link_ksettings(struct net_device *dev,
mlxsw_reg_ptys_eth_unpack(ptys_pl, &eth_proto_cap, NULL, NULL);
autoneg = cmd->base.autoneg == AUTONEG_ENABLE;
+ if (!autoneg && cmd->base.speed == SPEED_56000) {
+ netdev_err(dev, "56G not supported with autoneg off\n");
+ return -EINVAL;
+ }
eth_proto_new = autoneg ?
mlxsw_sp_to_ptys_advert_link(cmd) :
mlxsw_sp_to_ptys_speed(cmd->base.speed);