From 00ed45459eefe4f06de302bcc0744c319a0b9396 Mon Sep 17 00:00:00 2001 From: Brad Smith Date: Fri, 10 Dec 2004 05:04:24 +0000 Subject: 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 --- sys/dev/pci/if_bge.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) { -- cgit v1.2.3