linux-mips
[Top] [All Lists]

[PATCH 4/5] cpmac: wait longer after MDIO reset

To: Ralf Baechle <ralf@linux-mips.org>
Subject: [PATCH 4/5] cpmac: wait longer after MDIO reset
From: Florian Fainelli <florian@openwrt.org>
Date: Tue, 4 Aug 2009 22:52:57 +0200
Cc: linux-mips@linux-mips.org, netdev@vger.kernel.org, David Miller <davem@davemloft.net>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:from:date:subject :mime-version:x-uid:x-length:to:cc:content-type :content-transfer-encoding:content-disposition:message-id; bh=Pus7d8m17fZ7RFdD29x1dlmrpZPtsZ2QMPFIimTDFb0=; b=VQkfXmMI/o7e3N55kARorppyS1XxWdKzSZvMY1Km0kwVRp7lNAtmJBYmHmfgBIjqwV 4BMiP1kOlEsymbt7wxlU7bPssipfzCetOid99GcmTpWb82OcBd7uAy635YIQ7LyLoifl fNDn1A0DHy5ae+faX17EhFmmNibGZxgzmrOTU=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:date:subject:mime-version:x-uid:x-length:to:cc :content-type:content-transfer-encoding:content-disposition :message-id; b=YLu+ZM7wQ8/SFh8dhXkOk8zKxqz45RBODCtT5mvQomGMipooSHg1BIWy+N2nM4V1Pl aqeGLoFheHUEqS1TSCqBh8WWTY15wS6taxhMykXDrYZO+rivZzrlEgrpoNB1ZsSmTGry pCRjLTr3mQ/Zot24HOdMbj3nvLZkSMJ4GKIQ0=
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
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>
---
diff --git a/drivers/net/cpmac.c b/drivers/net/cpmac.c
index f2fc722..12a521e 100644
--- a/drivers/net/cpmac.c
+++ b/drivers/net/cpmac.c
@@ -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)) {

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