Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1701463ybi; Wed, 17 Jul 2019 20:23:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqwZ+bSOoOlFbtFLHlGrMgrQ6Om5ZGQzJudoX8N7Q/caz2q31Ntyie/w1wxgu5oiwtHf+Vl2 X-Received: by 2002:a17:902:925:: with SMTP id 34mr46981620plm.334.1563420218474; Wed, 17 Jul 2019 20:23:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563420218; cv=none; d=google.com; s=arc-20160816; b=Ss7kxhmEcg843eLc1/64huQ5lvMCQ7UaGEezxzSk7TO3Yt67JnB3Upq9B4mabVTNIB TL1RapKLWsLUqGPwTrQh0fic3TI7hspYQjkCvNk7quisKiBEQZNplhWThmqnBGaZcwyI arh65ziVKuNDYHqHTkXzEjHOoAmvsq+mEyMTFqZ5evtFT5PqSf3Nax3nX9kq5A5muID4 hlCkegGbBGPxmGcIsGroT3glnkxuq5SoK1q/4ZToeW9R2aYEjnusQhJNMWXhY9p6zvQ8 WCT6jBJng/ETrgbEqUsR1f1XSJ/+06EXzeI56oommxN0Y+Jw50hVP9ph8F58AS0jbOxw em4A== 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=1mCjL+5BWD4S3fZvhNU/JcE8MiySiRXzHKmoYYIQecM=; b=0eRM+CSqW9CUgnVKpTTkgcmds573oABbXpNZ2fTSazeSe9PTM7qtICe5VxaCA4Yxfb PKOtSrJT+v9MNK6Umw6e+7cWlgs+N+WXSipe96wq//00PjBsDSFb//I5w6m7J2NlHgiT 0Ur9zV+tW8PfqwfXdj7Ig1+XbXeOljIjAA7pngvzV86yisFsFcJJK8VVDpARj4RainKa nRiXndXT5j//15ZG0KnDzPEt/mNZXEVy52YDREyIuMFBTXdP5/I9fiMk42T1SNcQFEp3 76caOeewFepZrBU14bCngOmmcw+t03TYJTwUk74nKuLOEinybsOsd2JWCVgybhD6UcNf ADag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vwYkJeqH; 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 m13si23507296pgv.398.2019.07.17.20.23.22; Wed, 17 Jul 2019 20:23:38 -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=vwYkJeqH; 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 S1732598AbfGRDJc (ORCPT + 99 others); Wed, 17 Jul 2019 23:09:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:42006 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390145AbfGRDJ1 (ORCPT ); Wed, 17 Jul 2019 23:09:27 -0400 Received: from localhost (115.42.148.210.bf.2iij.net [210.148.42.115]) (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 44F302053B; Thu, 18 Jul 2019 03:09:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563419366; bh=7Y8YRFl8H93Muj1svu/vDRN/yurF3Z9YW4mttXOGQYU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vwYkJeqHfHdC/ORJSRgc7y190BoLEJwxNRJKSpk9mBx5RpHMlBexmH2DTdXH6KyI3 4wb3SNVcU9crjuaFjOhm/CMQtGBSF1owCdf044JnP/oHYuVltmVRogfz40ZxDz8wLc d5EMx+lZTixLQR34Cj+VTUo/4p4ZTrxIipRdBEi4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Mauro S. M. Rodrigues" , Sudarsana Reddy Kalluru , "David S. Miller" , Sasha Levin Subject: [PATCH 4.14 33/80] bnx2x: Check if transceiver implements DDM before access Date: Thu, 18 Jul 2019 12:01:24 +0900 Message-Id: <20190718030101.222214072@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190718030058.615992480@linuxfoundation.org> References: <20190718030058.615992480@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 cf18cecca911c0db96b868072665347efe6df46f ] Some transceivers may comply with SFF-8472 even though they do not implement the Digital Diagnostic Monitoring (DDM) interface described in the spec. The existence of such area is specified by the 6th bit of byte 92, set to 1 if implemented. Currently, without checking this bit, bnx2x fails trying to read sfp module's EEPROM with the follow message: ethtool -m enP5p1s0f1 Cannot get Module EEPROM data: Input/output error Because it fails to read the additional 256 bytes in which it is assumed to exist the DDM data. This issue was noticed using a Mellanox Passive DAC PN 01FT738. The EEPROM data was confirmed by Mellanox as correct and similar to other Passive DACs from other manufacturers. Signed-off-by: Mauro S. M. Rodrigues Acked-by: Sudarsana Reddy Kalluru Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | 3 ++- drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c index 3fd1085a093f..65bc1929d1a8 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c @@ -1581,7 +1581,8 @@ static int bnx2x_get_module_info(struct net_device *dev, } if (!sff8472_comp || - (diag_type & SFP_EEPROM_DIAG_ADDR_CHANGE_REQ)) { + (diag_type & SFP_EEPROM_DIAG_ADDR_CHANGE_REQ) || + !(diag_type & SFP_EEPROM_DDM_IMPLEMENTED)) { modinfo->type = ETH_MODULE_SFF_8079; modinfo->eeprom_len = ETH_MODULE_SFF_8079_LEN; } else { diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h index b7d251108c19..7115f5025664 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h @@ -62,6 +62,7 @@ #define SFP_EEPROM_DIAG_TYPE_ADDR 0x5c #define SFP_EEPROM_DIAG_TYPE_SIZE 1 #define SFP_EEPROM_DIAG_ADDR_CHANGE_REQ (1<<2) +#define SFP_EEPROM_DDM_IMPLEMENTED (1<<6) #define SFP_EEPROM_SFF_8472_COMP_ADDR 0x5e #define SFP_EEPROM_SFF_8472_COMP_SIZE 1 -- 2.20.1