Received: by 10.213.65.68 with SMTP id h4csp1774352imn; Mon, 19 Mar 2018 12:55:32 -0700 (PDT) X-Google-Smtp-Source: AG47ELtR8VBghk4BOdS5aWy8hpoivDMfBlI0bu20e59O1uQE1Dc9KV1XWeAfH+plVVHB9asZIjLn X-Received: by 2002:a17:902:6984:: with SMTP id l4-v6mr14048102plk.61.1521489332104; Mon, 19 Mar 2018 12:55:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521489332; cv=none; d=google.com; s=arc-20160816; b=kTO8kb0Unv2qqEFl77dEMwPHK25pITaglEGsTuF9BQV1yeLq6Z/tSQQVGL/MXEKEXp pID1zOhv5QDa04vyHf4bhKbf4ikhD02HNrdDskDlOcub1HIWTrOMvMvZDBYkXocTuBRr WuWLN06tNS+S204bkxDI4CJSWikUCw28w6krLFnLoa6sksbUsRbH4Vr9748mY8Jpf+0T DfSSlW5WHu/V4PXEDDk/uaUQvxk9+kmM0Mce7E7Uhey8fQdTZ4EmQP3GsIImVYV+eziU eMnCTZQhJTN7KnBO5aJZVKcLFIdrPewwz8dSAl9hWk3qJrr7MXJPDyQ41zRW6o8yvuFw cXhg== 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=RoKS40n2hHCV+Tt0kmZLbtJuD1otOAVfcY6+qKvI3QU=; b=GbPhzF3SsHcSjtHU3RbTyVn4vkgKkXqhsstsOrsZfKnOd1ijuQsFk43O/5QOcN28H2 XZTY5By19yoyH4ykpqZBJPaVr2xowYcUa70qzI/hek/FayHgHE5IE0xhSJZx48JDeFFA BVHoirqHmwxz8ZVdKXEuAec+qh/2ssgFxCuSVD1xfbTDCsw2Q/QBtbRIaBUfvMtnyE3c NqA6jwKu0xkpWbVsJQO0pOzt49rZeiwi+m+EPUTNtic1F04BvnCLbls+LpG/YRiYB8TR 7m2KmzwMo+Y2hNUv4jeSBiXqGmuacSZ4BngTvmmnCPakODD2e4fJQpcmGhR/wTjuQyFR hJdA== 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 o12-v6si561388plg.650.2018.03.19.12.55.17; Mon, 19 Mar 2018 12:55: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; 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 S969412AbeCSSTa (ORCPT + 99 others); Mon, 19 Mar 2018 14:19:30 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:46894 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S969371AbeCSSTO (ORCPT ); Mon, 19 Mar 2018 14:19:14 -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 0E43810DC; Mon, 19 Mar 2018 18:19:13 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Aaron Salter , Andrew Bowers , Jeff Kirsher , Sasha Levin Subject: [PATCH 4.9 024/241] i40e: Acquire NVM lock before reads on all devices Date: Mon, 19 Mar 2018 19:04:49 +0100 Message-Id: <20180319180752.169330146@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: Aaron Salter [ Upstream commit 96a39aed25e6559b160786117df124084feb9080 ] Acquire NVM lock before reads on all devices. Previously, locks were only used for X722 and later. Fixes an issue where simultaneous X710 NVM accesses were interfering with each other. Change-ID: If570bb7acf958cef58725ec2a2011cead6f80638 Signed-off-by: Aaron Salter 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_nvm.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) --- a/drivers/net/ethernet/intel/i40e/i40e_nvm.c +++ b/drivers/net/ethernet/intel/i40e/i40e_nvm.c @@ -292,14 +292,14 @@ i40e_status i40e_read_nvm_word(struct i4 { enum i40e_status_code ret_code = 0; - if (hw->flags & I40E_HW_FLAG_AQ_SRCTL_ACCESS_ENABLE) { - ret_code = i40e_acquire_nvm(hw, I40E_RESOURCE_READ); - if (!ret_code) { + ret_code = i40e_acquire_nvm(hw, I40E_RESOURCE_READ); + if (!ret_code) { + if (hw->flags & I40E_HW_FLAG_AQ_SRCTL_ACCESS_ENABLE) { ret_code = i40e_read_nvm_word_aq(hw, offset, data); - i40e_release_nvm(hw); + } else { + ret_code = i40e_read_nvm_word_srctl(hw, offset, data); } - } else { - ret_code = i40e_read_nvm_word_srctl(hw, offset, data); + i40e_release_nvm(hw); } return ret_code; }