Module Name: src Committed By: martin Date: Mon Jun 18 21:23:56 UTC 2012
Modified Files: src/sys/dev/ic: ncr53c9x.c Log Message: 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.144 -r1.145 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.144 src/sys/dev/ic/ncr53c9x.c:1.145 --- src/sys/dev/ic/ncr53c9x.c:1.144 Sat Mar 10 20:54:20 2012 +++ src/sys/dev/ic/ncr53c9x.c Mon Jun 18 21:23:56 2012 @@ -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 @@ 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;