netdev
[Top] [All Lists]

TG3 fix for slow switches (Was: TG3 driver failure on HP 16-way)

To: netdev@xxxxxxxxxxx
Subject: TG3 fix for slow switches (Was: TG3 driver failure on HP 16-way)
From: Peter Chubb <peterc@xxxxxxxxxxxxxxxxxx>
Date: Tue, 21 Dec 2004 11:12:23 +1100
Comments: Hyperbole mail buttons accepted, v04.18.
Sender: netdev-bounce@xxxxxxxxxxx
Hi,
        I've tracked down the problem I was having with the TG3
driver on the HP 16-way.  If you'll recall, the problem was that the
link was always marked as down, and autonegotiation was failing.



The problem is that the driver gives up before the switch that the NIC
is connected to has finished the negotiation phase.

Here's a simple patch.  I changed the way the loop works too, because
tg3_readphys() sets *val to 0xffffffff if it fails.

Signed-off-by: Peter Chubb <peterc@xxxxxxxxxxxxxxxxxx>

===== drivers/net/tg3.c 1.222 vs edited =====
--- 1.222/drivers/net/tg3.c     2004-11-15 23:53:08 +00:00
+++ edited/drivers/net/tg3.c    2004-12-21 00:00:58 +00:00
@@ -1554,10 +1554,11 @@ static int tg3_setup_copper_phy(struct t
                }
        }
 
-       bmsr = 0;
-       for (i = 0; i < 100; i++) {
-               tg3_readphy(tp, MII_BMSR, &bmsr);
+
+       for (i = 0; i < 1000; i++) {
                tg3_readphy(tp, MII_BMSR, &bmsr);
+               if (tg3_readphy(tp, MII_BMSR, &bmsr))
+                       bmsr = 0;
                if (bmsr & BMSR_LSTATUS)
                        break;
                udelay(40);


<Prev in Thread] Current Thread [Next in Thread>