Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1007588ybi; Fri, 2 Aug 2019 07:53:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqxOF9v/KnM9Zo2hSrwRJSvtatPr5BR9ZY8qiWMjwOhpoV8Oi2BFNN7S4ddaB/DUw/7E3sM9 X-Received: by 2002:a17:90a:ad41:: with SMTP id w1mr4704383pjv.52.1564757585251; Fri, 02 Aug 2019 07:53:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564757585; cv=none; d=google.com; s=arc-20160816; b=Lff8qgb2rkn3oONFU7EHbEFSAzxxYbrH/rGXJvsDPX7tu5D2UhHM2vQz4QFP85Imm8 xYwBYUr5vH5DJKWNHvtHc85yVOj9ZLvTaVrfSDDLyggSAeu89oxqwik1XSzphNYOzLss 56kha0WKnOSK+sda8PBUNjO+UxyhHYiBF7JNa5zcW3gFatK/6VwN3E+CcLJz+ubuzDn8 TUnh1mglluDx2HbzHOzFQDfWDOGstpVGXR4PyJiPo0tilCuR0RJuMdZNvNQZYkiCadap bO1gpPhMh9JERW+2mHFPBtnk5GPrXFOYHW1FkhAad8dTC+VAqvfmmudtnv1kHnNa/zUa k+mA== 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=A3TR8UK/ojaHedYc0oWM242w+rF6xtuP6NJXLu92Rnk=; b=rfTfKKXxLmcE27gOJRUgt2XgRdMUqGBaaqAp0gjHdbCFQfQffDzNDzVkPf3ou88eFU HkC1CQDs3ZItI7teyseSLMWxF7wukujv2h9Y92AWtx6Cr/f0xxwc9cCllREw9Lefz3R1 xEA9o4JklaRkuBvR5lsLOYqKSgJkaZp2hBQInJMwvYluwHfzrhS7BEEqhGw11CxTZIZF FkBcQQngZKHSqOMryOuzKpZH1yK19a0nW23mNYIyViBJv2sAaACT/pWDxFsxlRjkR/6P IvRcjjVnuEfqll3Kovm4pGrt8hYLXYgsXPji3dCdL6FVWq3UyXkce5b5utUfr4ibpRUJ /84g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DloISP7j; 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 v15si37496779pfm.238.2019.08.02.07.52.50; Fri, 02 Aug 2019 07:53:05 -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=DloISP7j; 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 S2404705AbfHBJbi (ORCPT + 99 others); Fri, 2 Aug 2019 05:31:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:57904 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404701AbfHBJbg (ORCPT ); Fri, 2 Aug 2019 05:31:36 -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 BA802217D6; Fri, 2 Aug 2019 09:31:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564738295; bh=leisaepSVJkzorCkSQ48wKuQW5CkpQ/yTefoWGUaz9Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DloISP7jzoSCzqy4CFpmSaGFu5rv7qXnYy9AvegzZ6QI3AjZ3FPrkU9yUOfBd4uHS MxuPW21sNi1irpPgZzgJAbFKfPSF6iX/vN/B7+Qfqzbfb6vks+i6HrojZA7ZFIouWY 9W3Z3bSu4R1zp2GPjS7umotzEGPgJofhFT9Zg71g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Mauro S. M. Rodrigues" , Jesse Brandeburg , Andrew Bowers , Jeff Kirsher , Sasha Levin Subject: [PATCH 4.4 048/158] ixgbe: Check DDM existence in transceiver before access Date: Fri, 2 Aug 2019 11:27:49 +0200 Message-Id: <20190802092213.808825843@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190802092203.671944552@linuxfoundation.org> References: <20190802092203.671944552@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 655c91414579d7bb115a4f7898ee726fc18e0984 ] Some transceivers may comply with SFF-8472 but not implement the Digital Diagnostic Monitoring (DDM) interface described in it. The existence of such area is specified by bit 6 of byte 92, set to 1 if implemented. Currently, due to not checking this bit ixgbe fails trying to read SFP module's eeprom with the follow message: ethtool -m enP51p1s0f0 Cannot get Module EEPROM data: Input/output error Because it fails to read the additional 256 bytes in which it was 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 present in other Passive DACs in from other manufacturers. Signed-off-by: "Mauro S. M. Rodrigues" Reviewed-by: Jesse Brandeburg Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 3 ++- drivers/net/ethernet/intel/ixgbe/ixgbe_phy.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c index d681273bd39d..9d38634071a4 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c @@ -3133,7 +3133,8 @@ static int ixgbe_get_module_info(struct net_device *dev, page_swap = true; } - if (sff8472_rev == IXGBE_SFF_SFF_8472_UNSUP || page_swap) { + if (sff8472_rev == IXGBE_SFF_SFF_8472_UNSUP || page_swap || + !(addr_mode & IXGBE_SFF_DDM_IMPLEMENTED)) { /* We have a SFP, but it does not support SFF-8472 */ modinfo->type = ETH_MODULE_SFF_8079; modinfo->eeprom_len = ETH_MODULE_SFF_8079_LEN; diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.h index 5abd66c84d00..7b7dc6d7d159 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.h +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.h @@ -70,6 +70,7 @@ #define IXGBE_SFF_SOFT_RS_SELECT_10G 0x8 #define IXGBE_SFF_SOFT_RS_SELECT_1G 0x0 #define IXGBE_SFF_ADDRESSING_MODE 0x4 +#define IXGBE_SFF_DDM_IMPLEMENTED 0x40 #define IXGBE_SFF_QSFP_DA_ACTIVE_CABLE 0x1 #define IXGBE_SFF_QSFP_DA_PASSIVE_CABLE 0x8 #define IXGBE_SFF_QSFP_CONNECTOR_NOT_SEPARABLE 0x23 -- 2.20.1