Received: by 10.213.65.68 with SMTP id h4csp1799375imn; Mon, 19 Mar 2018 13:35:43 -0700 (PDT) X-Google-Smtp-Source: AG47ELvazRwqgMX83Glgo+lywsmePbev+lFWA18CbY9kj/XkZUdEk/riCS6GWH1uPI1Ox/7xuN5T X-Received: by 10.101.67.70 with SMTP id k6mr10032013pgq.93.1521491743323; Mon, 19 Mar 2018 13:35:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521491743; cv=none; d=google.com; s=arc-20160816; b=SZA88NniPQRHo//kYBYZEbFeuP2uh7YrZsfRWsHDwMaw2OL232DzJxJJq7d9z+GTgZ c33AsKH6CdhaqkWRCEBJAU9PvBmXZeTkmuFvv9ITiaKm0wYpzVdgHLpEOaHSJ7o+AFVz /TJOmdTkA2y+KFQmm6rAKYPs89jQog4UAlYovu2EfJcEOHRZmIEiM9UKTDmPnEzj1Y6+ Yqf8wbbMz74/6FsvEZx4/GI9e2ugrivBwSIbLQUxJzCnd+Ai8YKNRM0sHI7YhAa0JN1D vLraXWC1iqzDdh5V1IfnCPKWj4i8K/Z2fqzChmqMPpRYOK5JyC/lrLrbb7NoAOgNywkJ YYyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=uplXriAQqnUdzM3c4jhsKhtm2OxoJpiOPQ6VZfUbndg=; b=iG/rE/6UTOmxy/rWUzSkkN8+BN03S0RXMYL6WgK0OMcKb/NV/zlSWLOF0y1slcn4Mg omRqfxozzhB6dLyD/wwlaXy4+5ZQU47SdUMu1/wE0B+lujNmUkgDUb3FZ/b0R0QeSnJT 2wJeSjKGxsJzb8Os123FCBGoAr2B0g2O0MQF6OVBQ02qGtrJO8hPkxpUDG6+gGqSJLxe Zjr2R2m+s7T7MSwjv66ZRT6uxYN3Wvl7o3+KgJ97k+KXLFEV1aAKFtKrSSU7v3TgeJDH O5mgFiPuqdITjudU0LGt98A6XCGrbFrJYtjGARTQmuKlM0743R+2j/DZqUzWkGy/kMcP E6JA== ARC-Authentication-Results: i=1; mx.google.com; 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 t81si36136pfg.273.2018.03.19.13.35.28; Mon, 19 Mar 2018 13:35:43 -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; 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 S1031869AbeCSUd3 (ORCPT + 99 others); Mon, 19 Mar 2018 16:33:29 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:42676 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030451AbeCSSMR (ORCPT ); Mon, 19 Mar 2018 14:12:17 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 9365C1200; Mon, 19 Mar 2018 18:12:16 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lihong Yang , Andrew Bowers , Jeff Kirsher , Sasha Levin Subject: [PATCH 4.4 013/134] i40e: fix ethtool to get EEPROM data from X722 interface Date: Mon, 19 Mar 2018 19:04:56 +0100 Message-Id: <20180319171851.013194578@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319171849.024066323@linuxfoundation.org> References: <20180319171849.024066323@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Lihong Yang [ Upstream commit c271dd6c391b535226cf1a81aaad9f33cb5899d3 ] Currently ethtool -e will error out with a X722 interface as its EEPROM has a scope limit at offset 0x5B9FFF. This patch fixes the issue by setting the EEPROM length to the scope limit to avoid NVM read failure beyond that. Change-ID: I0b7d4dd6c7f2a57cace438af5dffa0f44c229372 Signed-off-by: Lihong Yang Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c +++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c @@ -1073,6 +1073,11 @@ static int i40e_get_eeprom_len(struct ne struct i40e_hw *hw = &np->vsi->back->hw; u32 val; +#define X722_EEPROM_SCOPE_LIMIT 0x5B9FFF + if (hw->mac.type == I40E_MAC_X722) { + val = X722_EEPROM_SCOPE_LIMIT + 1; + return val; + } val = (rd32(hw, I40E_GLPCI_LBARCTRL) & I40E_GLPCI_LBARCTRL_FL_SIZE_MASK) >> I40E_GLPCI_LBARCTRL_FL_SIZE_SHIFT;