summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAuke Kok <auke-jan.h.kok@intel.com>2006-06-09 20:29:03 +0200
committerAuke Kok <juke-jan.h.kok@intel.com>2006-06-09 20:29:03 +0200
commita487a8f7b6947f6445e5a1aa876522916785d5ec (patch)
treea64fb0d90dce25095558b89de86a2d9a6d340d21
parentMerge branch 'upstream' of git://lost.foo-projects.org/~ahkok/git/netdev-2.6 ... (diff)
downloadlinux-a487a8f7b6947f6445e5a1aa876522916785d5ec.tar.xz
linux-a487a8f7b6947f6445e5a1aa876522916785d5ec.zip
e1000: prevent statistics from garbling during bus resets
If a PCI bus error/fault triggers a PCI bus reset, attempts to get the ethernet packet count statistics from the hardware will fail, returning garbage data upstream. This patch skips statistics data collection if the PCI device is not on the bus. Signed-off-by: Linas Vepstas <linas@austin.ibm.com> Cc: Jesse Brandeburg <jesse.brandeburg@intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Acked-by: Auke Kok <auke-jan.h.kok@intel.com>
-rw-r--r--drivers/net/e1000/e1000_main.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 56c7492e3e91..a373ccb308d8 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -3045,14 +3045,20 @@ void
e1000_update_stats(struct e1000_adapter *adapter)
{
struct e1000_hw *hw = &adapter->hw;
+ struct pci_dev *pdev = adapter->pdev;
unsigned long flags;
uint16_t phy_tmp;
#define PHY_IDLE_ERROR_COUNT_MASK 0x00FF
- /* Prevent stats update while adapter is being reset */
+ /*
+ * Prevent stats update while adapter is being reset, or if the pci
+ * connection is down.
+ */
if (adapter->link_speed == 0)
return;
+ if (pdev->error_state && pdev->error_state != pci_channel_io_normal)
+ return;
spin_lock_irqsave(&adapter->stats_lock, flags);