Gentoo Archives: gentoo-commits

From: "Mike Pagano (mpagano)" <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] linux-patches r1675 - genpatches-2.6/trunk/2.6.32
Date: Thu, 18 Feb 2010 23:03:52
Message-Id: E1NiFPS-0000CM-QW@stork.gentoo.org
1 Author: mpagano
2 Date: 2010-02-18 23:03:50 +0000 (Thu, 18 Feb 2010)
3 New Revision: 1675
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 Fix tranmits hangs in Broadcom 5906 adapter. And don't break the other broadcom adapters.
11
12 Modified: genpatches-2.6/trunk/2.6.32/0000_README
13 ===================================================================
14 --- genpatches-2.6/trunk/2.6.32/0000_README 2010-02-18 15:58:13 UTC (rev 1674)
15 +++ genpatches-2.6/trunk/2.6.32/0000_README 2010-02-18 23:03:50 UTC (rev 1675)
16 @@ -71,6 +71,10 @@
17 From: http://www.kernel.org
18 Desc: Linux 2.6.32.8
19
20 +Patch: 2400_5906-transmit-hang-fix.patch
21 +From: http://bugs.gentoo.org/show_bug.cgi?id=304625
22 +Desc: tg3: Fix 5906 transmit hangs
23 +
24 Patch: 2410_rtl8187se-compilation-fix.patch
25 From: http://bugs.gentoo.org/show_bug.cgi?id=296920
26 Desc: Fix rtl8187se compilation errors with mac80211
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-18 23:03:50 UTC (rev 1675)
32 @@ -0,0 +1,84 @@
33 +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:
34 +
35 +The 5906 has trouble with fragments that are less than 8 bytes in size.
36 +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.
37 +
38 +Signed-off-by: Mike Pagano <mpagano@g.o>
39 +---
40 +--- a/drivers/net/tg3.c 2010-01-30 15:59:44.000000000 -0500
41 ++++ b/drivers/net/tg3.c 2010-02-13 10:16:16.000000000 -0500
42 +@@ -5392,7 +5392,7 @@ static netdev_tx_t tg3_start_xmit_dma_bu
43 + mss = 0;
44 + if ((mss = skb_shinfo(skb)->gso_size) != 0) {
45 + struct iphdr *iph;
46 +- int tcp_opt_len, ip_tcp_len, hdr_len;
47 ++ u32 tcp_opt_len, ip_tcp_len, hdr_len;
48 +
49 + if (skb_header_cloned(skb) &&
50 + pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) {
51 +@@ -5423,8 +5423,10 @@ static netdev_tx_t tg3_start_xmit_dma_bu
52 + IPPROTO_TCP,
53 + 0);
54 +
55 +- if ((tp->tg3_flags2 & TG3_FLG2_HW_TSO) ||
56 +- (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705)) {
57 ++ if (tp->tg3_flags2 & TG3_FLG2_HW_TSO_2)
58 ++ mss |= hdr_len << 9;
59 ++ else if ((tp->tg3_flags2 & TG3_FLG2_HW_TSO_1) ||
60 ++ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705) {
61 + if (tcp_opt_len || iph->ihl > 5) {
62 + int tsflags;
63 +
64 +@@ -5459,6 +5461,9 @@ static netdev_tx_t tg3_start_xmit_dma_bu
65 +
66 + would_hit_hwbug = 0;
67 +
68 ++ if ((tp->tg3_flags3 & TG3_FLG3_SHORT_DMA_BUG) && len <= 8)
69 ++ would_hit_hwbug = 1;
70 ++
71 + if (tp->tg3_flags3 & TG3_FLG3_5701_DMA_BUG)
72 + would_hit_hwbug = 1;
73 + else if (tg3_4g_overflow_test(mapping, len))
74 +@@ -5482,6 +5487,10 @@ static netdev_tx_t tg3_start_xmit_dma_bu
75 +
76 + tnapi->tx_buffers[entry].skb = NULL;
77 +
78 ++ if ((tp->tg3_flags3 & TG3_FLG3_SHORT_DMA_BUG) &&
79 ++ len <= 8)
80 ++ would_hit_hwbug = 1;
81 ++
82 + if (tg3_4g_overflow_test(mapping, len))
83 + would_hit_hwbug = 1;
84 +
85 +@@ -12608,6 +12617,13 @@ static int __devinit tg3_get_invariants(
86 + }
87 + }
88 +
89 ++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906)
90 ++ tp->tg3_flags3 |= TG3_FLG3_SHORT_DMA_BUG;
91 ++
92 + tp->irq_max = 1;
93 +
94 + #ifdef TG3_NAPI
95 +@@ -13975,8 +13991,7 @@ static int __devinit tg3_init_one(struct
96 + goto err_out_iounmap;
97 + }
98 +
99 +- if ((tp->tg3_flags3 & TG3_FLG3_5755_PLUS) ||
100 +- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906)
101 ++ if (tp->tg3_flags3 & TG3_FLG3_5755_PLUS)
102 + dev->netdev_ops = &tg3_netdev_ops;
103 + else
104 + dev->netdev_ops = &tg3_netdev_ops_dma_bug;
105 +--- a/drivers/net/tg3.h 2010-01-30 15:59:47.000000000 -0500
106 ++++ b/drivers/net/tg3.h 2010-01-31 14:02:59.000000000 -0500
107 +@@ -2759,6 +2759,9 @@ struct tg3 {
108 + #define TG3_FLG3_TOGGLE_10_100_L1PLLPD 0x00008000
109 + #define TG3_FLG3_PHY_IS_FET 0x00010000
110 + #define TG3_FLG3_ENABLE_RSS 0x00020000
111 ++#define TG3_FLG3_4G_DMA_BNDRY_BUG 0x00080000
112 ++#define TG3_FLG3_40BIT_DMA_LIMIT_BUG 0x00100000
113 ++#define TG3_FLG3_SHORT_DMA_BUG 0x00200000
114 +
115 + struct timer_list timer;
116 + u16 timer_counter;