aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e1000/e1000_main.c
diff options
context:
space:
mode:
authorLinas Vepstas <linas@austin.ibm.com>2006-06-09 01:19:44 -0400
committerJeff Garzik <jeff@garzik.org>2006-06-11 10:35:15 -0400
commit282f33c98618a3877043ec9dd5ac777c5e7c117d (patch)
tree2194a2b7b067f8718aa42486cc14f29062e19dae /drivers/net/e1000/e1000_main.c
parentb89fa8b6d738d71c3a9eff584177bb7de13f33b9 (diff)
[PATCH] e1000: prevent statistics from getting garbled during reset
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. This patch presumes that an earlier patch, [PATCH] PCI Error Recovery: e1000 network device driver has already been applied. Signed-off-by: Linas Vepstas <linas@austin.ibm.com> Cc: John Ronciak <john.ronciak@intel.com> Cc: Jesse Brandeburg <jesse.brandeburg@intel.com> Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Cc: Jeff Garzik <jeff@garzik.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/e1000/e1000_main.c')
-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
3045e1000_update_stats(struct e1000_adapter *adapter) 3045e1000_update_stats(struct e1000_adapter *adapter)
3046{ 3046{
3047 struct e1000_hw *hw = &adapter->hw; 3047 struct e1000_hw *hw = &adapter->hw;
3048 struct pci_dev *pdev = adapter->pdev;
3048 unsigned long flags; 3049 unsigned long flags;
3049 uint16_t phy_tmp; 3050 uint16_t phy_tmp;
3050 3051
3051#define PHY_IDLE_ERROR_COUNT_MASK 0x00FF 3052#define PHY_IDLE_ERROR_COUNT_MASK 0x00FF
3052 3053
3053 /* Prevent stats update while adapter is being reset */ 3054 /*
3055 * Prevent stats update while adapter is being reset, or if the pci
3056 * connection is down.
3057 */
3054 if (adapter->link_speed == 0) 3058 if (adapter->link_speed == 0)
3055 return; 3059 return;
3060 if (pdev->error_state && pdev->error_state != pci_channel_io_normal)
3061 return;
3056 3062
3057 spin_lock_irqsave(&adapter->stats_lock, flags); 3063 spin_lock_irqsave(&adapter->stats_lock, flags);
3058 3064