Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ic When issuing a non-dma command, make sure to set ...



details:   https://anonhg.NetBSD.org/src/rev/c58d0049abb8
branches:  trunk
changeset: 779783:c58d0049abb8
user:      martin <martin%NetBSD.org@localhost>
date:      Mon Jun 18 21:23:56 2012 +0000

description:
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:

 sys/dev/ic/ncr53c9x.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (50 lines):

diff -r bcaca43aac52 -r c58d0049abb8 sys/dev/ic/ncr53c9x.c
--- a/sys/dev/ic/ncr53c9x.c     Mon Jun 18 20:30:32 2012 +0000
+++ b/sys/dev/ic/ncr53c9x.c     Mon Jun 18 21:23:56 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ncr53c9x.c,v 1.144 2012/03/10 20:54:20 mrg Exp $       */
+/*     $NetBSD: ncr53c9x.c,v 1.145 2012/06/18 21:23:56 martin 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.144 2012/03/10 20:54:20 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ncr53c9x.c,v 1.145 2012/06/18 21:23:56 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -735,6 +735,7 @@
                } else {
                        ncr53c9x_wrfifo(sc, (uint8_t *)&ecb->cmd.cmd,
                            ecb->clen);
+                       sc->sc_cmdlen = 0;
                        NCRCMD(sc, NCRCMD_SELNATN);
                }
                return;
@@ -804,6 +805,7 @@
         */
 
        /* 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_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 @@
                } else {
                        ncr53c9x_wrfifo(sc, (uint8_t *)&ecb->cmd.cmd,
                            ecb->clen);
+                       sc->sc_cmdlen = 0;
                        NCRCMD(sc, NCRCMD_TRANS);
                }
                sc->sc_prevphase = COMMAND_PHASE;



Home | Main Index | Thread Index | Old Index