From: linas@austin.ibm.com (Linas Vepstas)
To: Greg KH <greg@kroah.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
jesse.brandeburg@intel.com, linuxppc-dev@ozlabs.org,
john.ronciak@intel.com, jeffrey.t.kirsher@intel.com,
linux-pci@atrey.karlin.mff.cuni.cz,
Jeff Garzik <jgarzik@pobox.com>
Subject: Re: [PATCH]: e1000: prevent statistics from getting garbled during reset.
Date: Fri, 31 Mar 2006 11:06:20 -0600 [thread overview]
Message-ID: <20060331170620.GW2172@austin.ibm.com> (raw)
In-Reply-To: <20060331054654.GA6632@kroah.com>
On Thu, Mar 30, 2006 at 09:46:54PM -0800, Greg KH wrote:
>
> (hint, use a tab...)
glurg.
[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>
----
drivers/net/e1000/e1000_main.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletion(-)
Index: linux-2.6.16-git6/drivers/net/e1000/e1000_main.c
===================================================================
--- linux-2.6.16-git6.orig/drivers/net/e1000/e1000_main.c 2006-03-30 17:51:37.924162779 -0600
+++ linux-2.6.16-git6/drivers/net/e1000/e1000_main.c 2006-03-30 17:54:07.659188391 -0600
@@ -3069,14 +3069,18 @@ 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);
prev parent reply other threads:[~2006-03-31 18:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-30 21:39 [PATCH]: e1000: prevent statistics from getting garbled during reset Linas Vepstas
2006-03-31 0:02 ` Linas Vepstas
2006-03-31 1:05 ` Jeff V. Merkey
2006-03-31 0:35 ` Linas Vepstas
2006-03-31 4:14 ` Jeffrey V. Merkey
2006-03-31 17:03 ` Linas Vepstas
2006-03-31 17:36 ` Rick Jones
2006-03-31 18:40 ` Jeff V. Merkey
2006-03-31 5:46 ` Greg KH
2006-03-31 17:06 ` Linas Vepstas [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060331170620.GW2172@austin.ibm.com \
--to=linas@austin.ibm.com \
--cc=greg@kroah.com \
--cc=jeffrey.t.kirsher@intel.com \
--cc=jesse.brandeburg@intel.com \
--cc=jgarzik@pobox.com \
--cc=john.ronciak@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@atrey.karlin.mff.cuni.cz \
--cc=linuxppc-dev@ozlabs.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).