diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2015-11-08 22:27:11 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2015-11-08 22:27:11 +0000 |
commit | c67bdb9acef5efd6e6ffb1e2179b584c4827e1eb (patch) | |
tree | 9aae8def6741d1c90cdcd58746a95bb969477fd7 /sys/dev | |
parent | 0c0b480eb67646196c35a3b3c8cb9955b3a751d3 (diff) |
Merge NetBSD 1.145:
When issuing a non-dma command, make sure to set the "remaining length of
command to be transfered via dma" (sc_cmdlen) to zero upfront, otherwise we
might get confused on command completition interrupt (no dma active but still
data left to transfer).
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ic/ncr53c9x.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/dev/ic/ncr53c9x.c b/sys/dev/ic/ncr53c9x.c index 336b70e3a40..6048c470456 100644 --- a/sys/dev/ic/ncr53c9x.c +++ b/sys/dev/ic/ncr53c9x.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ncr53c9x.c,v 1.60 2015/03/14 03:38:47 jsg Exp $ */ +/* $OpenBSD: ncr53c9x.c,v 1.61 2015/11/08 22:27:10 miod Exp $ */ /* $NetBSD: ncr53c9x.c,v 1.56 2000/11/30 14:41:46 thorpej Exp $ */ /* @@ -667,6 +667,7 @@ ncr53c9x_select(sc, ecb) NCRDMA_GO(sc); } else { ncr53c9x_wrfifo(sc, (u_char *)&ecb->cmd.cmd, ecb->clen); + sc->sc_cmdlen = 0; NCRCMD(sc, NCRCMD_SELNATN); } return; @@ -736,6 +737,7 @@ ncr53c9x_select(sc, ecb) */ /* Now get the command into the FIFO */ + sc->sc_cmdlen = 0; ncr53c9x_wrfifo(sc, cmd, clen); /* And get the targets attention */ @@ -1946,6 +1948,7 @@ ncr53c9x_msgout(sc) */ ncr53c9x_flushfifo(sc); ncr53c9x_wrfifo(sc, sc->sc_omp, sc->sc_omlen); + sc->sc_cmdlen = 0; NCRCMD(sc, NCRCMD_TRANS); } else { /* (re)send the message */ @@ -2626,6 +2629,7 @@ msgin: NCRDMA_GO(sc); } else { ncr53c9x_wrfifo(sc, (u_char *)&ecb->cmd.cmd, ecb->clen); + sc->sc_cmdlen = 0; NCRCMD(sc, NCRCMD_TRANS); } sc->sc_prevphase = COMMAND_PHASE; |