cpmac: wait longer after MDIO reset
authorFlorian Fainelli <florian@openwrt.org>
Tue, 4 Aug 2009 10:52:57 +0000 (10:52 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 5 Aug 2009 19:22:11 +0000 (12:22 -0700)
This patch slows down the MDIO_ALIVE busy waiting to let
switches and PHY come up after reset. Previous loop was
too quick for IC+175C and ADM6996C/L switches to come up.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/cpmac.c

index 7b311c6d14ab715ee19b40eb824f82ef9ee91984..645e6442dc481382f59d73163cb6888fb0cc14d6 100644 (file)
@@ -1245,11 +1245,11 @@ int __devinit cpmac_init(void)
 
        cpmac_mii->reset(cpmac_mii);
 
-       for (i = 0; i < 300000; i++)
+       for (i = 0; i < 300; i++)
                if ((mask = cpmac_read(cpmac_mii->priv, CPMAC_MDIO_ALIVE)))
                        break;
                else
-                       cpu_relax();
+                       msleep(10);
 
        mask &= 0x7fffffff;
        if (mask & (mask - 1)) {