ixgb: fix smp polling race condition
Moved interrupt masking to before requesting the interrupt from the OS. Moved interrupt enable to after netif_poll_enable. This fixes a racy BUG() where polling would be running on another CPU at the same time that netif_poll_enable would run. Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com> Signed-off-by: John Ronciak <john.ronciak@intel.com>
This commit is contained in:
@@ -247,6 +247,9 @@ ixgb_up(struct ixgb_adapter *adapter)
|
|||||||
ixgb_configure_rx(adapter);
|
ixgb_configure_rx(adapter);
|
||||||
ixgb_alloc_rx_buffers(adapter);
|
ixgb_alloc_rx_buffers(adapter);
|
||||||
|
|
||||||
|
/* disable interrupts and get the hardware into a known state */
|
||||||
|
IXGB_WRITE_REG(&adapter->hw, IMC, 0xffffffff);
|
||||||
|
|
||||||
#ifdef CONFIG_PCI_MSI
|
#ifdef CONFIG_PCI_MSI
|
||||||
{
|
{
|
||||||
boolean_t pcix = (IXGB_READ_REG(&adapter->hw, STATUS) &
|
boolean_t pcix = (IXGB_READ_REG(&adapter->hw, STATUS) &
|
||||||
@@ -272,9 +275,6 @@ ixgb_up(struct ixgb_adapter *adapter)
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* disable interrupts and get the hardware into a known state */
|
|
||||||
IXGB_WRITE_REG(&adapter->hw, IMC, 0xffffffff);
|
|
||||||
|
|
||||||
if((hw->max_frame_size != max_frame) ||
|
if((hw->max_frame_size != max_frame) ||
|
||||||
(hw->max_frame_size !=
|
(hw->max_frame_size !=
|
||||||
(IXGB_READ_REG(hw, MFS) >> IXGB_MFS_SHIFT))) {
|
(IXGB_READ_REG(hw, MFS) >> IXGB_MFS_SHIFT))) {
|
||||||
@@ -295,11 +295,12 @@ ixgb_up(struct ixgb_adapter *adapter)
|
|||||||
}
|
}
|
||||||
|
|
||||||
mod_timer(&adapter->watchdog_timer, jiffies);
|
mod_timer(&adapter->watchdog_timer, jiffies);
|
||||||
ixgb_irq_enable(adapter);
|
|
||||||
|
|
||||||
#ifdef CONFIG_IXGB_NAPI
|
#ifdef CONFIG_IXGB_NAPI
|
||||||
netif_poll_enable(netdev);
|
netif_poll_enable(netdev);
|
||||||
#endif
|
#endif
|
||||||
|
ixgb_irq_enable(adapter);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user