summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2006-06-13 02:07:20 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2006-06-13 02:07:20 +0000
commite047069155e0450e8540244d4aefc5b5acfada1c (patch)
tree7ab07603e3d0548d36a599ca31d41d61aacc5148
parent611bb60da9d4abe2cab3afece4769d9d535fd2ed (diff)
we sometimes bundle chunks that the ioc will write to in the request space
as well as the request itself, so we need to sync the memory in both directions for dma.
-rw-r--r--sys/dev/ic/mpi.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/dev/ic/mpi.c b/sys/dev/ic/mpi.c
index 24f2dcf8b8b..193861f1d46 100644
--- a/sys/dev/ic/mpi.c
+++ b/sys/dev/ic/mpi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpi.c,v 1.36 2006/06/12 23:25:57 dlg Exp $ */
+/* $OpenBSD: mpi.c,v 1.37 2006/06/13 02:07:19 dlg Exp $ */
/*
* Copyright (c) 2005, 2006 David Gwynne <dlg@openbsd.org>
@@ -523,7 +523,8 @@ mpi_intr(void *arg)
ccb = &sc->sc_ccbs[id];
bus_dmamap_sync(sc->sc_dmat, MPI_DMA_MAP(sc->sc_requests),
- ccb->ccb_offset, MPI_REQUEST_SIZE, BUS_DMASYNC_POSTWRITE);
+ ccb->ccb_offset, MPI_REQUEST_SIZE,
+ BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
ccb->ccb_state = MPI_CCB_READY;
ccb->ccb_reply = reply;
ccb->ccb_reply_dva = reply_dva;
@@ -731,7 +732,8 @@ mpi_start(struct mpi_softc *sc, struct mpi_ccb *ccb)
ccb->ccb_cmd_dva);
bus_dmamap_sync(sc->sc_dmat, MPI_DMA_MAP(sc->sc_requests),
- ccb->ccb_offset, MPI_REQUEST_SIZE, BUS_DMASYNC_PREWRITE);
+ ccb->ccb_offset, MPI_REQUEST_SIZE,
+ BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
ccb->ccb_state = MPI_CCB_QUEUED;
mpi_write(sc, MPI_REQ_QUEUE, ccb->ccb_cmd_dva);
@@ -799,7 +801,8 @@ mpi_complete(struct mpi_softc *sc, struct mpi_ccb *nccb, int timeout)
ccb = &sc->sc_ccbs[id];
bus_dmamap_sync(sc->sc_dmat, MPI_DMA_MAP(sc->sc_requests),
- ccb->ccb_offset, MPI_REQUEST_SIZE, BUS_DMASYNC_POSTWRITE);
+ ccb->ccb_offset, MPI_REQUEST_SIZE,
+ BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
ccb->ccb_state = MPI_CCB_READY;
ccb->ccb_reply = reply;
ccb->ccb_reply_dva = reply_dva;