Commit 9c61a9dc authored by Jesse Brandeburg's avatar Jesse Brandeburg Committed by Jeff Garzik

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: default avatarJesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: default avatarAuke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 9150b76a
...@@ -158,7 +158,6 @@ struct ixgb_adapter { ...@@ -158,7 +158,6 @@ struct ixgb_adapter {
uint16_t link_speed; uint16_t link_speed;
uint16_t link_duplex; uint16_t link_duplex;
spinlock_t tx_lock; spinlock_t tx_lock;
atomic_t irq_sem;
struct work_struct tx_timeout_task; struct work_struct tx_timeout_task;
struct timer_list blink_timer; struct timer_list blink_timer;
......
...@@ -197,7 +197,6 @@ module_exit(ixgb_exit_module); ...@@ -197,7 +197,6 @@ module_exit(ixgb_exit_module);
static void static void
ixgb_irq_disable(struct ixgb_adapter *adapter) ixgb_irq_disable(struct ixgb_adapter *adapter)
{ {
atomic_inc(&adapter->irq_sem);
IXGB_WRITE_REG(&adapter->hw, IMC, ~0); IXGB_WRITE_REG(&adapter->hw, IMC, ~0);
IXGB_WRITE_FLUSH(&adapter->hw); IXGB_WRITE_FLUSH(&adapter->hw);
synchronize_irq(adapter->pdev->irq); synchronize_irq(adapter->pdev->irq);
...@@ -211,14 +210,12 @@ ixgb_irq_disable(struct ixgb_adapter *adapter) ...@@ -211,14 +210,12 @@ ixgb_irq_disable(struct ixgb_adapter *adapter)
static void static void
ixgb_irq_enable(struct ixgb_adapter *adapter) ixgb_irq_enable(struct ixgb_adapter *adapter)
{ {
if(atomic_dec_and_test(&adapter->irq_sem)) { u32 val = IXGB_INT_RXT0 | IXGB_INT_RXDMT0 |
u32 val = IXGB_INT_RXT0 | IXGB_INT_RXDMT0 | IXGB_INT_TXDW | IXGB_INT_LSC;
IXGB_INT_TXDW | IXGB_INT_LSC; if (adapter->hw.subsystem_vendor_id == SUN_SUBVENDOR_ID)
if (adapter->hw.subsystem_vendor_id == SUN_SUBVENDOR_ID) val |= IXGB_INT_GPI0;
val |= IXGB_INT_GPI0; IXGB_WRITE_REG(&adapter->hw, IMS, val);
IXGB_WRITE_REG(&adapter->hw, IMS, val); IXGB_WRITE_FLUSH(&adapter->hw);
IXGB_WRITE_FLUSH(&adapter->hw);
}
} }
int int
...@@ -305,7 +302,6 @@ ixgb_down(struct ixgb_adapter *adapter, bool kill_watchdog) ...@@ -305,7 +302,6 @@ ixgb_down(struct ixgb_adapter *adapter, bool kill_watchdog)
#ifdef CONFIG_IXGB_NAPI #ifdef CONFIG_IXGB_NAPI
napi_disable(&adapter->napi); napi_disable(&adapter->napi);
atomic_set(&adapter->irq_sem, 0);
#endif #endif
/* waiting for NAPI to complete can re-enable interrupts */ /* waiting for NAPI to complete can re-enable interrupts */
ixgb_irq_disable(adapter); ixgb_irq_disable(adapter);
...@@ -594,7 +590,6 @@ ixgb_sw_init(struct ixgb_adapter *adapter) ...@@ -594,7 +590,6 @@ ixgb_sw_init(struct ixgb_adapter *adapter)
/* enable flow control to be programmed */ /* enable flow control to be programmed */
hw->fc.send_xon = 1; hw->fc.send_xon = 1;
atomic_set(&adapter->irq_sem, 1);
spin_lock_init(&adapter->tx_lock); spin_lock_init(&adapter->tx_lock);
set_bit(__IXGB_DOWN, &adapter->flags); set_bit(__IXGB_DOWN, &adapter->flags);
...@@ -1774,7 +1769,6 @@ ixgb_intr(int irq, void *data) ...@@ -1774,7 +1769,6 @@ ixgb_intr(int irq, void *data)
of the posted write is intentionally left out. of the posted write is intentionally left out.
*/ */
atomic_inc(&adapter->irq_sem);
IXGB_WRITE_REG(&adapter->hw, IMC, ~0); IXGB_WRITE_REG(&adapter->hw, IMC, ~0);
__netif_rx_schedule(netdev, &adapter->napi); __netif_rx_schedule(netdev, &adapter->napi);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment