Subject: port-i386/2641: ancient 3c505 boards take five seconds or more to reset
To: None <gnats-bugs@NetBSD.ORG>
From: Kenneth Stailey <kstailey@dol-esa.gov>
List: netbsd-bugs
Date: 07/17/1996 22:28:35
>Number:         2641
>Category:       port-i386
>Synopsis:       ancient 3c505 boards take five seconds or more to reset
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jul 17 23:05:03 1996
>Last-Modified:
>Originator:     Kenneth Stailey
>Organization:
US DOL/ESA/DASM
>Release:        1.2_BETA
>Environment:
	
System: NetBSD owl 1.2_BETA NetBSD 1.2_BETA (OWL) #0: Mon Jul 15 23:55:53 EDT 1996 kstailey@owl:/usr/src/sys/arch/i386/compile/OWL i386


>Description:
The newer 3c505 boards seem to reset in an instant.  Older boards take five
seconds or more to reset.
>How-To-Repeat:
Put a 3com 3c505 ROM v3.01 in using eg0 and get a "reset failed".
>Fix:
	

--- if_eg.c.DIST	Wed Jul 17 21:57:22 1996
+++ if_eg.c	Wed Jul 17 22:23:45 1996
@@ -320,8 +320,14 @@
 		if ((inb(sc->eg_stat) & EG_PCB_STAT) == EG_PCB_NULL) 
 			break;
 	}
-	if ((inb(sc->eg_stat) & EG_PCB_STAT) != EG_PCB_NULL) {
-		dprintf(("eg: Reset failed\n"));
+	for (i = 0; i < 10; i++) {
+		dprintf(("eg: Reset %d\n", i + 1));
+		if ((inb(sc->eg_stat) & EG_PCB_STAT) == EG_PCB_NULL)
+			break;
+		delay(1000000);
+	}
+	if (i == 10) {
+		dprintf(("eg: Reset failed\n", i));
 		return 0;
 	}
 	sc->eg_pcb[0] = EG_CMD_GETINFO; /* Get Adapter Info */
>Audit-Trail:
>Unformatted: