Received: by 10.213.65.68 with SMTP id h4csp1719162imn; Mon, 19 Mar 2018 11:21:35 -0700 (PDT) X-Google-Smtp-Source: AG47ELu49TcyUvZ3EOSES3HiaebvYHO5W8/ZfWF++XtcS5KrGhl0dOAdUeaakHtAwk5qAmimNY7h X-Received: by 10.101.101.15 with SMTP id x15mr5340204pgv.322.1521483695656; Mon, 19 Mar 2018 11:21:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521483695; cv=none; d=google.com; s=arc-20160816; b=uEF9X4qN09tYyTgcuaOoi13vwiM9ufbYFyUBQdctnyElr7XGdvCFzD7pEjy1IWPpwT 6aaeSXMz5oUT9AkzTRw6HTim0LU2XvOfev7sw63paBEm3hhCfwWxUotokkvW6kji6yut Nb16JwuEy+WwGO3JvmblKRexdt5sra5vX59U6r1DlD7fMRuY9lmMg3+EFTmsVNJSDqju WkK6t2458UOaCNet5RAt2SITpvJAfQEJ6dfSxIrmWGl42yxb77w/tUP3VOGtr9TAqo+2 XD4xFlPRxS9v10Xf6g0FYsDI6/Ex2UoaQpNiSDBdWRBsDNI2blw9fHbd1yoVChhZjA5N CAvQ== 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=lLUsyRlS++Ysn9sgeA0l3jyCshSsUUb3oSIwkBVUds4=; b=wWxnHsX0ZTJLNnfgFZPSVtDF2GHu52IoEc1b0s0QI04bzP/6h3wCUAgyCR7CNZ42Eh oALucY7bkaFytHS0a7gRyeup+4PhYIKH6bmM5Pa/IDCJmp/WoLIV1Q3mvSvDNtoMpqVL AEAHaMjrEooeWIEKGfeFNBnd0+kYcmXsf/tWP9XWxbLY2fnd3nalkplpcQoNbFKkiO9z mPW+zfj8TeffEP6GslVUeQF9j5prFcxeJAPY86VPLxpKcT6/gAjBEATbOIMI8S121sxd bSq3+dIEe+KgyGtnZ/QcTeTcfwl+oJ5A43iYkfaiQDZYTuXNaTpUE/jiA98zXEJOVSyN pSfg== 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 o68si337279pfk.132.2018.03.19.11.21.21; Mon, 19 Mar 2018 11:21:35 -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 S969489AbeCSSTz (ORCPT + 99 others); Mon, 19 Mar 2018 14:19:55 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:47360 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S969467AbeCSSTo (ORCPT ); Mon, 19 Mar 2018 14:19:44 -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 7F092113E; Mon, 19 Mar 2018 18:19:43 +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.9 025/241] i40e: fix ethtool to get EEPROM data from X722 interface Date: Mon, 19 Mar 2018 19:04:50 +0100 Message-Id: <20180319180752.211378509@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319180751.172155436@linuxfoundation.org> References: <20180319180751.172155436@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.9-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 @@ -1135,6 +1135,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;