Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1697688ybi; Wed, 17 Jul 2019 20:19:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqxVbJy697mATYBb/fqXTtwmRnlWIkTyJMxPIRtmmduWgVoY2Aa2UPfh7d0nylHJ1c5PNFVF X-Received: by 2002:a17:902:ff11:: with SMTP id f17mr48324109plj.121.1563419971947; Wed, 17 Jul 2019 20:19:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563419971; cv=none; d=google.com; s=arc-20160816; b=qu2m/OvcOdOkyFjbwv3cSUuAS92CwaySTG+u0g1jMFZB2gvfXXhYAJRGh51KP7AVnu +QIMZtYA0K7MoMGUw0FUKOdFHSD99sc9K/HV+h7CfWPrDWHLjJEJ27A+XkSg46gC4PTd P/GG+Kr/YWW8Pds5/f23x/yq3d9eHUCc52KLry5gvZVkXNrGgoBfMfjzt4n2wHhdxjlR PdmOJYhgKXMTqnLDWiLyUU0v98NePjPaY4X+9t+mgO+Gul5EzFFykKqjxMZ25jveTa9t tPW+0zpo8rDY62xUln10sVoG4Q2LY/haPnZ4sEZR7o814M4trqDcTO33/d3yqVkBPtZw agKw== 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=LjpYDMxHIHAYWclPz+YXQxlYIJJXI+52FivNjzoV3C0=; b=goUXNHDvvVYKJOKcmT+9xOMs0XrFVQjLyEZUMBrqDdw2jrpqn11haBTnSj/8BnUiTy Rrdupym+ZuqMa/q9XVg5Spklcv8+GvTa7P/pdKW7SfS2J5UxD3K+XVWP0pIvgMQcxFzA HA2QVPARrh0FWBcRLgua8GAW2WAEbDfNvuO9HEr5tnlwqHXC+EIwXEp02VNFxLMcUROb qqc/kFBeUjFMQSC7fbe8G6AtQ/KOud0X9nGajeNr07sVlDhw7Khd6tvIrgVyYt4XyTXX 37lC1hop+4lKfN7zVd6SXJUo0ECH/ww+VgvWRrSfuzsKGgkpJ5N3b769OX5t0TrcNM+j 5oEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WELCkRwB; 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 g18si25119435plq.190.2019.07.17.20.19.16; Wed, 17 Jul 2019 20:19:31 -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=WELCkRwB; 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 S2391518AbfGRDRB (ORCPT + 99 others); Wed, 17 Jul 2019 23:17:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:51422 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391428AbfGRDOy (ORCPT ); Wed, 17 Jul 2019 23:14:54 -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 277852187F; Thu, 18 Jul 2019 03:14:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563419694; bh=OqKdexV51J3ckBVSjqO20+1JIPTBDGzU9NNKkCEQgno=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WELCkRwBDwInV0XXbqCQpnS0dpjxF0WwIj4CzXPPcRCfAwyhuWvzEnMY2i5XV0I5S OFWh7no9nnAzlzqkqnCadefEa+Gi2+XjnHG7yc8wsP9y03gxBLh1mAERpe+wPO+BEX uRu3eo4K7MfbrOXFGOlGUibDh+UY1mXvLeCI1R14= 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.4 11/40] bnx2x: Check if transceiver implements DDM before access Date: Thu, 18 Jul 2019 12:02:07 +0900 Message-Id: <20190718030042.555061177@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190718030039.676518610@linuxfoundation.org> References: <20190718030039.676518610@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 c56b61dce2d1..f4e83c86d643 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c @@ -1559,7 +1559,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