All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Punit Agrawal <punit1.agrawal@toshiba.co.jp>,
	netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com,
	stable <stable@vger.kernel.org>,
	Alexander Duyck <alexander.h.duyck@linux.intel.com>,
	Aaron Brown <aaron.f.brown@intel.com>,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next 11/17] e1000e: Relax condition to trigger reset for ME workaround
Date: Thu, 28 May 2020 21:39:58 -0700	[thread overview]
Message-ID: <20200529044004.3725307-12-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <20200529044004.3725307-1-jeffrey.t.kirsher@intel.com>

From: Punit Agrawal <punit1.agrawal@toshiba.co.jp>

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 <stable@vger.kernel.org>
Signed-off-by: Punit Agrawal <punit1.agrawal@toshiba.co.jp>
Reviewed-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/e1000e/e1000.h  |  1 -
 drivers/net/ethernet/intel/e1000e/netdev.c | 12 +++++-------
 2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/intel/e1000e/e1000.h b/drivers/net/ethernet/intel/e1000e/e1000.h
index 37a2314d3e6b..944abd5eae11 100644
--- a/drivers/net/ethernet/intel/e1000e/e1000.h
+++ b/drivers/net/ethernet/intel/e1000e/e1000.h
@@ -576,7 +576,6 @@ static inline u32 __er32(struct e1000_hw *hw, unsigned long reg)
 
 #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))
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index 32f23a15ff64..444532292588 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -158,14 +158,12 @@ static bool e1000e_check_me(u16 device_id)
  * 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)
@@ -646,11 +644,11 @@ static void e1000e_update_rdt_wa(struct e1000_ring *rx_ring, unsigned int i)
 {
 	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);
@@ -663,11 +661,11 @@ static void e1000e_update_tdt_wa(struct e1000_ring *tx_ring, unsigned int i)
 {
 	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);
-- 
2.26.2


  parent reply	other threads:[~2020-05-29  4:40 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-29  4:39 [net-next 00/17][pull request] Intel Wired LAN Driver Updates 2020-05-28 Jeff Kirsher
2020-05-29  4:39 ` [net-next 01/17] i40e: Use scnprintf() for avoiding potential buffer overflow Jeff Kirsher
2020-05-29  4:39 ` [net-next 02/17] i40e: trivial fixup of comments in i40e_xsk.c Jeff Kirsher
2020-05-29  4:39 ` [net-next 03/17] ixgbe: fix signed-integer-overflow warning Jeff Kirsher
2020-05-29  4:39 ` [net-next 04/17] ixgbe: Remove conversion to bool in ixgbe_device_supports_autoneg_fc() Jeff Kirsher
2020-05-29  4:39 ` [net-next 05/17] ixgbe: Use true, false for bool variable in __ixgbe_enable_sriov() Jeff Kirsher
2020-05-29  4:39 ` [net-next 06/17] ixgbe: Remove unused inline function ixgbe_irq_disable_queues Jeff Kirsher
2020-05-29  4:39 ` [net-next 07/17] igb: make igb_set_fc_watermarks() return void Jeff Kirsher
2020-05-29  4:39 ` [net-next 08/17] igc: Remove unused flags Jeff Kirsher
2020-05-29  4:39 ` [net-next 09/17] igc: Reject NFC rules with multiple matches Jeff Kirsher
2020-05-29  4:39 ` [net-next 10/17] igc: Fix IGC_MAX_RXNFC_RULES Jeff Kirsher
2020-05-29  4:39 ` Jeff Kirsher [this message]
2020-05-29  4:39 ` [net-next 12/17] i40e: Make i40e_shutdown_adminq() return void Jeff Kirsher
2020-05-29  4:40 ` [net-next 13/17] igc: Remove symbol error counter Jeff Kirsher
2020-05-29  4:40 ` [net-next 14/17] igc: Add Receive Error Counter Jeff Kirsher
2020-05-29  4:40 ` [net-next 15/17] igc: Remove Sequence " Jeff Kirsher
2020-05-29  4:40 ` [net-next 16/17] igc: Fix wrong register name Jeff Kirsher
2020-05-29  4:40 ` [net-next 17/17] e1000: Fix typo in the comment Jeff Kirsher
2020-05-29 19:17 ` [net-next 00/17][pull request] Intel Wired LAN Driver Updates 2020-05-28 David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200529044004.3725307-12-jeffrey.t.kirsher@intel.com \
    --to=jeffrey.t.kirsher@intel.com \
    --cc=aaron.f.brown@intel.com \
    --cc=alexander.h.duyck@linux.intel.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@redhat.com \
    --cc=punit1.agrawal@toshiba.co.jp \
    --cc=sassmann@redhat.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.