From: fjin Date: Tue, 27 Sep 2011 06:55:34 +0000 (+0800) Subject: tg3: Dont dump DMA error when interface not ready. X-Git-Tag: v2.6.39-400.9.0~884 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=3454db575e0480bcc97e998710dfc73da02ed4dc;p=users%2Fjedix%2Flinux-maple.git tg3: Dont dump DMA error when interface not ready. This fixes orabug 12981473. When do testing with BCM5704 Gigabit Ethernet, bootup get below warning: tg3 0000:03:01.0: eth0: DMA Status error. Resetting chip. 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 We need not to check the status and dump registers status if the device not ready, Signed-off-by: Joe Jin Reported-by: Gurudas Pai --- diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index a1f9f9eef37d3..c0d6bf4a1f69a 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c @@ -5300,10 +5300,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) { @@ -5317,14 +5322,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);