/[linux-patches]/genpatches-2.6/trunk/2.6.32/2400_5906-transmit-hang-fix.patch
Gentoo

Contents of /genpatches-2.6/trunk/2.6.32/2400_5906-transmit-hang-fix.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1675 - (show annotations) (download) (as text)
Thu Feb 18 23:03:50 2010 UTC (10 years, 9 months ago) by mpagano
File MIME type: text/x-diff
File size: 3170 byte(s)
Fix tranmits hangs in Broadcom 5906 adapter. And don't break the other broadcom adapters.
1 This is a resubmit 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. Thanks to Matt Carlson for his assistance and working me to fix a regression caused by the intial patch. The original description is as follows:
2
3 The 5906 has trouble with fragments that are less than 8 bytes in size.
4 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.
5
6 Signed-off-by: Mike Pagano <mpagano@gentoo.org>
7 ---
8 --- a/drivers/net/tg3.c 2010-01-30 15:59:44.000000000 -0500
9 +++ b/drivers/net/tg3.c 2010-02-13 10:16:16.000000000 -0500
10 @@ -5392,7 +5392,7 @@ static netdev_tx_t tg3_start_xmit_dma_bu
11 mss = 0;
12 if ((mss = skb_shinfo(skb)->gso_size) != 0) {
13 struct iphdr *iph;
14 - int tcp_opt_len, ip_tcp_len, hdr_len;
15 + u32 tcp_opt_len, ip_tcp_len, hdr_len;
16
17 if (skb_header_cloned(skb) &&
18 pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) {
19 @@ -5423,8 +5423,10 @@ static netdev_tx_t tg3_start_xmit_dma_bu
20 IPPROTO_TCP,
21 0);
22
23 - if ((tp->tg3_flags2 & TG3_FLG2_HW_TSO) ||
24 - (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705)) {
25 + if (tp->tg3_flags2 & TG3_FLG2_HW_TSO_2)
26 + mss |= hdr_len << 9;
27 + else if ((tp->tg3_flags2 & TG3_FLG2_HW_TSO_1) ||
28 + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705) {
29 if (tcp_opt_len || iph->ihl > 5) {
30 int tsflags;
31
32 @@ -5459,6 +5461,9 @@ static netdev_tx_t tg3_start_xmit_dma_bu
33
34 would_hit_hwbug = 0;
35
36 + if ((tp->tg3_flags3 & TG3_FLG3_SHORT_DMA_BUG) && len <= 8)
37 + would_hit_hwbug = 1;
38 +
39 if (tp->tg3_flags3 & TG3_FLG3_5701_DMA_BUG)
40 would_hit_hwbug = 1;
41 else if (tg3_4g_overflow_test(mapping, len))
42 @@ -5482,6 +5487,10 @@ static netdev_tx_t tg3_start_xmit_dma_bu
43
44 tnapi->tx_buffers[entry].skb = NULL;
45
46 + if ((tp->tg3_flags3 & TG3_FLG3_SHORT_DMA_BUG) &&
47 + len <= 8)
48 + would_hit_hwbug = 1;
49 +
50 if (tg3_4g_overflow_test(mapping, len))
51 would_hit_hwbug = 1;
52
53 @@ -12608,6 +12617,13 @@ static int __devinit tg3_get_invariants(
54 }
55 }
56
57 + if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906)
58 + tp->tg3_flags3 |= TG3_FLG3_SHORT_DMA_BUG;
59 +
60 tp->irq_max = 1;
61
62 #ifdef TG3_NAPI
63 @@ -13975,8 +13991,7 @@ static int __devinit tg3_init_one(struct
64 goto err_out_iounmap;
65 }
66
67 - if ((tp->tg3_flags3 & TG3_FLG3_5755_PLUS) ||
68 - GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906)
69 + if (tp->tg3_flags3 & TG3_FLG3_5755_PLUS)
70 dev->netdev_ops = &tg3_netdev_ops;
71 else
72 dev->netdev_ops = &tg3_netdev_ops_dma_bug;
73 --- a/drivers/net/tg3.h 2010-01-30 15:59:47.000000000 -0500
74 +++ b/drivers/net/tg3.h 2010-01-31 14:02:59.000000000 -0500
75 @@ -2759,6 +2759,9 @@ struct tg3 {
76 #define TG3_FLG3_TOGGLE_10_100_L1PLLPD 0x00008000
77 #define TG3_FLG3_PHY_IS_FET 0x00010000
78 #define TG3_FLG3_ENABLE_RSS 0x00020000
79 +#define TG3_FLG3_4G_DMA_BNDRY_BUG 0x00080000
80 +#define TG3_FLG3_40BIT_DMA_LIMIT_BUG 0x00100000
81 +#define TG3_FLG3_SHORT_DMA_BUG 0x00200000
82
83 struct timer_list timer;
84 u16 timer_counter;

  ViewVC Help
Powered by ViewVC 1.1.20