From c67bdb9acef5efd6e6ffb1e2179b584c4827e1eb Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Sun, 8 Nov 2015 22:27:11 +0000 Subject: 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). --- sys/dev/ic/ncr53c9x.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sys/dev') 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; -- cgit v1.2.3