summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbrad <brad@openbsd.org>2004-12-10 05:04:23 +0000
committerbrad <brad@openbsd.org>2004-12-10 05:04:23 +0000
commitb87f5818aed77deb30f013f35f3574ea2e330835 (patch)
treece3f5ded84a76860508b05037111b28bb7e2ea25
parenttypos, then -> than, from Michael Knudsen (diff)
downloadwireguard-openbsd-b87f5818aed77deb30f013f35f3574ea2e330835.tar.xz
wireguard-openbsd-b87f5818aed77deb30f013f35f3574ea2e330835.zip
rev 1.5
Put some delay in the loops that poll for MII transaction completion. Without this, reading the PHY can hang the bus on a sufficiently fast CPU. From NetBSD
-rw-r--r--sys/dev/pci/if_bge.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/pci/if_bge.c b/sys/dev/pci/if_bge.c
index ad6b06dec73..ec5a788015c 100644
--- a/sys/dev/pci/if_bge.c
+++ b/sys/dev/pci/if_bge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bge.c,v 1.39 2004/12/10 02:49:18 krw Exp $ */
+/* $OpenBSD: if_bge.c,v 1.40 2004/12/10 05:04:23 brad Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
* Copyright (c) 1997, 1998, 1999, 2001
@@ -480,6 +480,7 @@ bge_miibus_readreg(dev, phy, reg)
val = CSR_READ_4(sc, BGE_MI_COMM);
if (!(val & BGE_MICOMM_BUSY))
break;
+ delay(10);
}
if (i == BGE_TIMEOUT) {
@@ -524,6 +525,7 @@ bge_miibus_writereg(dev, phy, reg, val)
for (i = 0; i < BGE_TIMEOUT; i++) {
if (!(CSR_READ_4(sc, BGE_MI_COMM) & BGE_MICOMM_BUSY))
break;
+ delay(10);
}
if (autopoll & BGE_MIMODE_AUTOPOLL) {