1 |
Author: mpagano |
2 |
Date: 2010-02-01 17:45:09 +0000 (Mon, 01 Feb 2010) |
3 |
New Revision: 1661 |
4 |
|
5 |
Added: |
6 |
genpatches-2.6/trunk/2.6.32/2400_5906-transmit-hang-fix.patch |
7 |
Modified: |
8 |
genpatches-2.6/trunk/2.6.32/0000_README |
9 |
Log: |
10 |
Patch to Broadcom ethernet adapter 5906 to fix transmit hangs. |
11 |
|
12 |
Modified: genpatches-2.6/trunk/2.6.32/0000_README |
13 |
=================================================================== |
14 |
--- genpatches-2.6/trunk/2.6.32/0000_README 2010-01-29 01:31:56 UTC (rev 1660) |
15 |
+++ genpatches-2.6/trunk/2.6.32/0000_README 2010-02-01 17:45:09 UTC (rev 1661) |
16 |
@@ -75,6 +75,10 @@ |
17 |
From: http://bugs.gentoo.org/show_bug.cgi?id=296915 |
18 |
Desc: Use sector size for EFI GPT |
19 |
|
20 |
+Patch: 2400_5906-transmit-hang-fix.patch |
21 |
+From: http://bugs.gentoo.org/show_bug.cgi?id=301091 |
22 |
+Desc: tg3: Fix 5906 transmit hangs |
23 |
+ |
24 |
Patch: 4100_dm-bbr.patch |
25 |
From: EVMS 2.5.2 |
26 |
Desc: Bad block relocation support for LiveCD users |
27 |
|
28 |
Added: genpatches-2.6/trunk/2.6.32/2400_5906-transmit-hang-fix.patch |
29 |
=================================================================== |
30 |
--- genpatches-2.6/trunk/2.6.32/2400_5906-transmit-hang-fix.patch (rev 0) |
31 |
+++ genpatches-2.6/trunk/2.6.32/2400_5906-transmit-hang-fix.patch 2010-02-01 17:45:09 UTC (rev 1661) |
32 |
@@ -0,0 +1,105 @@ |
33 |
+tg3: Fix 5906 transmit hangs |
34 |
+ |
35 |
+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: |
36 |
+ |
37 |
+The 5906 has trouble with fragments that are less than 8 bytes in size. |
38 |
+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. |
39 |
+ |
40 |
+Signed-off-by: Mike Pagano <mpagano@g.o> |
41 |
+--- |
42 |
+ |
43 |
+--- a/drivers/net/tg3.c 2010-01-30 15:59:44.000000000 -0500 |
44 |
++++ b/drivers/net/tg3.c 2010-01-30 16:12:26.000000000 -0500 |
45 |
+@@ -5392,7 +5392,7 @@ static netdev_tx_t tg3_start_xmit_dma_bu |
46 |
+ mss = 0; |
47 |
+ if ((mss = skb_shinfo(skb)->gso_size) != 0) { |
48 |
+ struct iphdr *iph; |
49 |
+- int tcp_opt_len, ip_tcp_len, hdr_len; |
50 |
++ u32 tcp_opt_len, ip_tcp_len, hdr_len; |
51 |
+ |
52 |
+ if (skb_header_cloned(skb) && |
53 |
+ pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) { |
54 |
+@@ -5423,8 +5423,10 @@ static netdev_tx_t tg3_start_xmit_dma_bu |
55 |
+ IPPROTO_TCP, |
56 |
+ 0); |
57 |
+ |
58 |
+- if ((tp->tg3_flags2 & TG3_FLG2_HW_TSO) || |
59 |
+- (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705)) { |
60 |
++ if (tp->tg3_flags2 & TG3_FLG2_HW_TSO_2) |
61 |
++ mss |= hdr_len << 9; |
62 |
++ else if ((tp->tg3_flags2 & TG3_FLG2_HW_TSO_1) || |
63 |
++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705) { |
64 |
+ if (tcp_opt_len || iph->ihl > 5) { |
65 |
+ int tsflags; |
66 |
+ |
67 |
+@@ -5459,6 +5461,9 @@ static netdev_tx_t tg3_start_xmit_dma_bu |
68 |
+ |
69 |
+ would_hit_hwbug = 0; |
70 |
+ |
71 |
++ if ((tp->tg3_flags3 & TG3_FLG3_SHORT_DMA_BUG) && len <= 8) |
72 |
++ would_hit_hwbug = 1; |
73 |
++ |
74 |
+ if (tp->tg3_flags3 & TG3_FLG3_5701_DMA_BUG) |
75 |
+ would_hit_hwbug = 1; |
76 |
+ else if (tg3_4g_overflow_test(mapping, len)) |
77 |
+@@ -5482,6 +5487,11 @@ static netdev_tx_t tg3_start_xmit_dma_bu |
78 |
+ |
79 |
+ tnapi->tx_buffers[entry].skb = NULL; |
80 |
+ |
81 |
++ |
82 |
++ if ((tp->tg3_flags3 & TG3_FLG3_SHORT_DMA_BUG) && |
83 |
++ len <= 8) |
84 |
++ would_hit_hwbug = 1; |
85 |
++ |
86 |
+ if (tg3_4g_overflow_test(mapping, len)) |
87 |
+ would_hit_hwbug = 1; |
88 |
+ |
89 |
+@@ -12595,16 +12605,15 @@ static int __devinit tg3_get_invariants( |
90 |
+ tp->pdev_peer == tp->pdev)) |
91 |
+ tp->tg3_flags &= ~TG3_FLAG_SUPPORT_MSI; |
92 |
+ |
93 |
+- if ((tp->tg3_flags3 & TG3_FLG3_5755_PLUS) || |
94 |
+- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) { |
95 |
+- tp->tg3_flags2 |= TG3_FLG2_HW_TSO_2; |
96 |
+- tp->tg3_flags2 |= TG3_FLG2_1SHOT_MSI; |
97 |
+- } else { |
98 |
+- tp->tg3_flags2 |= TG3_FLG2_HW_TSO_1 | TG3_FLG2_TSO_BUG; |
99 |
+- if (GET_ASIC_REV(tp->pci_chip_rev_id) == |
100 |
+- ASIC_REV_5750 && |
101 |
+- tp->pci_chip_rev_id >= CHIPREV_ID_5750_C2) |
102 |
+- tp->tg3_flags2 &= ~TG3_FLG2_TSO_BUG; |
103 |
++ if (!(tp->tg3_flags3 & TG3_FLG3_5755_PLUS)) { |
104 |
++ tp->tg3_flags3 |= TG3_FLG3_4G_DMA_BNDRY_BUG; |
105 |
++ tp->tg3_flags3 |= TG3_FLG3_40BIT_DMA_LIMIT_BUG; |
106 |
++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) |
107 |
++ tp->tg3_flags3 |= TG3_FLG3_SHORT_DMA_BUG; |
108 |
++ else { |
109 |
++ tp->tg3_flags3 |= TG3_FLG3_4G_DMA_BNDRY_BUG; |
110 |
++ tp->tg3_flags3 |= TG3_FLG3_40BIT_DMA_LIMIT_BUG; |
111 |
++ } |
112 |
+ } |
113 |
+ } |
114 |
+ |
115 |
+@@ -13975,8 +13984,7 @@ static int __devinit tg3_init_one(struct |
116 |
+ goto err_out_iounmap; |
117 |
+ } |
118 |
+ |
119 |
+- if ((tp->tg3_flags3 & TG3_FLG3_5755_PLUS) || |
120 |
+- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) |
121 |
++ if (tp->tg3_flags3 & TG3_FLG3_5755_PLUS) |
122 |
+ dev->netdev_ops = &tg3_netdev_ops; |
123 |
+ else |
124 |
+ dev->netdev_ops = &tg3_netdev_ops_dma_bug; |
125 |
+--- a/drivers/net/tg3.h 2010-01-30 15:59:47.000000000 -0500 |
126 |
++++ b/drivers/net/tg3.h 2010-01-31 14:02:59.000000000 -0500 |
127 |
+@@ -2759,6 +2759,9 @@ struct tg3 { |
128 |
+ #define TG3_FLG3_TOGGLE_10_100_L1PLLPD 0x00008000 |
129 |
+ #define TG3_FLG3_PHY_IS_FET 0x00010000 |
130 |
+ #define TG3_FLG3_ENABLE_RSS 0x00020000 |
131 |
++#define TG3_FLG3_4G_DMA_BNDRY_BUG 0x00080000 |
132 |
++#define TG3_FLG3_40BIT_DMA_LIMIT_BUG 0x00100000 |
133 |
++#define TG3_FLG3_SHORT_DMA_BUG 0x00200000 |
134 |
+ |
135 |
+ struct timer_list timer; |
136 |
+ u16 timer_counter; |
137 |
+ |