diff options
-rw-r--r-- | sys/dev/mii/mii_physubr.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/sys/dev/mii/mii_physubr.c b/sys/dev/mii/mii_physubr.c index 7f054369a42..42351ab959b 100644 --- a/sys/dev/mii/mii_physubr.c +++ b/sys/dev/mii/mii_physubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mii_physubr.c,v 1.20 2004/10/09 02:06:56 brad Exp $ */ +/* $OpenBSD: mii_physubr.c,v 1.21 2004/10/09 02:17:03 brad Exp $ */ /* $NetBSD: mii_physubr.c,v 1.20 2001/04/13 23:30:09 thorpej Exp $ */ /*- @@ -291,7 +291,17 @@ mii_phy_reset(struct mii_softc *sc) reg = BMCR_RESET | BMCR_ISO; PHY_WRITE(sc, MII_BMCR, reg); - /* Wait 100ms for it to complete. */ + /* + * It is best to allow a little time for the reset to settle + * in before we start polling the BMCR again. Notably, the + * DP83840A manual states that there should be a 500us delay + * between asserting software reset and attempting MII serial + * operations. Also, a DP83815 can get into a bad state on + * cable removal and reinsertion if we do not delay here. + */ + delay(500); + + /* Wait another 100ms for it to complete. */ for (i = 0; i < 100; i++) { reg = PHY_READ(sc, MII_BMCR); if ((reg & BMCR_RESET) == 0) |