Commit 9c61a9dcb26dc1db9912c11568b98f89b635adfd

Authored by Jesse Brandeburg
Committed by Jeff Garzik
1 parent 9150b76a64

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>

Showing 2 changed files with 6 additions and 13 deletions Side-by-side Diff

drivers/net/ixgb/ixgb.h
... ... @@ -158,7 +158,6 @@
158 158 uint16_t link_speed;
159 159 uint16_t link_duplex;
160 160 spinlock_t tx_lock;
161   - atomic_t irq_sem;
162 161 struct work_struct tx_timeout_task;
163 162  
164 163 struct timer_list blink_timer;
drivers/net/ixgb/ixgb_main.c
... ... @@ -197,7 +197,6 @@
197 197 static void
198 198 ixgb_irq_disable(struct ixgb_adapter *adapter)
199 199 {
200   - atomic_inc(&adapter->irq_sem);
201 200 IXGB_WRITE_REG(&adapter->hw, IMC, ~0);
202 201 IXGB_WRITE_FLUSH(&adapter->hw);
203 202 synchronize_irq(adapter->pdev->irq);
... ... @@ -211,14 +210,12 @@
211 210 static void
212 211 ixgb_irq_enable(struct ixgb_adapter *adapter)
213 212 {
214   - if(atomic_dec_and_test(&adapter->irq_sem)) {
215   - u32 val = IXGB_INT_RXT0 | IXGB_INT_RXDMT0 |
216   - IXGB_INT_TXDW | IXGB_INT_LSC;
217   - if (adapter->hw.subsystem_vendor_id == SUN_SUBVENDOR_ID)
218   - val |= IXGB_INT_GPI0;
219   - IXGB_WRITE_REG(&adapter->hw, IMS, val);
220   - IXGB_WRITE_FLUSH(&adapter->hw);
221   - }
  213 + u32 val = IXGB_INT_RXT0 | IXGB_INT_RXDMT0 |
  214 + IXGB_INT_TXDW | IXGB_INT_LSC;
  215 + if (adapter->hw.subsystem_vendor_id == SUN_SUBVENDOR_ID)
  216 + val |= IXGB_INT_GPI0;
  217 + IXGB_WRITE_REG(&adapter->hw, IMS, val);
  218 + IXGB_WRITE_FLUSH(&adapter->hw);
222 219 }
223 220  
224 221 int
... ... @@ -305,7 +302,6 @@
305 302  
306 303 #ifdef CONFIG_IXGB_NAPI
307 304 napi_disable(&adapter->napi);
308   - atomic_set(&adapter->irq_sem, 0);
309 305 #endif
310 306 /* waiting for NAPI to complete can re-enable interrupts */
311 307 ixgb_irq_disable(adapter);
... ... @@ -594,7 +590,6 @@
594 590 /* enable flow control to be programmed */
595 591 hw->fc.send_xon = 1;
596 592  
597   - atomic_set(&adapter->irq_sem, 1);
598 593 spin_lock_init(&adapter->tx_lock);
599 594  
600 595 set_bit(__IXGB_DOWN, &adapter->flags);
... ... @@ -1774,7 +1769,6 @@
1774 1769 of the posted write is intentionally left out.
1775 1770 */
1776 1771  
1777   - atomic_inc(&adapter->irq_sem);
1778 1772 IXGB_WRITE_REG(&adapter->hw, IMC, ~0);
1779 1773 __netif_rx_schedule(netdev, &adapter->napi);
1780 1774 }