diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2004-12-10 05:04:24 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2004-12-10 05:04:24 +0000 |
commit | 00ed45459eefe4f06de302bcc0744c319a0b9396 (patch) | |
tree | f2b41fdc7065f8fa005e9f7923e84728986b8958 | |
parent | 70c71e23c220a58f2994b55e13bda7f7b94069a0 (diff) |
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.c | 4 |
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) { |