Module Name:    src
Committed By:   jdc
Date:           Wed Jul 25 20:55:36 UTC 2012

Modified Files:
        src/sys/dev/ic [netbsd-6]: ncr53c9x.c

Log Message:
Pull up revision 1.145 (requested by ryoon in ticket #439).

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).


To generate a diff of this commit:
cvs rdiff -u -r1.143.8.1 -r1.143.8.2 src/sys/dev/ic/ncr53c9x.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/ncr53c9x.c
diff -u src/sys/dev/ic/ncr53c9x.c:1.143.8.1 src/sys/dev/ic/ncr53c9x.c:1.143.8.2
--- src/sys/dev/ic/ncr53c9x.c:1.143.8.1	Mon Mar 19 23:13:59 2012
+++ src/sys/dev/ic/ncr53c9x.c	Wed Jul 25 20:55:36 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ncr53c9x.c,v 1.143.8.1 2012/03/19 23:13:59 riz Exp $	*/
+/*	$NetBSD: ncr53c9x.c,v 1.143.8.2 2012/07/25 20:55:36 jdc Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2002 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ncr53c9x.c,v 1.143.8.1 2012/03/19 23:13:59 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ncr53c9x.c,v 1.143.8.2 2012/07/25 20:55:36 jdc Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -735,6 +735,7 @@ ncr53c9x_select(struct ncr53c9x_softc *s
 		} else {
 			ncr53c9x_wrfifo(sc, (uint8_t *)&ecb->cmd.cmd,
 			    ecb->clen);
+			sc->sc_cmdlen = 0;
 			NCRCMD(sc, NCRCMD_SELNATN);
 		}
 		return;
@@ -804,6 +805,7 @@ ncr53c9x_select(struct ncr53c9x_softc *s
 	 */
 
 	/* Now get the command into the FIFO */
+	sc->sc_cmdlen = 0;
 	ncr53c9x_wrfifo(sc, cmd, clen);
 
 	/* And get the targets attention */
@@ -2054,6 +2056,7 @@ ncr53c9x_msgout(struct ncr53c9x_softc *s
 		 */
 		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 */
@@ -2759,6 +2762,7 @@ msgin:
 		} else {
 			ncr53c9x_wrfifo(sc, (uint8_t *)&ecb->cmd.cmd,
 			    ecb->clen);
+			sc->sc_cmdlen = 0;
 			NCRCMD(sc, NCRCMD_TRANS);
 		}
 		sc->sc_prevphase = COMMAND_PHASE;

Reply via email to