Gentoo Archives: gentoo-commits

From: "Mike Pagano (mpagano)" <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] linux-patches r1662 - genpatches-2.6/trunk/2.6.32
Date: Wed, 03 Feb 2010 13:38:25
Message-Id: E1NcfQz-0004QT-4z@stork.gentoo.org
1 Author: mpagano
2 Date: 2010-02-03 13:38:20 +0000 (Wed, 03 Feb 2010)
3 New Revision: 1662
4
5 Modified:
6 genpatches-2.6/trunk/2.6.32/2400_5906-transmit-hang-fix.patch
7 Log:
8 Updated 5906 transmit patch with suggestions from Matt Carlson from broadcom
9
10 Modified: genpatches-2.6/trunk/2.6.32/2400_5906-transmit-hang-fix.patch
11 ===================================================================
12 --- genpatches-2.6/trunk/2.6.32/2400_5906-transmit-hang-fix.patch 2010-02-01 17:45:09 UTC (rev 1661)
13 +++ genpatches-2.6/trunk/2.6.32/2400_5906-transmit-hang-fix.patch 2010-02-03 13:38:20 UTC (rev 1662)
14 @@ -1,15 +1,12 @@
15 -tg3: Fix 5906 transmit hangs
16 -
17 -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:
18 +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. Thanks to Matt Carlson for his assistance. The original description is as follows:
19
20 The 5906 has trouble with fragments that are less than 8 bytes in size.
21 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.
22
23 Signed-off-by: Mike Pagano <mpagano@g.o>
24 ---
25 -
26 ---- a/drivers/net/tg3.c 2010-01-30 15:59:44.000000000 -0500
27 -+++ b/drivers/net/tg3.c 2010-01-30 16:12:26.000000000 -0500
28 +--- a/drivers/net/tg3.c 2010-02-02 11:09:54.000000000 -0500
29 ++++ b/drivers/net/tg3.c 2010-02-02 11:51:24.000000000 -0500
30 @@ -5392,7 +5392,7 @@ static netdev_tx_t tg3_start_xmit_dma_bu
31 mss = 0;
32 if ((mss = skb_shinfo(skb)->gso_size) != 0) {
33 @@ -25,7 +22,7 @@
34
35 - if ((tp->tg3_flags2 & TG3_FLG2_HW_TSO) ||
36 - (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705)) {
37 -+ if (tp->tg3_flags2 & TG3_FLG2_HW_TSO_2)
38 ++ if (tp->tg3_flags2 & TG3_FLG2_HW_TSO_2)
39 + mss |= hdr_len << 9;
40 + else if ((tp->tg3_flags2 & TG3_FLG2_HW_TSO_1) ||
41 + GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705) {
42 @@ -42,11 +39,10 @@
43 if (tp->tg3_flags3 & TG3_FLG3_5701_DMA_BUG)
44 would_hit_hwbug = 1;
45 else if (tg3_4g_overflow_test(mapping, len))
46 -@@ -5482,6 +5487,11 @@ static netdev_tx_t tg3_start_xmit_dma_bu
47 +@@ -5482,6 +5487,10 @@ static netdev_tx_t tg3_start_xmit_dma_bu
48
49 tnapi->tx_buffers[entry].skb = NULL;
50
51 -+
52 + if ((tp->tg3_flags3 & TG3_FLG3_SHORT_DMA_BUG) &&
53 + len <= 8)
54 + would_hit_hwbug = 1;
55 @@ -54,9 +50,11 @@
56 if (tg3_4g_overflow_test(mapping, len))
57 would_hit_hwbug = 1;
58
59 -@@ -12595,16 +12605,15 @@ static int __devinit tg3_get_invariants(
60 +@@ -12594,18 +12603,13 @@ static int __devinit tg3_get_invariants(
61 + tp->pci_chip_rev_id <= CHIPREV_ID_5714_A2 &&
62 tp->pdev_peer == tp->pdev))
63 tp->tg3_flags &= ~TG3_FLAG_SUPPORT_MSI;
64 ++ }
65
66 - if ((tp->tg3_flags3 & TG3_FLG3_5755_PLUS) ||
67 - GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) {
68 @@ -68,19 +66,16 @@
69 - ASIC_REV_5750 &&
70 - tp->pci_chip_rev_id >= CHIPREV_ID_5750_C2)
71 - tp->tg3_flags2 &= ~TG3_FLG2_TSO_BUG;
72 -+ if (!(tp->tg3_flags3 & TG3_FLG3_5755_PLUS)) {
73 -+ tp->tg3_flags3 |= TG3_FLG3_4G_DMA_BNDRY_BUG;
74 -+ tp->tg3_flags3 |= TG3_FLG3_40BIT_DMA_LIMIT_BUG;
75 -+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906)
76 -+ tp->tg3_flags3 |= TG3_FLG3_SHORT_DMA_BUG;
77 -+ else {
78 -+ tp->tg3_flags3 |= TG3_FLG3_4G_DMA_BNDRY_BUG;
79 -+ tp->tg3_flags3 |= TG3_FLG3_40BIT_DMA_LIMIT_BUG;
80 -+ }
81 - }
82 +- }
83 ++ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906)
84 ++ tp->tg3_flags3 |= TG3_FLG3_SHORT_DMA_BUG;
85 ++ else if (!(tp->tg3_flags3 & TG3_FLG3_5755_PLUS)) {
86 ++ tp->tg3_flags3 |= TG3_FLG3_4G_DMA_BNDRY_BUG;
87 ++ tp->tg3_flags3 |= TG3_FLG3_40BIT_DMA_LIMIT_BUG;
88 }
89
90 -@@ -13975,8 +13984,7 @@ static int __devinit tg3_init_one(struct
91 + tp->irq_max = 1;
92 +@@ -13975,8 +13979,7 @@ static int __devinit tg3_init_one(struct
93 goto err_out_iounmap;
94 }