Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3983128ybi; Mon, 29 Jul 2019 16:51:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqyAxKrftmCPMvuREiTQgnD615TehyuZ6A0JBAdQy41O4aeUaSV8wd/McGHEQY5GJJxgXLJ/ X-Received: by 2002:a17:90a:bb94:: with SMTP id v20mr115977319pjr.88.1564444292615; Mon, 29 Jul 2019 16:51:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564444292; cv=none; d=google.com; s=arc-20160816; b=lgrBgSlvN8hOH5hzxKgJfLWjylorB8iaQoZGV6tSspzHX+r3CjaX5fNUAA5toq1gAO Mf2tDU38B9NjEzDt6Ich46qCP0WqiK2buIUAqBnp9+Gus3pzzMCqDmMn5pJ4VZKcJYLe WcH+NVbONsVxqTL6j4OiubEM8NI5+hbCaXOrQan/B2y23JAajdBhF5E00/wcZ2IpnqBw TD8fjKi9u0EYDk0ahWbGrGTSeMbJAjLTKYm1NNGNkATu5U3ltNZLKhCNmrG7aACdGh6b nd4UJZp0TiND5GnEGCzTpSnfKsHIQMkjMEtvpKDZYrsXow3fhNIHXgIHDLfT0KTsdfFf RKKQ== 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=K32uDd9jU1JXtI+Onp4qw60N9ytqkYTOIY/v3VKo7z0=; b=s8fnuXQDp40rh4F+pL83iTWBlWqhtFaATgw68ExdC09E03tYS28YBwrg97hQTxZJHl neIGveKcEAC+WD5skeay/370rWsAsFTmAQufEB4Aejva6GJuunXEDB4vlZLGmbsGTtxh BLpOIsR+CimmV8G3WL7KdcetkPBXnd+vaKP6XTQ/yuu90UTCp+eDUiu/ZavlBKCiUGbo 1XOq8nwlbawZ3fKhyh3tAGthZnlqocr3JLM4g5GFWOPAYAkRCb1bCOKukdm+1LJgcMN4 fLsbM5doGqdFWUFAmbNVBLAdxGee5ZbuRRxadbYBg6Q5QceIonZUDEvQ+OFW/EmZgaJ4 HrAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qkrRqEzz; 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 d2si26733032pgo.463.2019.07.29.16.51.18; Mon, 29 Jul 2019 16:51:32 -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=qkrRqEzz; 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 S1727624AbfG2T1p (ORCPT + 99 others); Mon, 29 Jul 2019 15:27:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:40342 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729931AbfG2T1n (ORCPT ); Mon, 29 Jul 2019 15:27:43 -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 21060217D6; Mon, 29 Jul 2019 19:27:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564428462; bh=laPnALORfMGbBZMMiWHWqLqwpx6lpXO8LVbDReD48Jc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qkrRqEzzjmfv03tRg6o6fDVDyXu7l36JprNXmbuB62E8sJesV1p14sOK5AyxcsYg6 H20JIVUdORhVmjfHfuPT9zl1vBKqLsnFfG5p3ffFplm2/Dd2AJCy0fQMeB/GYbHJ3Y 7taFuxtYN6UcGnC7tOBXGSkMdYP6dYDmC9tyTO6I= 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.14 084/293] ixgbe: Check DDM existence in transceiver before access Date: Mon, 29 Jul 2019 21:19:35 +0200 Message-Id: <20190729190831.045366155@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190820.321094988@linuxfoundation.org> References: <20190729190820.321094988@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 c3e7a8191128..f7e68083200c 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c @@ -3237,7 +3237,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 b0cac961df3b..94df1d99be95 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