Received: by 10.213.65.68 with SMTP id h4csp1800253imn; Mon, 19 Mar 2018 13:37:17 -0700 (PDT) X-Google-Smtp-Source: AG47ELtCqCNIANXcvk+g/cRSpd+pcVPlsouiRjbHcdE7KMVO23TbMh1ksSXB8kZhnu0d2KqcviIO X-Received: by 10.101.72.9 with SMTP id h9mr4452795pgs.88.1521491836987; Mon, 19 Mar 2018 13:37:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521491836; cv=none; d=google.com; s=arc-20160816; b=09MTd8Qsm0r9UWaE0apINRIg0XUMuCZ6XRfYrkopDIAv5ntFfeNdD9srZHGQVJfKQM luvWlIodWiullV1KZH2E1FDr0/MsQBx/MITuITQhik+vRBP6WsDI1WnfS6fgVJJ+ReYf 24wNXWMtc8OeRfelisw0dgzDwfHOZWptlzPQmfN6tEgxlGR2F20n6m+Kqwu/mygUzBNP Sv5HpEUE8d0CAsQLEk8CgPkmApxAMbP4kPBlvYoxAcjAL/lgjPNJfK/TVtccbSOV0CLL WTSjTYeAuDXuRW3IrA795R50D3bXV0U80LKzHYoUZR0XFOdA96z2nKbmwOKY1u6CAh2A xY8w== 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=q9wQmnurLZKm/QZDD5BH+KGAVHfN8bk5yGx2A+IYLvI=; b=l4RElFF7adcsKm1ZSThsemwclWn/ea7EC/60PSf6kPAc9Hbj36IrZ0kMBAtvMh/9rv fwC3GpSMqBP7RvFoLLntueNFaIVPvdRUZR5zf3fHWnBEqfElz6z8R+OrivQF++or/Pdm S1TbXrK/gYIgB/Lb8X74+teTek+T3aYuMonWN0T0y3h+fNu+MNVcjlka01xxE3sR1Fxd FmExEUpcAu0IOtoF1ooR/lXSzJjHdzNuLPRORcIHeKxukabmAztUjVbHKgskX0XGCxhW f3EEY1V0UJ3o2sjeKPe3uow1IVZfgef517/xlUhiOsoZ/3o9fZNTOWk7e8q2s0g2Qsul u98Q== 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 1-v6si45457ply.119.2018.03.19.13.37.02; Mon, 19 Mar 2018 13:37:16 -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 S1031917AbeCSUdq (ORCPT + 99 others); Mon, 19 Mar 2018 16:33:46 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:42660 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S968299AbeCSSMO (ORCPT ); Mon, 19 Mar 2018 14:12: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 D4BB411B4; Mon, 19 Mar 2018 18:12: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.4 012/134] i40e: Acquire NVM lock before reads on all devices Date: Mon, 19 Mar 2018 19:04:55 +0100 Message-Id: <20180319171850.885199227@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: 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; }