aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e1000e
diff options
context:
space:
mode:
authorJesse Brandeburg <jesse.brandeburg@intel.com>2009-03-25 18:05:41 -0400
committerDavid S. Miller <davem@davemloft.net>2009-03-26 04:09:59 -0400
commita3c69fef7a7775b0bcfbb8249845a25598cfe951 (patch)
tree1bed059e5df99f24dcb4479b3cc41cc0cc231708 /drivers/net/e1000e
parenta72d2b2cc63994cb8d592a004bf5331be6905814 (diff)
e1000e: fix close interrupt race
As noticed by Alan Cox, it is possible for e1000e to exit its interrupt handler or NAPI with interrupts enabled even when the driver is unloading or being configured administratively down. fix related to fix for: http://bugzilla.kernel.org/show_bug.cgi?id=12876 Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> CC: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/e1000e')
-rw-r--r--drivers/net/e1000e/netdev.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index 17974121912d..b4ae0465121a 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -1261,7 +1261,8 @@ static irqreturn_t e1000_msix_other(int irq, void *data)
1261 u32 icr = er32(ICR); 1261 u32 icr = er32(ICR);
1262 1262
1263 if (!(icr & E1000_ICR_INT_ASSERTED)) { 1263 if (!(icr & E1000_ICR_INT_ASSERTED)) {
1264 ew32(IMS, E1000_IMS_OTHER); 1264 if (!test_bit(__E1000_DOWN, &adapter->state))
1265 ew32(IMS, E1000_IMS_OTHER);
1265 return IRQ_NONE; 1266 return IRQ_NONE;
1266 } 1267 }
1267 1268
@@ -1278,7 +1279,8 @@ static irqreturn_t e1000_msix_other(int irq, void *data)
1278 } 1279 }
1279 1280
1280no_link_interrupt: 1281no_link_interrupt:
1281 ew32(IMS, E1000_IMS_LSC | E1000_IMS_OTHER); 1282 if (!test_bit(__E1000_DOWN, &adapter->state))
1283 ew32(IMS, E1000_IMS_LSC | E1000_IMS_OTHER);
1282 1284
1283 return IRQ_HANDLED; 1285 return IRQ_HANDLED;
1284} 1286}
@@ -2015,10 +2017,12 @@ clean_rx:
2015 if (adapter->itr_setting & 3) 2017 if (adapter->itr_setting & 3)
2016 e1000_set_itr(adapter); 2018 e1000_set_itr(adapter);
2017 napi_complete(napi); 2019 napi_complete(napi);
2018 if (adapter->msix_entries) 2020 if (!test_bit(__E1000_DOWN, &adapter->state)) {
2019 ew32(IMS, adapter->rx_ring->ims_val); 2021 if (adapter->msix_entries)
2020 else 2022 ew32(IMS, adapter->rx_ring->ims_val);
2021 e1000_irq_enable(adapter); 2023 else
2024 e1000_irq_enable(adapter);
2025 }
2022 } 2026 }
2023 2027
2024 return work_done; 2028 return work_done;