* [patch 4/8] e1000: prevent statistics from getting garbled during reset
@ 2006-06-09 5:19 akpm
2006-06-09 18:28 ` Auke Kok
0 siblings, 1 reply; 2+ messages in thread
From: akpm @ 2006-06-09 5:19 UTC (permalink / raw)
To: jeff; +Cc: netdev, akpm, linas, jeffrey.t.kirsher, jesse.brandeburg,
john.ronciak
From: Linas Vepstas <linas@austin.ibm.com>
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>
---
drivers/net/e1000/e1000_main.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletion(-)
diff -puN drivers/net/e1000/e1000_main.c~e1000-prevent-statistics-from-getting-garbled-during-reset drivers/net/e1000/e1000_main.c
--- devel/drivers/net/e1000/e1000_main.c~e1000-prevent-statistics-from-getting-garbled-during-reset 2006-04-14 23:41:34.000000000 -0700
+++ devel-akpm/drivers/net/e1000/e1000_main.c 2006-04-14 23:41:34.000000000 -0700
@@ -3082,14 +3082,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);
_
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [patch 4/8] e1000: prevent statistics from getting garbled during reset
2006-06-09 5:19 [patch 4/8] e1000: prevent statistics from getting garbled during reset akpm
@ 2006-06-09 18:28 ` Auke Kok
0 siblings, 0 replies; 2+ messages in thread
From: Auke Kok @ 2006-06-09 18:28 UTC (permalink / raw)
To: jeff; +Cc: akpm, netdev, linas, jesse.brandeburg, john.ronciak
[-- Attachment #1: Type: text/plain, Size: 821 bytes --]
Ack,
Jeff, please pull this patch from:
git://lost.foo-projects.org/~ahkok/git/netdev-2.6 upstream
which is against netdev-2.6#upstream cac925a4aab1b7233d3beb591f53498816058a08
Cheers,
Auke
---
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>
---
e1000_main.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletion(-)
akpm@osdl.org wrote:
> From: Linas Vepstas <linas@austin.ibm.com>
>
> 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.
[snip]
[-- Attachment #2: e1000_prevent_garbled_stats_during_reset_linas.patch --]
[-- Type: text/x-patch, Size: 1276 bytes --]
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>
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 56c7492..a373ccb 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);
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-06-09 20:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-09 5:19 [patch 4/8] e1000: prevent statistics from getting garbled during reset akpm
2006-06-09 18:28 ` Auke Kok
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).