netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 4/8] tg3: Prevent send BD corruption
@ 2009-04-20 16:57 Matt Carlson
  2009-04-21  8:42 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Matt Carlson @ 2009-04-20 16:57 UTC (permalink / raw)
  To: davem; +Cc: netdev, Michael Chan, Benjamin Li, andy

On rare occasions, send BD corruptions can occur.  This patch
fixes the problem by increasing the L1 entry threshold to 4
milliseconds.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
 drivers/net/tg3.c |    7 +++++++
 drivers/net/tg3.h |    2 ++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 9b04954..ed7a86d 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -6717,6 +6717,13 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
 		tw32(TG3_CPMU_HST_ACC, val);
 	}
 
+	if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780) {
+		val = tr32(PCIE_PWR_MGMT_THRESH) & ~PCIE_PWR_MGMT_L1_THRESH_MSK;
+		val |= PCIE_PWR_MGMT_EXT_ASPM_TMR_EN |
+		       PCIE_PWR_MGMT_L1_THRESH_4MS;
+		tw32(PCIE_PWR_MGMT_THRESH, val);
+	}
+
 	/* This works around an issue with Athlon chipsets on
 	 * B3 tigon3 silicon.  This bit has no effect on any
 	 * other revision.  But do not set this on PCI Express
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index afbabf2..f1016cb 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -1697,6 +1697,8 @@
 
 #define PCIE_PWR_MGMT_THRESH		0x00007d28
 #define PCIE_PWR_MGMT_L1_THRESH_MSK	 0x0000ff00
+#define PCIE_PWR_MGMT_L1_THRESH_4MS	 0x0000ff00
+#define PCIE_PWR_MGMT_EXT_ASPM_TMR_EN	 0x01000000
 
 
 /* OTP bit definitions */
-- 
1.6.0.6



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 4/8] tg3: Prevent send BD corruption
  2009-04-20 16:57 [PATCH 4/8] tg3: Prevent send BD corruption Matt Carlson
@ 2009-04-21  8:42 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2009-04-21  8:42 UTC (permalink / raw)
  To: mcarlson; +Cc: netdev, mchan, benli, andy

From: "Matt Carlson" <mcarlson@broadcom.com>
Date: Mon, 20 Apr 2009 09:57:41 -0700

> On rare occasions, send BD corruptions can occur.  This patch
> fixes the problem by increasing the L1 entry threshold to 4
> milliseconds.
> 
> Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
> Signed-off-by: Michael Chan <mchan@broadcom.com>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-04-21  8:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-20 16:57 [PATCH 4/8] tg3: Prevent send BD corruption Matt Carlson
2009-04-21  8:42 ` David Miller

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).