Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp995068ybt; Fri, 19 Jun 2020 20:58:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPuTZDzcL3xnk5BBhJXgFMi126t+WasK30Ot4YuNt/+p7JkkmtXVmsCnl/0cWHptKWSSK+ X-Received: by 2002:a05:6402:1606:: with SMTP id f6mr6249373edv.286.1592625517192; Fri, 19 Jun 2020 20:58:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592625517; cv=none; d=google.com; s=arc-20160816; b=FpB1Vr8lD76plIvvyvoDPwGtFuhaEudGXeFwpytIf1XV+p6OS4149uTCfOCQzYcMRm RC0zdZK0afe1yY2J8F2d6CnYMdB0lvCWlFzcR38gAdFKd4nSe7VQQM7wWZQOOEC6HWLX aw96O924MLX5tGnaXCtrfbW/VSnsbOMtPuurfx/x4VkUuYF8uP6gYzQeFGnmb9YRn4EP aN+UceuZYt3/kYBakvVAuwZUIbqLXb4eFHxQYfx4XQ9ekWNifL+vCjVGVBATnvd3Zlhh TPqz+YLvOCkZsXczKZvUBFU6NGYNIzXP1yKxUGvBuhM26JI0HcPW8rwr3WFPVrdP/8YT rvtw== 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=m3gTVgcMaa7e9sL2XETrNEiefjiUIsOVO4PtxKUad/8=; b=RbIKew2b89RklaoBUNKt+VI7JPI+Ze08IL7dDT5iK9BhkxrddKqFAi3iu1X1SrJ51q 4jEu9DJ55oTaaJ0wsC68dpISGB8/sMPUU3f+r1TqFBZgJwnTpe4FmylONqU/Q4dWIrmI CVbkbhREDmRNaN4t4LlkmvWWAx2Cxi8JBBZRFLQpIYc6y/w5m2taWkN+36kVqUPQvIjI Ok6JPWwTaDGprFmHLgAL+Ojwny7kh5ToZ8NWqeJQPy404/0RUM9+JgeWPDqyHuWwiYIY eVpIhDgmEvyMD7aDncKV9a7TdfIwEboe3LlMpJ1nn/uteA0gse6oQZXewPYegAse1s8w 9B8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=f4YPzg4C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n22si4967616edy.377.2020.06.19.20.58.15; Fri, 19 Jun 2020 20:58:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=f4YPzg4C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393631AbgFSQbB (ORCPT + 99 others); Fri, 19 Jun 2020 12:31:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:47448 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389690AbgFSOxO (ORCPT ); Fri, 19 Jun 2020 10:53:14 -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 0AC1E217D8; Fri, 19 Jun 2020 14:53:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592578392; bh=8Z0208WZvPIH3GwC9gjC99LzsTJ2x3cE3S37kIwIkMY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f4YPzg4CxIDMKZRJIDyjZMAXNSzgsf6wER9YGJneDoYCIv2yWIyZwfpfx7r0n8VP/ D5BVNOteRtp0I6ykQ6OWxQRXGzjHhdnDcZllWAszQkmJrAAbMIKn7MFKOKXrczlU5C NM2QH5EXDiLc5AA6gHRIv4rrX9MVtPx87Gw58yYg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Punit Agrawal , Alexander Duyck , Aaron Brown , Jeff Kirsher Subject: [PATCH 4.14 164/190] e1000e: Relax condition to trigger reset for ME workaround Date: Fri, 19 Jun 2020 16:33:29 +0200 Message-Id: <20200619141641.958494789@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200619141633.446429600@linuxfoundation.org> References: <20200619141633.446429600@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 From: Punit Agrawal commit d601afcae2febc49665008e9a79e701248d56c50 upstream. It's an error if the value of the RX/TX tail descriptor does not match what was written. The error condition is true regardless the duration of the interference from ME. But the driver only performs the reset if E1000_ICH_FWSM_PCIM2PCI_COUNT (2000) iterations of 50us delay have transpired. The extra condition can lead to inconsistency between the state of hardware as expected by the driver. Fix this by dropping the check for number of delay iterations. While at it, also make __ew32_prepare() static as it's not used anywhere else. CC: stable Signed-off-by: Punit Agrawal Reviewed-by: Alexander Duyck Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/intel/e1000e/e1000.h | 1 - drivers/net/ethernet/intel/e1000e/netdev.c | 12 +++++------- 2 files changed, 5 insertions(+), 8 deletions(-) --- a/drivers/net/ethernet/intel/e1000e/e1000.h +++ b/drivers/net/ethernet/intel/e1000e/e1000.h @@ -596,7 +596,6 @@ static inline u32 __er32(struct e1000_hw #define er32(reg) __er32(hw, E1000_##reg) -s32 __ew32_prepare(struct e1000_hw *hw); void __ew32(struct e1000_hw *hw, unsigned long reg, u32 val); #define ew32(reg, val) __ew32(hw, E1000_##reg, (val)) --- a/drivers/net/ethernet/intel/e1000e/netdev.c +++ b/drivers/net/ethernet/intel/e1000e/netdev.c @@ -137,14 +137,12 @@ static const struct e1000_reg_info e1000 * has bit 24 set while ME is accessing MAC CSR registers, wait if it is set * and try again a number of times. **/ -s32 __ew32_prepare(struct e1000_hw *hw) +static void __ew32_prepare(struct e1000_hw *hw) { s32 i = E1000_ICH_FWSM_PCIM2PCI_COUNT; while ((er32(FWSM) & E1000_ICH_FWSM_PCIM2PCI) && --i) udelay(50); - - return i; } void __ew32(struct e1000_hw *hw, unsigned long reg, u32 val) @@ -625,11 +623,11 @@ static void e1000e_update_rdt_wa(struct { struct e1000_adapter *adapter = rx_ring->adapter; struct e1000_hw *hw = &adapter->hw; - s32 ret_val = __ew32_prepare(hw); + __ew32_prepare(hw); writel(i, rx_ring->tail); - if (unlikely(!ret_val && (i != readl(rx_ring->tail)))) { + if (unlikely(i != readl(rx_ring->tail))) { u32 rctl = er32(RCTL); ew32(RCTL, rctl & ~E1000_RCTL_EN); @@ -642,11 +640,11 @@ static void e1000e_update_tdt_wa(struct { struct e1000_adapter *adapter = tx_ring->adapter; struct e1000_hw *hw = &adapter->hw; - s32 ret_val = __ew32_prepare(hw); + __ew32_prepare(hw); writel(i, tx_ring->tail); - if (unlikely(!ret_val && (i != readl(tx_ring->tail)))) { + if (unlikely(i != readl(tx_ring->tail))) { u32 tctl = er32(TCTL); ew32(TCTL, tctl & ~E1000_TCTL_EN);