* [gentoo-commits] linux-patches r1661 - genpatches-2.6/trunk/2.6.32
@ 2010-02-01 17:45 Mike Pagano (mpagano)
0 siblings, 0 replies; only message in thread
From: Mike Pagano (mpagano) @ 2010-02-01 17:45 UTC (permalink / raw
To: gentoo-commits
Author: mpagano
Date: 2010-02-01 17:45:09 +0000 (Mon, 01 Feb 2010)
New Revision: 1661
Added:
genpatches-2.6/trunk/2.6.32/2400_5906-transmit-hang-fix.patch
Modified:
genpatches-2.6/trunk/2.6.32/0000_README
Log:
Patch to Broadcom ethernet adapter 5906 to fix transmit hangs.
Modified: genpatches-2.6/trunk/2.6.32/0000_README
===================================================================
--- genpatches-2.6/trunk/2.6.32/0000_README 2010-01-29 01:31:56 UTC (rev 1660)
+++ genpatches-2.6/trunk/2.6.32/0000_README 2010-02-01 17:45:09 UTC (rev 1661)
@@ -75,6 +75,10 @@
From: http://bugs.gentoo.org/show_bug.cgi?id=296915
Desc: Use sector size for EFI GPT
+Patch: 2400_5906-transmit-hang-fix.patch
+From: http://bugs.gentoo.org/show_bug.cgi?id=301091
+Desc: tg3: Fix 5906 transmit hangs
+
Patch: 4100_dm-bbr.patch
From: EVMS 2.5.2
Desc: Bad block relocation support for LiveCD users
Added: genpatches-2.6/trunk/2.6.32/2400_5906-transmit-hang-fix.patch
===================================================================
--- genpatches-2.6/trunk/2.6.32/2400_5906-transmit-hang-fix.patch (rev 0)
+++ genpatches-2.6/trunk/2.6.32/2400_5906-transmit-hang-fix.patch 2010-02-01 17:45:09 UTC (rev 1661)
@@ -0,0 +1,105 @@
+tg3: Fix 5906 transmit hangs
+
+This is a backport of commit 92c6b8d16a36df3f28b2537bed2a56491fb08f11 to kernel version 2.6.32. The gentoo bug report can be found at https://bugs.gentoo.org/show_bug.cgi?id=301091. The original description is as follows:
+
+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.
+
+Signed-off-by: Mike Pagano <mpagano@gentoo.org>
+---
+
+--- a/drivers/net/tg3.c 2010-01-30 15:59:44.000000000 -0500
++++ b/drivers/net/tg3.c 2010-01-30 16:12:26.000000000 -0500
+@@ -5392,7 +5392,7 @@ static netdev_tx_t tg3_start_xmit_dma_bu
+ 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)) {
+@@ -5423,8 +5423,10 @@ static netdev_tx_t tg3_start_xmit_dma_bu
+ IPPROTO_TCP,
+ 0);
+
+- if ((tp->tg3_flags2 & TG3_FLG2_HW_TSO) ||
+- (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705)) {
++ if (tp->tg3_flags2 & TG3_FLG2_HW_TSO_2)
++ mss |= hdr_len << 9;
++ else if ((tp->tg3_flags2 & TG3_FLG2_HW_TSO_1) ||
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705) {
+ if (tcp_opt_len || iph->ihl > 5) {
+ int tsflags;
+
+@@ -5459,6 +5461,9 @@ static netdev_tx_t tg3_start_xmit_dma_bu
+
+ 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_5701_DMA_BUG)
+ would_hit_hwbug = 1;
+ else if (tg3_4g_overflow_test(mapping, len))
+@@ -5482,6 +5487,11 @@ static netdev_tx_t tg3_start_xmit_dma_bu
+
+ tnapi->tx_buffers[entry].skb = NULL;
+
++
++ if ((tp->tg3_flags3 & TG3_FLG3_SHORT_DMA_BUG) &&
++ len <= 8)
++ would_hit_hwbug = 1;
++
+ if (tg3_4g_overflow_test(mapping, len))
+ would_hit_hwbug = 1;
+
+@@ -12595,16 +12605,15 @@ static int __devinit tg3_get_invariants(
+ tp->pdev_peer == tp->pdev))
+ tp->tg3_flags &= ~TG3_FLAG_SUPPORT_MSI;
+
+- if ((tp->tg3_flags3 & TG3_FLG3_5755_PLUS) ||
+- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) {
+- tp->tg3_flags2 |= TG3_FLG2_HW_TSO_2;
+- tp->tg3_flags2 |= TG3_FLG2_1SHOT_MSI;
+- } else {
+- tp->tg3_flags2 |= TG3_FLG2_HW_TSO_1 | TG3_FLG2_TSO_BUG;
+- if (GET_ASIC_REV(tp->pci_chip_rev_id) ==
+- ASIC_REV_5750 &&
+- tp->pci_chip_rev_id >= CHIPREV_ID_5750_C2)
+- tp->tg3_flags2 &= ~TG3_FLG2_TSO_BUG;
++ 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;
++ }
+ }
+ }
+
+@@ -13975,8 +13984,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;
+--- a/drivers/net/tg3.h 2010-01-30 15:59:47.000000000 -0500
++++ b/drivers/net/tg3.h 2010-01-31 14:02:59.000000000 -0500
+@@ -2759,6 +2759,9 @@ struct tg3 {
+ #define TG3_FLG3_TOGGLE_10_100_L1PLLPD 0x00008000
+ #define TG3_FLG3_PHY_IS_FET 0x00010000
+ #define TG3_FLG3_ENABLE_RSS 0x00020000
++#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;
+
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2010-02-01 17:45 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-01 17:45 [gentoo-commits] linux-patches r1661 - genpatches-2.6/trunk/2.6.32 Mike Pagano (mpagano)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox