diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2004-08-30 17:01:44 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2004-08-30 17:01:44 +0000 |
commit | 5ca0d3ab4dcdb0bec326f0f25fc437029de21575 (patch) | |
tree | 32dbc638300dbdc585595a1f57f99b18d422d7f6 /sys/arch/hp300/dev/spc.c | |
parent | 6bfd44faeed330c963602e2b06422af2c61921cf (diff) |
In the interrupt handler, if there is a DMA transfer in progress, do
not busy wait for the transfer to complete at the very beginning, as
this interrupt could be unrelated to the transfer; busywaiting could
cause the scsi command timeout to be triggered, and the code would not
recover correctly.
Instead, make the DMA check simply return, leaving the "busy" flag set;
and perform the usual interrupt handler duties, except for the phase
change.
test&ok millert@
Diffstat (limited to 'sys/arch/hp300/dev/spc.c')
-rw-r--r-- | sys/arch/hp300/dev/spc.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/sys/arch/hp300/dev/spc.c b/sys/arch/hp300/dev/spc.c index 7fa89855b19..83bfc354845 100644 --- a/sys/arch/hp300/dev/spc.c +++ b/sys/arch/hp300/dev/spc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: spc.c,v 1.7 2004/08/25 21:00:37 miod Exp $ */ +/* $OpenBSD: spc.c,v 1.8 2004/08/30 17:01:43 miod Exp $ */ /* $NetBSD: spc.c,v 1.2 2003/11/17 14:37:59 tsutsui Exp $ */ /* @@ -246,18 +246,9 @@ spc_dio_dmadone(struct spc_softc *sc) int resid, trans; u_int8_t cmd; - /* wait DMA complete */ - if ((spc_read(SSTS) & SSTS_BUSY) != 0) { - int timeout = 1000; /* XXX how long? */ - while ((spc_read(SSTS) & SSTS_BUSY) != 0) { - if (--timeout < 0) { - printf("%s: DMA complete timeout\n", - sc->sc_dev.dv_xname); - timeout = 1000; - } - DELAY(1); - } - } + /* Check if the DMA operation is finished. */ + if ((spc_read(SSTS) & SSTS_BUSY) != 0) + return; sc->sc_flags &= ~SPC_DOINGDMA; if ((dsc->sc_dflags & SCSI_HAVEDMA) != 0) { |