netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Yanir Lubetkin <yanirx.lubetkin@intel.com>,
	netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com,
	jogreene@redhat.com, Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next 4/9] e1000e: fix logical error in flush_desc_rings
Date: Wed,  3 Jun 2015 04:27:51 -0700	[thread overview]
Message-ID: <1433330876-2658-5-git-send-email-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <1433330876-2658-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Yanir Lubetkin <yanirx.lubetkin@intel.com>

The condition under which the flush should occur was reversed.  The fix
should be applied before any HW reset (unless followed by bus reset)
and before any power state transition from D0.

If E1000_FEXTNVM7_NEED_DESCRING_FLUSH bit is set in FEXTNVM7 and TDLEN > 0
the Tx ring should be flushed. (fixes ~95% of the hang states).
If the E1000_FEXTNVM7_NEED_DESCRING_FLUSH did not clear, we should also
flush the RX ring. Bug was caught by Alexander Duyck during a code review
when examining this fix.

Signed-off-by: Yanir Lubetkin <yanirx.lubetkin@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/netdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index 14ee6a6..b2d77a5 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -3878,7 +3878,7 @@ static void e1000_flush_desc_rings(struct e1000_adapter *adapter)
 	/* do nothing if we're not in faulty state, or if the queue is empty */
 	tdlen = er32(TDLEN(0));
 	hang_state = er32(FEXTNVM7);
-	if ((hang_state & E1000_FEXTNVM7_NEED_DESCRING_FLUSH) || tdlen)
+	if (!(hang_state & E1000_FEXTNVM7_NEED_DESCRING_FLUSH) || !tdlen)
 		return;
 	e1000_flush_tx_ring(adapter);
 	/* recheck, maybe the fault is caused by the rx ring */
-- 
2.1.0

  parent reply	other threads:[~2015-06-03 11:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1433330876-2658-1-git-send-email-jeffrey.t.kirsher@intel.com>
2015-06-03 11:27 ` [net-next 1/9] e1000e: i219 fix unit hang on reset and runtime D3 Jeff Kirsher
2015-06-03 11:27 ` [net-next 2/9] e1000e: i219 execute unit hang fix on every reset or power state transition Jeff Kirsher
2015-06-03 11:27 ` [net-next 3/9] e1000e: remove call to do_div and sign mismatch warning Jeff Kirsher
2015-06-03 11:27 ` Jeff Kirsher [this message]
2015-06-03 11:27 ` [net-next 5/9] e1000e: fix flush_desc_ring implementation Jeff Kirsher
2015-06-03 11:27 ` [net-next 6/9] e1000e: fix legacy interrupt handling in i219 Jeff Kirsher
2015-06-03 11:27 ` [net-next 7/9] e1000e: fix systim issues Jeff Kirsher
2015-06-03 11:27 ` [net-next 8/9] e1000e: fix unit hang during loopback test Jeff Kirsher
2015-06-03 11:27 ` [net-next 9/9] e1000e: Bump the version to 3.2.5 Jeff Kirsher
2015-06-04  3:20 ` [net-next 0/9][pull request] Intel Wired LAN Driver Updates 2015-06-03 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=1433330876-2658-5-git-send-email-jeffrey.t.kirsher@intel.com \
    --to=jeffrey.t.kirsher@intel.com \
    --cc=davem@davemloft.net \
    --cc=jogreene@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@redhat.com \
    --cc=sassmann@redhat.com \
    --cc=yanirx.lubetkin@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).