Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2233537ybi; Thu, 20 Jun 2019 11:18:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqxIIfrTRSLHAbDiwIQZnbOavkf6ayJv7vY79VU2cxIRRC5Pv9XbfkryiSR6XPzlVCi3w0SQ X-Received: by 2002:a17:90a:2041:: with SMTP id n59mr1001805pjc.6.1561054724719; Thu, 20 Jun 2019 11:18:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561054724; cv=none; d=google.com; s=arc-20160816; b=MUjbrXNYYLZ9KYv/M1c8w/h88gcaM2zph1ZXwSr0AfEAbiy9I06h6e5i0ERzHMwo8R yeUYyZEAvsac6mXHSM67Iou8tgO+57nvbMrLTYITMy2Yrd7fmaATMNLIleyDm9K0aZtK Xwzc1R9f8oR2f1AwlICpAfytjHtlP1+6MI5EQ3pLlWxO7NFPofAtSbQEag/xGWklMDjf ZpQ34UUa/KMpPHYzeckh4lAns5vTVfL+6qR0/v/txVD4fT2D0goG41AaUB3TSQVGABsj ly9obcpBKPzj65qcFvaxkCK2nOYc+XPK0ub/oIfauZtRkwf6gC2U0x4/BwxAM+zIYKkF MYkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8Ggakcz76o1qyEJYogVqohquvN9WgLLXFUCY7/W6S7g=; b=uERWVJGTVOVyZQM7xbbm2mJEkrY32cGgKynw+/WD20Cd6j6nybS9IFayUr2GzkNvoK mO6RZLCvkC5JX40zrXG2eKa76DvRHicxy14RGvYJ1qXF5HJFd0mFQ8lP4fxXc7BKH1cH WEmWp/h05vfJBRhbYxJKGy/law5d/YSZ5Lo9e3hlJtwUawTiYaLmOnt+rfktxHjpyr1z ow1be0L3JTPnifJwEPcC663rA5nNEP7DjqAAnODghqPrGRWxWoiQA1GDEZzaYV3gnYmv Nkvsf1Cb5FplrwMOiEFH1mPYBqke1r2KAeoJnpPHy1YoJb7hcRG2PJQQU5937XS5shB+ 8dNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QSNpVZwv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h21si175077pgv.102.2019.06.20.11.18.29; Thu, 20 Jun 2019 11:18:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QSNpVZwv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729878AbfFTSRE (ORCPT + 99 others); Thu, 20 Jun 2019 14:17:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:46260 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729870AbfFTSRB (ORCPT ); Thu, 20 Jun 2019 14:17:01 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3A66A2082C; Thu, 20 Jun 2019 18:17:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561054620; bh=xGNYuxBoRLrnvn4mE3DiUTBKZJAaYDWRQOIzTW+y1wU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QSNpVZwvJ7mM0a8/QPYuOLzNLHjYUnAVv4qwYIfV1k0kLHAEejJFPh7SqajULc8fw XoJIe+h5rClqbfDKFevx5ppPQa9FfWRFnzzJdmkSivl5y6RfOBDOtNsuvyyXdyrVvk le7GZuqSVzduuXSAaUDqFrbdQBAqggHjYO5YgzNw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Amit Cohen , Jiri Pirko , Ido Schimmel , "David S. Miller" , Sasha Levin Subject: [PATCH 5.1 92/98] mlxsw: spectrum: Prevent force of 56G Date: Thu, 20 Jun 2019 19:57:59 +0200 Message-Id: <20190620174354.016514010@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190620174349.443386789@linuxfoundation.org> References: <20190620174349.443386789@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 275e928f19117d22f6d26dee94548baf4041b773 ] 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 Acked-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c index 6b8aa3761899..f4acb38569e1 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c @@ -3110,6 +3110,10 @@ mlxsw_sp_port_set_link_ksettings(struct net_device *dev, ops->reg_ptys_eth_unpack(mlxsw_sp, ptys_pl, ð_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 ? ops->to_ptys_advert_link(mlxsw_sp, cmd) : ops->to_ptys_speed(mlxsw_sp, cmd->base.speed); -- 2.20.1