netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Jin <joe.jin@oracle.com>
To: Matt Carlson <mcarlson@broadcom.com>, Michael Chan <mchan@broadcom.com>
Cc: Guru Anbalagane <guru.anbalagane@oracle.com>,
	Gurudas Pai <gurudas.pai@oracle.com>,
	Joe Jin <joe.jin@oracle.com>,
	netdev@vger.kernel.org,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Greg Marsden <greg.marsden@oracle.com>
Subject: [PATCH] tg3: Dont dump registers if interface not ready.
Date: Thu, 29 Sep 2011 10:10:59 +0800	[thread overview]
Message-ID: <4E83D3B3.7090508@oracle.com> (raw)

When bootup the server with BCM5704 Gigabit Ethernet get below warning:

tg3 0000:03:01.0: eth0: DMA Status error.  Resetting chip.
<Registers state of device>
tg3 0000:03:01.0: eth0: 0: Host status block [00000007:00000002:(0000:0000:0000):(0000:0000)]
tg3 0000:03:01.0: eth0: 0: NAPI info [00000001:00000002:(0000:0000:01ff):0000:(00c8:0000:0000:0000)]
tg3 0000:03:01.0: eth0: Link is up at 1000 Mbps, full duplex
tg3 0000:03:01.0: eth0: Flow control is on for TX and on for RX
tg3 0000:03:01.0: tg3_stop_block timed out, ofs=4800 enable_bit=2
tg3 0000:03:01.0: eth0: Link is down
tg3 0000:03:01.0: eth0: Link is up at 1000 Mbps, full duplex
tg3 0000:03:01.0: eth0: Flow control is on for TX and on for RX

If device not ready, then would not dump registers info.

Signed-off-by: Joe Jin <joe.jin@oracle.com>
Signed-off-by: Guru Anbalagane <guru.anbalagane@oracle.com>
Reported-by: Gurudas Pai <gurudas.pai@oracle.com>
Cc: Matt Carlson <mcarlson@broadcom.com>
Cc: Michael Chan <mchan@broadcom.com>
---
 drivers/net/tg3.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 4a1374d..d79d344 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -5475,10 +5475,15 @@ static void tg3_process_error(struct tg3 *tp)
 {
 	u32 val;
 	bool real_error = false;
+	bool dump = true;
 
 	if (tg3_flag(tp, ERROR_PROCESSED))
 		return;
 
+	/* If interface not ready then dont dump error */
+	if (!netif_carrier_ok(tp->dev))
+		dump = false;
+
 	/* Check Flow Attention register */
 	val = tr32(HOSTCC_FLOW_ATTN);
 	if (val & ~HOSTCC_FLOW_ATTN_MBUF_LWM) {
@@ -5492,14 +5497,16 @@ static void tg3_process_error(struct tg3 *tp)
 	}
 
 	if (tr32(RDMAC_STATUS) || tr32(WDMAC_STATUS)) {
-		netdev_err(tp->dev, "DMA Status error.  Resetting chip.\n");
+		if (dump)
+			netdev_err(tp->dev, "DMA Status error.  Resetting chip.\n");
 		real_error = true;
 	}
 
 	if (!real_error)
 		return;
 
-	tg3_dump_state(tp);
+	if (dump)
+		tg3_dump_state(tp);
 
 	tg3_flag_set(tp, ERROR_PROCESSED);
 	schedule_work(&tp->reset_task);
-- 
1.7.6.2

             reply	other threads:[~2011-09-29  2:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-29  2:10 Joe Jin [this message]
2011-09-29  6:50 ` [PATCH] tg3: Dont dump registers if interface not ready Xiao Jiang
2011-10-05  2:14   ` Matt Carlson
2011-10-08  3:21     ` Joe Jin
2011-10-17  9:52     ` Joe Jin
2012-03-22 13:17       ` Luis Henriques

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=4E83D3B3.7090508@oracle.com \
    --to=joe.jin@oracle.com \
    --cc=greg.marsden@oracle.com \
    --cc=guru.anbalagane@oracle.com \
    --cc=gurudas.pai@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcarlson@broadcom.com \
    --cc=mchan@broadcom.com \
    --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).