summaryrefslogtreecommitdiff
path: root/sys/arch/sun3/dev/si.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-10-11 23:07:21 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-10-11 23:07:21 +0000
commit21bca8f77f4a0b76385b34dd701f84774541b996 (patch)
treeb9d7efdac00d36f01866c2b7935c47822347fdc4 /sys/arch/sun3/dev/si.c
parentafed71da2ec3c53eeaed07724e300eb301143150 (diff)
sync + our changes
Diffstat (limited to 'sys/arch/sun3/dev/si.c')
-rw-r--r--sys/arch/sun3/dev/si.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/sys/arch/sun3/dev/si.c b/sys/arch/sun3/dev/si.c
index 893c5368c3a..0bf52d046bc 100644
--- a/sys/arch/sun3/dev/si.c
+++ b/sys/arch/sun3/dev/si.c
@@ -1,4 +1,4 @@
-/* $NetBSD: si.c,v 1.24 1996/03/26 15:01:10 gwr Exp $ */
+/* $NetBSD: si.c,v 1.25 1996/06/17 23:21:29 gwr Exp $ */
/*
* Copyright (c) 1995 David Jones, Gordon W. Ross
@@ -425,6 +425,10 @@ si_dma_free(ncr_sc)
}
+#define CSR_MASK (SI_CSR_SBC_IP | SI_CSR_DMA_IP | \
+ SI_CSR_DMA_CONFLICT | SI_CSR_DMA_BUS_ERR)
+#define POLL_TIMO 50000 /* X100 = 5 sec. */
+
/*
* Poll (spin-wait) for DMA completion.
* Called right after xx_dma_start(), and
@@ -439,30 +443,36 @@ si_dma_poll(ncr_sc)
struct sci_req *sr = ncr_sc->sc_current;
struct si_dma_handle *dh = sr->sr_dma_hand;
volatile struct si_regs *si = sc->sc_regs;
- int tmo, csr_mask;
+ int tmo;
/* Make sure DMA started successfully. */
if (ncr_sc->sc_state & NCR_ABORTING)
return;
- csr_mask = SI_CSR_SBC_IP | SI_CSR_DMA_IP |
- SI_CSR_DMA_CONFLICT | SI_CSR_DMA_BUS_ERR;
+ /*
+ * XXX: The Sun driver waits for ~SI_CSR_DMA_ACTIVE here
+ * XXX: (on obio) or even worse (on vme) a 10mS. delay!
+ * XXX: I really doubt that is necessary...
+ */
- tmo = 50000; /* X100 = 5 sec. */
+ /* Wait for any "dma complete" or error bits. */
+ tmo = POLL_TIMO;
for (;;) {
- if (si->si_csr & csr_mask)
+ if (si->si_csr & CSR_MASK)
break;
if (--tmo <= 0) {
printf("si: DMA timeout (while polling)\n");
/* Indicate timeout as MI code would. */
sr->sr_flags |= SR_OVERDUE;
- break;
- }
+ break;
+ }
delay(100);
}
+ NCR_TRACE("si_dma_poll: waited %d\n",
+ POLL_TIMO - tmo);
#ifdef DEBUG
- if (si_debug) {
+ if (si_debug & 2) {
printf("si_dma_poll: done, csr=0x%x\n", si->si_csr);
}
#endif