diff options
author | Jesse Brandeburg <jesse.brandeburg@intel.com> | 2008-03-21 14:07:03 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2008-03-26 00:17:53 -0400 |
commit | 9c61a9dcb26dc1db9912c11568b98f89b635adfd (patch) | |
tree | cd1abb754a5befd9112a2baf0108c7fcb1982398 /drivers/net/ixgb/ixgb_main.c | |
parent | 9150b76a6439b60e678ccb6376ee3686a2f76767 (diff) |
ixgb: remove irq_sem
ixgb can remove irq_sem by auditing all the call sites to make sure
that each of them makes sure the adapter is in the correct state
before re-enabling interrupts. after doing this to all of our other
drivers it is becoming easier.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/ixgb/ixgb_main.c')
-rw-r--r-- | drivers/net/ixgb/ixgb_main.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c index d9688bbb9292..9c9bf31e5c25 100644 --- a/drivers/net/ixgb/ixgb_main.c +++ b/drivers/net/ixgb/ixgb_main.c | |||
@@ -197,7 +197,6 @@ module_exit(ixgb_exit_module); | |||
197 | static void | 197 | static void |
198 | ixgb_irq_disable(struct ixgb_adapter *adapter) | 198 | ixgb_irq_disable(struct ixgb_adapter *adapter) |
199 | { | 199 | { |
200 | atomic_inc(&adapter->irq_sem); | ||
201 | IXGB_WRITE_REG(&adapter->hw, IMC, ~0); | 200 | IXGB_WRITE_REG(&adapter->hw, IMC, ~0); |
202 | IXGB_WRITE_FLUSH(&adapter->hw); | 201 | IXGB_WRITE_FLUSH(&adapter->hw); |
203 | synchronize_irq(adapter->pdev->irq); | 202 | synchronize_irq(adapter->pdev->irq); |
@@ -211,14 +210,12 @@ ixgb_irq_disable(struct ixgb_adapter *adapter) | |||
211 | static void | 210 | static void |
212 | ixgb_irq_enable(struct ixgb_adapter *adapter) | 211 | ixgb_irq_enable(struct ixgb_adapter *adapter) |
213 | { | 212 | { |
214 | if(atomic_dec_and_test(&adapter->irq_sem)) { | 213 | u32 val = IXGB_INT_RXT0 | IXGB_INT_RXDMT0 | |
215 | u32 val = IXGB_INT_RXT0 | IXGB_INT_RXDMT0 | | 214 | IXGB_INT_TXDW | IXGB_INT_LSC; |
216 | IXGB_INT_TXDW | IXGB_INT_LSC; | 215 | if (adapter->hw.subsystem_vendor_id == SUN_SUBVENDOR_ID) |
217 | if (adapter->hw.subsystem_vendor_id == SUN_SUBVENDOR_ID) | 216 | val |= IXGB_INT_GPI0; |
218 | val |= IXGB_INT_GPI0; | 217 | IXGB_WRITE_REG(&adapter->hw, IMS, val); |
219 | IXGB_WRITE_REG(&adapter->hw, IMS, val); | 218 | IXGB_WRITE_FLUSH(&adapter->hw); |
220 | IXGB_WRITE_FLUSH(&adapter->hw); | ||
221 | } | ||
222 | } | 219 | } |
223 | 220 | ||
224 | int | 221 | int |
@@ -305,7 +302,6 @@ ixgb_down(struct ixgb_adapter *adapter, bool kill_watchdog) | |||
305 | 302 | ||
306 | #ifdef CONFIG_IXGB_NAPI | 303 | #ifdef CONFIG_IXGB_NAPI |
307 | napi_disable(&adapter->napi); | 304 | napi_disable(&adapter->napi); |
308 | atomic_set(&adapter->irq_sem, 0); | ||
309 | #endif | 305 | #endif |
310 | /* waiting for NAPI to complete can re-enable interrupts */ | 306 | /* waiting for NAPI to complete can re-enable interrupts */ |
311 | ixgb_irq_disable(adapter); | 307 | ixgb_irq_disable(adapter); |
@@ -594,7 +590,6 @@ ixgb_sw_init(struct ixgb_adapter *adapter) | |||
594 | /* enable flow control to be programmed */ | 590 | /* enable flow control to be programmed */ |
595 | hw->fc.send_xon = 1; | 591 | hw->fc.send_xon = 1; |
596 | 592 | ||
597 | atomic_set(&adapter->irq_sem, 1); | ||
598 | spin_lock_init(&adapter->tx_lock); | 593 | spin_lock_init(&adapter->tx_lock); |
599 | 594 | ||
600 | set_bit(__IXGB_DOWN, &adapter->flags); | 595 | set_bit(__IXGB_DOWN, &adapter->flags); |
@@ -1774,7 +1769,6 @@ ixgb_intr(int irq, void *data) | |||
1774 | of the posted write is intentionally left out. | 1769 | of the posted write is intentionally left out. |
1775 | */ | 1770 | */ |
1776 | 1771 | ||
1777 | atomic_inc(&adapter->irq_sem); | ||
1778 | IXGB_WRITE_REG(&adapter->hw, IMC, ~0); | 1772 | IXGB_WRITE_REG(&adapter->hw, IMC, ~0); |
1779 | __netif_rx_schedule(netdev, &adapter->napi); | 1773 | __netif_rx_schedule(netdev, &adapter->napi); |
1780 | } | 1774 | } |