rpms/kernel/F-12 tg3-01-delay-mdio-bus-init-until-fw-finishes.patch, NONE, 1.1 tg3-02-fix-tso-test-against-wrong-flags-var.patch, NONE, 1.1 tg3-03-fix-57780-asic-rev-pcie-link-receiver-errors.patch, NONE, 1.1 tg3-04-prevent-tx-bd-corruption.patch, NONE, 1.1 tg3-05-assign-flags-to-fixes-in-start_xmit_dma_bug.patch, NONE, 1.1 tg3-06-fix-5906-transmit-hangs.patch, NONE, 1.1 kernel.spec, 1.1901, 1.1902

Chuck Ebbert cebbert at fedoraproject.org
Wed Nov 4 14:03:46 UTC 2009


Author: cebbert

Update of /cvs/pkgs/rpms/kernel/F-12
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv19484

Modified Files:
	kernel.spec 
Added Files:
	tg3-01-delay-mdio-bus-init-until-fw-finishes.patch 
	tg3-02-fix-tso-test-against-wrong-flags-var.patch 
	tg3-03-fix-57780-asic-rev-pcie-link-receiver-errors.patch 
	tg3-04-prevent-tx-bd-corruption.patch 
	tg3-05-assign-flags-to-fixes-in-start_xmit_dma_bug.patch 
	tg3-06-fix-5906-transmit-hangs.patch 
Log Message:
tg3 bug fixes (#527209)

tg3-01-delay-mdio-bus-init-until-fw-finishes.patch:
 tg3.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- NEW FILE tg3-01-delay-mdio-bus-init-until-fw-finishes.patch ---
From: Matt Carlson <mcarlson at broadcom.com>
Date: Fri, 28 Aug 2009 12:27:50 +0000 (+0000)
Subject: tg3: Delay mdio bus init until fw finishes
X-Git-Tag: v2.6.32-rc1~703^2~238
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=0a9140cff22e405fce1747a2e02d41851c36c55a

tg3: Delay mdio bus init until fw finishes

The device firmware uses the MDIO bus during early setup.  If the driver
modifies the MDIO bus configuration while it is in use by the firmware,
any number of bad things can happen.  This patch delays MDIO setup until
after the firmware posts its magic signature, signifying initialization
is complete.

Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
Signed-off-by: David S. Miller <davem at davemloft.net>
---

--- vanilla-2.6.31.orig/drivers/net/tg3.c
+++ vanilla-2.6.31/drivers/net/tg3.c
@@ -6288,14 +6288,14 @@ static int tg3_chip_reset(struct tg3 *tp
 		tw32_f(MAC_MODE, 0);
 	udelay(40);
 
-	tg3_mdio_start(tp);
-
 	tg3_ape_unlock(tp, TG3_APE_LOCK_GRC);
 
 	err = tg3_poll_fw(tp);
 	if (err)
 		return err;
 
+	tg3_mdio_start(tp);
+
 	if ((tp->tg3_flags2 & TG3_FLG2_PCI_EXPRESS) &&
 	    tp->pci_chip_rev_id != CHIPREV_ID_5750_A0) {
 		val = tr32(0x7c00);

tg3-02-fix-tso-test-against-wrong-flags-var.patch:
 tg3.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- NEW FILE tg3-02-fix-tso-test-against-wrong-flags-var.patch ---
From: Matt Carlson <mcarlson at broadcom.com>
Date: Tue, 25 Aug 2009 10:07:54 +0000 (+0000)
Subject: tg3: Fix TSO test against wrong flags var
X-Git-Tag: v2.6.32-rc1~703^2~302
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=29ea095fb727ac48228ff2d1af484c27bf1dcbd4

tg3: Fix TSO test against wrong flags var

Julia Lawall discovered that the TG3_FLG2_TSO_CAPABLE flag was being
compared against the wrong flags device member.  This patch implements
the fix.

Signed-off-by: Julia Lawall <julia at diku.dk>
Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
Reviewed-by: Michael Chan <mchan at broadcom.com>
Reviewed-by: Benjamin Li <benli at broadcom.com>
Signed-off-by: David S. Miller <davem at davemloft.net>
---

--- vanilla-2.6.31.orig/drivers/net/tg3.c
+++ vanilla-2.6.31/drivers/net/tg3.c
@@ -7164,7 +7164,7 @@ static int tg3_reset_hw(struct tg3 *tp, 
 	if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705 &&
 	     tp->pci_chip_rev_id != CHIPREV_ID_5705_A0) ||
 	    GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750) {
-		if ((tp->tg3_flags & TG3_FLG2_TSO_CAPABLE) &&
+		if ((tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE) &&
 		    (tp->pci_chip_rev_id == CHIPREV_ID_5705_A1 ||
 		     tp->pci_chip_rev_id == CHIPREV_ID_5705_A2)) {
 			/* nothing */

tg3-03-fix-57780-asic-rev-pcie-link-receiver-errors.patch:
 drivers/net/tg3.c                |    5 +++++
 vanilla-2.6.31/drivers/net/tg3.h |   13 +++++++++++--
 2 files changed, 16 insertions(+), 2 deletions(-)

--- NEW FILE tg3-03-fix-57780-asic-rev-pcie-link-receiver-errors.patch ---
From: Matt Carlson <mcarlson at broadcom.com>
Date: Tue, 25 Aug 2009 10:06:01 +0000 (+0000)
Subject: tg3: Fix 57780 asic rev PCIe link receiver errors
X-Git-Tag: v2.6.32-rc1~703^2~304
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=521e6b90dd3f0392062845d7ef13e6e41bb99d8a

tg3: Fix 57780 asic rev PCIe link receiver errors

[ <cebbert at redhat.com>: backport ]

This patch fixes some PCIe link receiver errors by decreasing the internal
electrical idle timeout.

Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
Reviewed-by: Michael Chan <mchan at broadcom.com>
Reviewed-by: Benjamin Li <benli at broadcom.com>
Signed-off-by: David S. Miller <davem at davemloft.net>
---

--- vanilla-2.6.31.orig/drivers/net/tg3.c
+++ vanilla-2.6.31/drivers/net/tg3.c
@@ -6719,6 +6719,11 @@ static int tg3_reset_hw(struct tg3 *tp, 
 		val |= PCIE_PWR_MGMT_EXT_ASPM_TMR_EN |
 		       PCIE_PWR_MGMT_L1_THRESH_4MS;
 		tw32(PCIE_PWR_MGMT_THRESH, val);
+
+		val = tr32(TG3_PCIE_EIDLE_DELAY) & ~TG3_PCIE_EIDLE_DELAY_MASK;
+		tw32(TG3_PCIE_EIDLE_DELAY, val | TG3_PCIE_EIDLE_DELAY_13_CLKS);
+
+		tw32(TG3_CORR_ERR_STAT, TG3_CORR_ERR_STAT_CLEAR);
 	}
 
 	/* This works around an issue with Athlon chipsets on
Index: vanilla-2.6.31/drivers/net/tg3.h
===================================================================
--- vanilla-2.6.31.orig/drivers/net/tg3.h
+++ vanilla-2.6.31/drivers/net/tg3.h
@@ -214,9 +214,11 @@
 #define  DUAL_MAC_CTRL_ID		 0x00000004
 #define TG3PCI_PRODID_ASICREV		0x000000bc
 #define  PROD_ID_ASIC_REV_MASK		 0x0fffffff
-/* 0xc0 --> 0x100 unused */
+/* 0xc0 --> 0x110 unused */
 
-/* 0x100 --> 0x200 unused */
+#define TG3_CORR_ERR_STAT		0x00000110
+#define  TG3_CORR_ERR_STAT_CLEAR	0xffffffff
+/* 0x114 --> 0x200 unused */
 
 /* Mailbox registers */
 #define MAILBOX_INTERRUPT_0		0x00000200 /* 64-bit */
@@ -1696,11 +1698,18 @@
 #define PCIE_TRANSACTION_CFG		0x00007c04
 #define PCIE_TRANS_CFG_1SHOT_MSI	 0x20000000
 #define PCIE_TRANS_CFG_LOM		 0x00000020
+/* 0x7c08 --> 0x7d28 unused */
 
 #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
+/* 0x7d2c --> 0x7e70 unused */
+
+#define TG3_PCIE_EIDLE_DELAY		0x00007e70
+#define  TG3_PCIE_EIDLE_DELAY_MASK	 0x0000001f
+#define  TG3_PCIE_EIDLE_DELAY_13_CLKS	 0x0000000c
+/* 0x7e74 --> 0x8000 unused */
 
 
 /* OTP bit definitions */

tg3-04-prevent-tx-bd-corruption.patch:
 drivers/net/tg3.c                |   28 ++++++++++++++++++++++++++++
 vanilla-2.6.31/drivers/net/tg3.h |    9 ++++++++-
 2 files changed, 36 insertions(+), 1 deletion(-)

--- NEW FILE tg3-04-prevent-tx-bd-corruption.patch ---
From: Matt Carlson <mcarlson at broadcom.com>
Date: Tue, 25 Aug 2009 10:07:27 +0000 (+0000)
Subject: tg3: Prevent tx BD corruption
X-Git-Tag: v2.6.32-rc1~703^2~303
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=255ca311b650caece3ec4f78b88ef298664d561f

tg3: Prevent tx BD corruption

[ <cebbert at redhat.com>: backport ]

This patch prevents a tx BD corruption bug by preventing the device from
powering down the PLL from L1 if the link speed is 10Mbps or 100Mbps.

The same bits are also used to prevent a system hang during chip reset
resulting from a complicated set of events that ultimately leads to
PCIe block register corruption.

Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
Reviewed-by: Michael Chan <mchan at broadcom.com>
Reviewed-by: Benjamin Li <benli at broadcom.com>
Signed-off-by: David S. Miller <davem at davemloft.net>
---

--- vanilla-2.6.31.orig/drivers/net/tg3.c
+++ vanilla-2.6.31/drivers/net/tg3.c
@@ -3167,6 +3167,15 @@ relink:
 			pci_write_config_word(tp->pdev,
 					      tp->pcie_cap + PCI_EXP_LNKCTL,
 					      newlnkctl);
+	} else if (tp->tg3_flags3 & TG3_FLG3_TOGGLE_10_100_L1PLLPD) {
+		u32 newreg, oldreg = tr32(TG3_PCIE_LNKCTL);
+		if (tp->link_config.active_speed == SPEED_100 ||
+		    tp->link_config.active_speed == SPEED_10)
+			newreg = oldreg & ~TG3_PCIE_LNKCTL_L1_PLL_PD_EN;
+		else
+			newreg = oldreg | TG3_PCIE_LNKCTL_L1_PLL_PD_EN;
+		if (newreg != oldreg)
+			tw32(TG3_PCIE_LNKCTL, newreg);
 	}
 
 	if (current_link_up != netif_carrier_ok(tp->dev)) {
@@ -6160,6 +6169,11 @@ static int tg3_chip_reset(struct tg3 *tp
 	smp_mb();
 	synchronize_irq(tp->pdev->irq);
 
+	if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780) {
+		val = tr32(TG3_PCIE_LNKCTL) & ~TG3_PCIE_LNKCTL_L1_PLL_PD_EN;
+		tw32(TG3_PCIE_LNKCTL, val | TG3_PCIE_LNKCTL_L1_PLL_PD_DIS);
+	}
+
 	/* do the reset */
 	val = GRC_MISC_CFG_CORECLK_RESET;
 
@@ -6726,6 +6740,15 @@ static int tg3_reset_hw(struct tg3 *tp, 
 		tw32(TG3_CORR_ERR_STAT, TG3_CORR_ERR_STAT_CLEAR);
 	}
 
+	if (tp->tg3_flags3 & TG3_FLG3_TOGGLE_10_100_L1PLLPD) {
+		val = tr32(TG3_PCIE_LNKCTL);
+		if (tp->tg3_flags3 & TG3_FLG3_CLKREQ_BUG)
+			val |= TG3_PCIE_LNKCTL_L1_PLL_PD_DIS;
+		else
+			val &= ~TG3_PCIE_LNKCTL_L1_PLL_PD_DIS;
+		tw32(TG3_PCIE_LNKCTL, 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
@@ -12274,6 +12297,11 @@ static int __devinit tg3_get_invariants(
 	    GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780)
 		tp->tg3_flags3 |= TG3_FLG3_USE_PHYLIB;
 
+	if ((tp->pci_chip_rev_id == CHIPREV_ID_57780_A1 &&
+	     tr32(RCVLPC_STATS_ENABLE) & RCVLPC_STATSENAB_ASF_FIX) ||
+	    tp->pci_chip_rev_id == CHIPREV_ID_57780_A0)
+		tp->tg3_flags3 |= TG3_FLG3_TOGGLE_10_100_L1PLLPD;
+
 	err = tg3_mdio_init(tp);
 	if (err)
 		return err;
Index: vanilla-2.6.31/drivers/net/tg3.h
===================================================================
--- vanilla-2.6.31.orig/drivers/net/tg3.h
+++ vanilla-2.6.31/drivers/net/tg3.h
@@ -866,6 +866,7 @@
 #define  RCVLPC_STATSCTRL_ENABLE	 0x00000001
 #define  RCVLPC_STATSCTRL_FASTUPD	 0x00000002
 #define RCVLPC_STATS_ENABLE		0x00002018
+#define  RCVLPC_STATSENAB_ASF_FIX	 0x00000002
 #define  RCVLPC_STATSENAB_DACK_FIX	 0x00040000
 #define  RCVLPC_STATSENAB_LNGBRST_RFIX	 0x00400000
 #define RCVLPC_STATS_INCMASK		0x0000201c
@@ -1704,7 +1705,12 @@
 #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
-/* 0x7d2c --> 0x7e70 unused */
+/* 0x7d2c --> 0x7d54 unused */
+
+#define TG3_PCIE_LNKCTL			0x00007d54
+#define  TG3_PCIE_LNKCTL_L1_PLL_PD_EN	 0x00000008
+#define  TG3_PCIE_LNKCTL_L1_PLL_PD_DIS	 0x00000080
+/* 0x7d58 --> 0x7e70 unused */
 
 #define TG3_PCIE_EIDLE_DELAY		0x00007e70
 #define  TG3_PCIE_EIDLE_DELAY_MASK	 0x0000001f
@@ -2650,6 +2656,7 @@ struct tg3 {
 #define TG3_FLG3_PHY_ENABLE_APD		0x00001000
 #define TG3_FLG3_5755_PLUS		0x00002000
 #define TG3_FLG3_NO_NVRAM		0x00004000
+#define TG3_FLG3_TOGGLE_10_100_L1PLLPD	0x00008000
 
 	struct timer_list		timer;
 	u16				timer_counter;

tg3-05-assign-flags-to-fixes-in-start_xmit_dma_bug.patch:
 drivers/net/tg3.c                |   24 +++++++++++++++++++-----
 vanilla-2.6.31/drivers/net/tg3.h |    2 ++
 2 files changed, 21 insertions(+), 5 deletions(-)

--- NEW FILE tg3-05-assign-flags-to-fixes-in-start_xmit_dma_bug.patch ---
>From 9e27c74f7fd6255fdbbc14ed04bb746bfa611d5a Mon Sep 17 00:00:00 2001
From: mcarlson <mcarlson at ravage.broadcom.net>
Date: Fri, 30 Oct 2009 16:49:47 -0700
Subject: [PATCH 18/19] tg3: Assign flags to fixes in start_xmit_dma_bug

[ <cebbert at redhat.com>: backport ]

This patch adds a flag for each bug workaround in
tg3_start_xmit_dma_bug().  This is prep work for the following patch.

Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
---
 drivers/net/tg3.c |   26 +++++++++++++++++++-------
 drivers/net/tg3.h |    2 ++
 2 files changed, 21 insertions(+), 7 deletions(-)

--- vanilla-2.6.31.orig/drivers/net/tg3.c
+++ vanilla-2.6.31/drivers/net/tg3.c
@@ -5035,7 +5035,8 @@ static int tigon3_dma_hwbug_workaround(s
 		/* Make sure new skb does not cross any 4G boundaries.
 		 * Drop the packet if it does.
 		 */
-		if (ret || tg3_4g_overflow_test(new_addr, new_skb->len)) {
+		if (ret || ((tp->tg3_flags3 & TG3_FLG3_4G_DMA_BNDRY_BUG) &&
+			    tg3_4g_overflow_test(new_addr, new_skb->len))) {
 			if (!ret)
 				skb_dma_unmap(&tp->pdev->dev, new_skb,
 					      DMA_TO_DEVICE);
@@ -5346,9 +5347,15 @@ static int tg3_start_xmit_dma_bug(struct
 
 	would_hit_hwbug = 0;
 
-	if (tp->tg3_flags3 & TG3_FLG3_5701_DMA_BUG)
+	if ((tp->tg3_flags3 & TG3_FLG3_4G_DMA_BNDRY_BUG) &&
+	    tg3_4g_overflow_test(mapping, len))
 		would_hit_hwbug = 1;
-	else if (tg3_4g_overflow_test(mapping, len))
+
+	if ((tp->tg3_flags3 & TG3_FLG3_40BIT_DMA_LIMIT_BUG) &&
+	    tg3_40bit_overflow_test(tp, mapping, len))
+		would_hit_hwbug = 1;
+
+	if (tp->tg3_flags3 & TG3_FLG3_5701_DMA_BUG)
 		would_hit_hwbug = 1;
 
 	tg3_set_txd(tp, entry, mapping, len, base_flags,
@@ -5369,10 +5376,12 @@ static int tg3_start_xmit_dma_bug(struct
 
 			tp->tx_buffers[entry].skb = NULL;
 
-			if (tg3_4g_overflow_test(mapping, len))
+			if ((tp->tg3_flags3 & TG3_FLG3_4G_DMA_BNDRY_BUG) &&
+			    tg3_4g_overflow_test(mapping, len))
 				would_hit_hwbug = 1;
 
-			if (tg3_40bit_overflow_test(tp, mapping, len))
+			if ((tp->tg3_flags3 & TG3_FLG3_40BIT_DMA_LIMIT_BUG) &&
+			    tg3_40bit_overflow_test(tp, mapping, len))
 				would_hit_hwbug = 1;
 
 			if (tp->tg3_flags2 & TG3_FLG2_HW_TSO)
@@ -11993,6 +12002,11 @@ static int __devinit tg3_get_invariants(
 		}
 	}
 
+	if (!(tp->tg3_flags3 & TG3_FLG3_5755_PLUS)) {
+		tp->tg3_flags3 |= TG3_FLG3_4G_DMA_BNDRY_BUG;
+		tp->tg3_flags3 |= TG3_FLG3_40BIT_DMA_LIMIT_BUG;
+	}
+
 	if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS) ||
 	     (tp->tg3_flags2 & TG3_FLG2_5780_CLASS))
 		tp->tg3_flags2 |= TG3_FLG2_JUMBO_CAPABLE;
Index: vanilla-2.6.31/drivers/net/tg3.h
===================================================================
--- vanilla-2.6.31.orig/drivers/net/tg3.h
+++ vanilla-2.6.31/drivers/net/tg3.h
@@ -2657,6 +2657,8 @@ struct tg3 {
 #define TG3_FLG3_5755_PLUS		0x00002000
 #define TG3_FLG3_NO_NVRAM		0x00004000
 #define TG3_FLG3_TOGGLE_10_100_L1PLLPD	0x00008000
+#define TG3_FLG3_4G_DMA_BNDRY_BUG	0x00080000
+#define TG3_FLG3_40BIT_DMA_LIMIT_BUG	0x00100000
 
 	struct timer_list		timer;
 	u16				timer_counter;

tg3-06-fix-5906-transmit-hangs.patch:
 tg3.c |   26 +++++++++++++++++++-------
 tg3.h |    1 +
 2 files changed, 20 insertions(+), 7 deletions(-)

--- NEW FILE tg3-06-fix-5906-transmit-hangs.patch ---
>From e3f615b5c13f98f9ad267c690e12c4e1f1928433 Mon Sep 17 00:00:00 2001
From: mcarlson <mcarlson at ravage.broadcom.net>
Date: Fri, 30 Oct 2009 16:50:11 -0700
Subject: [PATCH 19/19] tg3: Fix 5906 transmit hangs

[ <cebbert at redhat.com>: fix logic at line 12003 ]

The 5906 has trouble with fragments that are less than 8 bytes in size.
This patch works around the problem by pivoting the 5906's transmit
routine to tg3_start_xmit_dma_bug() and introducing a new SHORT_DMA_BUG
flag that enables code to detect and react to the problematic condition.

[ cebbert: fix logic at line 12003 ]

Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
---
 drivers/net/tg3.c |   21 +++++++++++++++------
 drivers/net/tg3.h |    1 +
 2 files changed, 16 insertions(+), 6 deletions(-)

Index: vanilla-2.6.31/drivers/net/tg3.c
===================================================================
--- vanilla-2.6.31.orig/drivers/net/tg3.c
+++ vanilla-2.6.31/drivers/net/tg3.c
@@ -5280,7 +5280,7 @@ static int tg3_start_xmit_dma_bug(struct
 	mss = 0;
 	if ((mss = skb_shinfo(skb)->gso_size) != 0) {
 		struct iphdr *iph;
-		int tcp_opt_len, ip_tcp_len, hdr_len;
+		u32 tcp_opt_len, ip_tcp_len, hdr_len;
 
 		if (skb_header_cloned(skb) &&
 		    pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) {
@@ -5311,8 +5311,10 @@ static int tg3_start_xmit_dma_bug(struct
 								 IPPROTO_TCP,
 								 0);
 
-		if ((tp->tg3_flags2 & TG3_FLG2_HW_TSO) ||
-		    (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705)) {
+		if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906)
+			mss |= hdr_len << 9;
+		else if ((tp->tg3_flags2 & TG3_FLG2_HW_TSO) ||
+			 GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705) {
 			if (tcp_opt_len || iph->ihl > 5) {
 				int tsflags;
 
@@ -5347,6 +5349,9 @@ static int tg3_start_xmit_dma_bug(struct
 
 	would_hit_hwbug = 0;
 
+	if ((tp->tg3_flags3 & TG3_FLG3_SHORT_DMA_BUG) && len <= 8)
+		would_hit_hwbug = 1;
+
 	if ((tp->tg3_flags3 & TG3_FLG3_4G_DMA_BNDRY_BUG) &&
 	    tg3_4g_overflow_test(mapping, len))
 		would_hit_hwbug = 1;
@@ -5376,6 +5381,10 @@ static int tg3_start_xmit_dma_bug(struct
 
 			tp->tx_buffers[entry].skb = NULL;
 
+			if ((tp->tg3_flags3 & TG3_FLG3_SHORT_DMA_BUG) &&
+			    len <= 8)
+				would_hit_hwbug = 1;
+
 			if ((tp->tg3_flags3 & TG3_FLG3_4G_DMA_BNDRY_BUG) &&
 			    tg3_4g_overflow_test(mapping, len))
 				would_hit_hwbug = 1;
@@ -12003,8 +12012,12 @@ static int __devinit tg3_get_invariants(
 	}
 
 	if (!(tp->tg3_flags3 & TG3_FLG3_5755_PLUS)) {
-		tp->tg3_flags3 |= TG3_FLG3_4G_DMA_BNDRY_BUG;
-		tp->tg3_flags3 |= TG3_FLG3_40BIT_DMA_LIMIT_BUG;
+		if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906)
+			tp->tg3_flags3 |= TG3_FLG3_SHORT_DMA_BUG;
+		else {
+			tp->tg3_flags3 |= TG3_FLG3_4G_DMA_BNDRY_BUG;
+			tp->tg3_flags3 |= TG3_FLG3_40BIT_DMA_LIMIT_BUG;
+		}
 	}
 
 	if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS) ||
@@ -13313,8 +13326,7 @@ static int __devinit tg3_init_one(struct
 		goto err_out_iounmap;
 	}
 
-	if ((tp->tg3_flags3 & TG3_FLG3_5755_PLUS) ||
-	    GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906)
+	if (tp->tg3_flags3 & TG3_FLG3_5755_PLUS)
 		dev->netdev_ops = &tg3_netdev_ops;
 	else
 		dev->netdev_ops = &tg3_netdev_ops_dma_bug;
Index: vanilla-2.6.31/drivers/net/tg3.h
===================================================================
--- vanilla-2.6.31.orig/drivers/net/tg3.h
+++ vanilla-2.6.31/drivers/net/tg3.h
@@ -2659,6 +2659,7 @@ struct tg3 {
 #define TG3_FLG3_TOGGLE_10_100_L1PLLPD	0x00008000
 #define TG3_FLG3_4G_DMA_BNDRY_BUG	0x00080000
 #define TG3_FLG3_40BIT_DMA_LIMIT_BUG	0x00100000
+#define TG3_FLG3_SHORT_DMA_BUG		0x00200000
 
 	struct timer_list		timer;
 	u16				timer_counter;


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-12/kernel.spec,v
retrieving revision 1.1901
retrieving revision 1.1902
diff -u -p -r1.1901 -r1.1902
--- kernel.spec	4 Nov 2009 04:12:48 -0000	1.1901
+++ kernel.spec	4 Nov 2009 14:03:45 -0000	1.1902
@@ -777,13 +777,20 @@ Patch14411: netlink-fix-typo-in-initiali
 Patch14420: perf-events-fix-swevent-hrtimer-sampling.patch
 Patch14421: perf-events-dont-generate-events-for-the-idle-task.patch
 
-# Fix oops in padlock
 Patch14430: crypto-via-padlock-fix-nano-aes.patch
 
 # fs/pipe.c: null ptr dereference fix
 # rhbz#530490 (CVE-2009-3547) [ad3960243e55320d74195fb85c975e0a8cc4466c]
 Patch14440: fs-pipe-null-ptr-deref-fix.patch
 
+# tg3 fixes (#527209)
+Patch14451: tg3-01-delay-mdio-bus-init-until-fw-finishes.patch
+Patch14452: tg3-02-fix-tso-test-against-wrong-flags-var.patch
+Patch14453: tg3-03-fix-57780-asic-rev-pcie-link-receiver-errors.patch
+Patch14454: tg3-04-prevent-tx-bd-corruption.patch
+Patch14455: tg3-05-assign-flags-to-fixes-in-start_xmit_dma_bug.patch
+Patch14456: tg3-06-fix-5906-transmit-hangs.patch
+
 %endif
 
 BuildRoot: %{_tmppath}/kernel-%{KVERREL}-root
@@ -1470,6 +1477,14 @@ ApplyPatch crypto-via-padlock-fix-nano-a
 # rhbz#530490 (CVE-2009-3547) [ad3960243e55320d74195fb85c975e0a8cc4466c]
 ApplyPatch fs-pipe-null-ptr-deref-fix.patch
 
+# tg3 fixes (#527209)
+ApplyPatch tg3-01-delay-mdio-bus-init-until-fw-finishes.patch
+ApplyPatch tg3-02-fix-tso-test-against-wrong-flags-var.patch
+ApplyPatch tg3-03-fix-57780-asic-rev-pcie-link-receiver-errors.patch
+ApplyPatch tg3-04-prevent-tx-bd-corruption.patch
+ApplyPatch tg3-05-assign-flags-to-fixes-in-start_xmit_dma_bug.patch
+ApplyPatch tg3-06-fix-5906-transmit-hangs.patch
+
 # END OF PATCH APPLICATIONS
 
 %endif
@@ -2122,6 +2137,9 @@ fi
 # and build.
 
 %changelog
+* Wed Nov 04 2009 Chuck Ebbert <cebbert at redhat.com> 2.6.31.5-116
+- tg3 bug fixes (#527209)
+
 * Wed Nov 04 2009 Kyle McMartin <kyle at redhat.com> 2.6.31.5-115
 - fs/pipe.c: fix null pointer dereference (CVE-2009-3547)
 




More information about the scm-commits mailing list