Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10422164ybi; Wed, 24 Jul 2019 22:56:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqzMsh9pP0m0WvB+GFiZ2bMA9yNMt2evXLSimOYVklyZdcdPOgao6tLrDjvVFEytdRVCFAOW X-Received: by 2002:a62:6083:: with SMTP id u125mr14684061pfb.208.1564034217053; Wed, 24 Jul 2019 22:56:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564034217; cv=none; d=google.com; s=arc-20160816; b=OrHqcmPFm7XGMYSMHMyD48ol/jK0A3Oa2+8kKAfct+aczMK3g9ZZzsHcFpmU4BPERF YknGitu8rDWVWiNcHZN2GEzHPf3Cb6t+SUjBZLfpSnHIkeLt3Z6tfvo+H8UQW0OmlXBe Qxx0V+iFF9GJZACfKSU1spjyKHiguUz0bAdRPjcBMWHiaCIvhRE7usvVTN4xFgfTIa7C 2VqAZDUl9nTqZqzGMHiE2b8i9IxLeupLyGrF7mdmAVzDs4wD7iLGO2IO/53rHG4wFED0 75ZO9Berc4E7vDxeE9wnAzxVT6QIMFuygoJydo9Sra2mqyUyTdlwO6F0Ano1yxvigxYS d3Ug== 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=nMMHaNwEnL7CZQZaxiuagBaaWQlOCYRVS7ejDtfm3Cw=; b=JKxHiigcwCbSxFzvgPMMmtGl91YM+ItbdQeLNb85a1DgTrLMWnVIW2jcYcRTDidRWe yA+7tnYuP37esP3IBBQfo/9u6Lyj9SdC1WnmnxLw7Wgv2l/+kXDm3ShwEOvoZ2y3ICL6 sj3sJ3ofabl+2lBdjwatXDcCSkugW7Lp+UzF2eoSRoZY1ujLGhpYmxZsZMLFQksUlP5V 2FxiQst3nLfcTNoMK4WDZ1kNCXnzaRTZPLDt5h1dwfSq2+omktuEOaSzZqzWSdwpPV8s U8oDqPNAKUiTOViUhNbwnneGiOgVnjSCbmFINkeuDu7ySQAgd6oIj2AGOivBw6JfIAtO VAHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Eqsz+HGp; 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 o21si14663271pll.169.2019.07.24.22.56.42; Wed, 24 Jul 2019 22:56:57 -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=Eqsz+HGp; 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 S2404158AbfGYFjt (ORCPT + 99 others); Thu, 25 Jul 2019 01:39:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:54030 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404147AbfGYFjp (ORCPT ); Thu, 25 Jul 2019 01:39:45 -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 E3EA222CB8; Thu, 25 Jul 2019 05:39:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564033184; bh=8kej9sP2nt2ltefV/7IVyIKRLgLqp6NPbBsCwaR+sLs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Eqsz+HGpUPbL8DY9SOAu2G7T7hXoUAiZ/qasRCP14ncwB/vzUbbw6MEk2LLfGfEeP frX+GzPSE63+NnPQ2y6Odj3i4sJEObqFy9VVHaapBqhrTbHY9dMVR9LZIhiuJHsFGK 6pQWl2jiDTtgiNFS2ABQ6PoRQRlHYQa0R+cjbmb8= 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.19 119/271] ixgbe: Check DDM existence in transceiver before access Date: Wed, 24 Jul 2019 21:19:48 +0200 Message-Id: <20190724191705.462413365@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191655.268628197@linuxfoundation.org> References: <20190724191655.268628197@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 e5a8461fe6a9..8829bd95d0d3 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c @@ -3223,7 +3223,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 64e44e01c973..c56baad04ee6 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.h +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.h @@ -45,6 +45,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