From f969979deab7b8753bbd2c4b6647304c89e5c84f Mon Sep 17 00:00:00 2001 From: thorpej Date: Sat, 18 May 1996 23:56:59 +0000 Subject: [PATCH] Back most (not all) of the previous delay-related changes now that delay is calibrated properly. --- sys/arch/hp300/dev/fhpib.c | 10 +++++----- sys/arch/hp300/dev/nhpib.c | 4 ++-- sys/arch/hp300/dev/scsi.c | 30 +++++++++++++++--------------- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/sys/arch/hp300/dev/fhpib.c b/sys/arch/hp300/dev/fhpib.c index 9c6fe89a78e6..1a73c0462a52 100644 --- a/sys/arch/hp300/dev/fhpib.c +++ b/sys/arch/hp300/dev/fhpib.c @@ -1,4 +1,4 @@ -/* $NetBSD: fhpib.c,v 1.10 1996/05/17 15:12:34 thorpej Exp $ */ +/* $NetBSD: fhpib.c,v 1.11 1996/05/18 23:56:59 thorpej Exp $ */ /* * Copyright (c) 1982, 1990, 1993 @@ -55,7 +55,7 @@ * Inline version of fhpibwait to be used in places where * we don't worry about getting hung. */ -#define FHPIBWAIT(hd, m) while (((hd)->hpib_intr & (m)) == 0) DELAY(5) +#define FHPIBWAIT(hd, m) while (((hd)->hpib_intr & (m)) == 0) DELAY(1) #ifdef DEBUG int fhpibdebugunit = -1; @@ -211,7 +211,7 @@ fhpibsend(unit, slave, sec, ptr, origcnt) while ((hd->hpib_intr & IM_ROOM) == 0) { if (--timo <= 0) goto senderr; - DELAY(5); + DELAY(1); } } hd->hpib_stat = ST_EOI; @@ -278,7 +278,7 @@ fhpibrecv(unit, slave, sec, ptr, origcnt) while ((hd->hpib_intr & IM_BYTE) == 0) { if (--timo == 0) goto recvbyteserror; - DELAY(5); + DELAY(1); } *addr++ = hd->hpib_data; } @@ -578,7 +578,7 @@ fhpibwait(hd, x) register int timo = hpibtimeout; while ((hd->hpib_intr & x) == 0 && --timo) - DELAY(5); + DELAY(1); if (timo == 0) { #ifdef DEBUG if (fhpibdebug & FDB_FAIL) diff --git a/sys/arch/hp300/dev/nhpib.c b/sys/arch/hp300/dev/nhpib.c index 101a062d3c60..e1e7f7c9c705 100644 --- a/sys/arch/hp300/dev/nhpib.c +++ b/sys/arch/hp300/dev/nhpib.c @@ -1,4 +1,4 @@ -/* $NetBSD: nhpib.c,v 1.10 1996/05/17 15:12:30 thorpej Exp $ */ +/* $NetBSD: nhpib.c,v 1.11 1996/05/18 23:57:01 thorpej Exp $ */ /* * Copyright (c) 1982, 1990, 1993 @@ -472,7 +472,7 @@ nhpibwait(hd, x) register int timo = hpibtimeout; while ((hd->hpib_mis & x) == 0 && --timo) - DELAY(5); + DELAY(1); if (timo == 0) { #ifdef DEBUG if (nhpibreporttimo) diff --git a/sys/arch/hp300/dev/scsi.c b/sys/arch/hp300/dev/scsi.c index a95c2109fa3c..942e4a51fe6e 100644 --- a/sys/arch/hp300/dev/scsi.c +++ b/sys/arch/hp300/dev/scsi.c @@ -1,4 +1,4 @@ -/* $NetBSD: scsi.c,v 1.9 1996/05/17 15:15:29 thorpej Exp $ */ +/* $NetBSD: scsi.c,v 1.10 1996/05/18 23:57:03 thorpej Exp $ */ /* * Copyright (c) 1990, 1993 @@ -145,7 +145,7 @@ scsiabort(target, hs, hd, where) while ((hd->scsi_psns & PSNS_REQ) == 0) { if (! (hd->scsi_ssts & SSTS_INITIATOR)) goto out; - DELAY(5); + DELAY(1); if (--maxtries == 0) { printf("-- scsiabort gave up after 1000 tries (startlen = %d len = %d)\n", startlen, len); @@ -162,7 +162,7 @@ out2: hd->scsi_scmd = SCMD_SET_ACK; if (hd->scsi_tmod == 0) while (hd->scsi_psns & PSNS_REQ) - DELAY(5); + DELAY(1); junk = hd->scsi_temp; } else { /* one of the output phases - send an abort msg */ @@ -170,7 +170,7 @@ out2: hd->scsi_scmd = SCMD_SET_ACK; if (hd->scsi_tmod == 0) while (hd->scsi_psns & PSNS_REQ) - DELAY(5); + DELAY(1); } hd->scsi_scmd = SCMD_RST_ACK; } @@ -186,7 +186,7 @@ out: if (! ((junk = hd->scsi_ints) & INTS_RESEL)) { hd->scsi_sctl |= SCTL_CTRLRST; - DELAY(5); + DELAY(2); hd->scsi_sctl &=~ SCTL_CTRLRST; hd->scsi_hconf = 0; hd->scsi_ints = hd->scsi_ints; @@ -467,7 +467,7 @@ wait_for_select(hd) u_char ints; while ((ints = hd->scsi_ints) == 0) - DELAY(5); + DELAY(1); hd->scsi_ints = ints; return (!(hd->scsi_ssts & SSTS_INITIATOR)); } @@ -498,7 +498,7 @@ ixfer_start(hd, len, phase, wait) HIST(ixstart_wait, wait) return (0); } - DELAY(5); + DELAY(1); } HIST(ixstart_wait, wait) return (1); @@ -523,7 +523,7 @@ ixfer_out(hd, len, buf) HIST(ixout_wait, wait) return (len); } - DELAY(5); + DELAY(1); } hd->scsi_dreg = *buf++; } @@ -554,7 +554,7 @@ ixfer_in(hd, len, buf) HIST(ixin_wait, wait) return; } - DELAY(5); + DELAY(1); } *buf++ = hd->scsi_dreg; } @@ -592,7 +592,7 @@ mxfer_in(hd, len, buf, phase) (hd->scsi_ssts & SSTS_INITIATOR) == 0) goto out; - DELAY(5); + DELAY(1); } /* * set ack (which says we're ready for the data, wait for @@ -606,7 +606,7 @@ mxfer_in(hd, len, buf, phase) HIST(mxin_wait, wait) return (-2); } - DELAY(5); + DELAY(1); } *buf++ = hd->scsi_temp; hd->scsi_scmd = SCMD_RST_ACK; @@ -622,7 +622,7 @@ out: while ((hd->scsi_ssts & SSTS_ACTIVE) == SSTS_INITIATOR) { if (--wait < 0) break; - DELAY(5); + DELAY(1); } HIST(mxin2_wait, wait) return (i); @@ -729,7 +729,7 @@ scsiicmd(hs, target, cbuf, clen, buf, len, xferphase) HIST(cxin_wait, wait) goto abort; } - DELAY(5); + DELAY(1); } HIST(cxin_wait, wait) hd->scsi_ints = ints; @@ -789,7 +789,7 @@ finishxfer(hs, hd, target) } hd->scsi_scmd |= SCMD_PROG_XFR; hd->scsi_sctl |= SCTL_CTRLRST; - DELAY(5); + DELAY(2); hd->scsi_sctl &=~ SCTL_CTRLRST; hd->scsi_hconf = 0; /* @@ -1056,7 +1056,7 @@ scsigo(ctlr, slave, unit, bp, cdb, pad) HIST(sgo_wait, wait) goto abort; } - DELAY(5); + DELAY(1); } HIST(sgo_wait, wait) hd->scsi_ints = ints;