From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Mark Rustad <mark.d.rustad@intel.com>,
netdev@vger.kernel.org, gospo@redhat.com, sassmann@redhat.com,
Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next v2 01/11] ixbge: Protect ixgbe_down with __IXGBE_DOWN bit
Date: Thu, 2 Jan 2014 21:18:20 -0800 [thread overview]
Message-ID: <1388726310-2996-2-git-send-email-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <1388726310-2996-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Mark Rustad <mark.d.rustad@intel.com>
The ixgbe_down function can now prevent multiple executions by
doing test_and_set_bit on __IXGBE_DOWN. This did not work before
introduction of the __IXGBE_REMOVED bit, because of overloading
of __IXGBE_DOWN. Also add smp_mb__before_clear_bit call before
clearing the __IXGBE_DOWN bit.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index cc06854..90a0b4a 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -4572,6 +4572,7 @@ static void ixgbe_up_complete(struct ixgbe_adapter *adapter)
if (hw->mac.ops.enable_tx_laser)
hw->mac.ops.enable_tx_laser(hw);
+ smp_mb__before_clear_bit();
clear_bit(__IXGBE_DOWN, &adapter->state);
ixgbe_napi_enable_all(adapter);
@@ -4783,7 +4784,8 @@ void ixgbe_down(struct ixgbe_adapter *adapter)
int i;
/* signal that we are down to the interrupt handler */
- set_bit(__IXGBE_DOWN, &adapter->state);
+ if (test_and_set_bit(__IXGBE_DOWN, &adapter->state))
+ return; /* do nothing if already down */
/* disable receives */
rxctrl = IXGBE_READ_REG(hw, IXGBE_RXCTRL);
--
1.8.3.1
next prev parent reply other threads:[~2014-01-03 5:18 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-03 5:18 [net-next v2 00/11][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
2014-01-03 5:18 ` Jeff Kirsher [this message]
2014-01-03 5:18 ` [net-next v2 02/11] ixgbe: Indicate removal state explicitly Jeff Kirsher
2014-01-03 5:18 ` [net-next v2 03/11] ixgbe: Use static inlines instead of macros Jeff Kirsher
2014-01-03 5:28 ` Joe Perches
2014-01-03 18:31 ` Rustad, Mark D
2014-01-03 5:18 ` [net-next v2 04/11] ixgbe: Make ethtool register test use accessors Jeff Kirsher
2014-01-03 5:18 ` [net-next v2 05/11] ixgbe: Check register reads for adapter removal Jeff Kirsher
2014-01-03 5:18 ` [net-next v2 06/11] ixgbe: Check for adapter removal on register writes Jeff Kirsher
2014-01-03 5:18 ` [net-next v2 07/11] ixgbe: Additional adapter removal checks Jeff Kirsher
2014-01-03 5:18 ` [net-next v2 08/11] ixgbe: Add Live Error Recovery configuration option Jeff Kirsher
2014-01-04 1:43 ` David Miller
2014-01-03 5:18 ` [net-next v2 09/11] net: e1000e calls skb_set_hash Jeff Kirsher
2014-01-03 5:18 ` [net-next v2 10/11] net: igb " Jeff Kirsher
2014-01-03 5:18 ` [net-next v2 11/11] igb: make local functions static and remove dead code Jeff Kirsher
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=1388726310-2996-2-git-send-email-jeffrey.t.kirsher@intel.com \
--to=jeffrey.t.kirsher@intel.com \
--cc=davem@davemloft.net \
--cc=gospo@redhat.com \
--cc=mark.d.rustad@intel.com \
--cc=netdev@vger.kernel.org \
--cc=sassmann@redhat.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