summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Martelletto <pedro@cvs.openbsd.org>2004-07-09 21:38:21 +0000
committerPedro Martelletto <pedro@cvs.openbsd.org>2004-07-09 21:38:21 +0000
commit981c6d75af257904e75a55dc271732b1e97d69b1 (patch)
tree828887edf6a5f695095a33dd5b2d90f2b861caee
parent660f576986d1edb970a5480da472b47f61ece93c (diff)
perform reply buffer dma synchronisation in iop_msg_post(), and not in
iop_post(), since we may get in iop_post() without the map being initialized. should affect sparc64 only. discussed with and ok'd by mickey@
-rw-r--r--sys/dev/i2o/iop.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/dev/i2o/iop.c b/sys/dev/i2o/iop.c
index a152f226994..f3fe74776a9 100644
--- a/sys/dev/i2o/iop.c
+++ b/sys/dev/i2o/iop.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: iop.c,v 1.24 2003/09/04 03:45:53 avsm Exp $ */
+/* $OpenBSD: iop.c,v 1.25 2004/07/09 21:38:20 pedro Exp $ */
/* $NetBSD: iop.c,v 1.12 2001/03/21 14:27:05 ad Exp $ */
/*-
@@ -1958,11 +1958,6 @@ iop_post(struct iop_softc *sc, u_int32_t *mb)
printf("mfa = %u\n", mfa);
#endif
- /* Perform reply buffer DMA synchronisation. XXX This is rubbish. */
- if (sc->sc_curib++ == 0)
- bus_dmamap_sync(sc->sc_dmat, sc->sc_rep_dmamap, 0,
- sc->sc_rep_size, BUS_DMASYNC_PREREAD);
-
/* Copy out the message frame. */
bus_space_write_region_4(sc->sc_iot, sc->sc_ioh, mfa, mb,
size / sizeof *mb);
@@ -1990,6 +1985,11 @@ iop_msg_post(struct iop_softc *sc, struct iop_msg *im, void *xmb, int timo)
if ((im->im_flags & IM_SGLOFFADJ) != 0)
mb[size - 2] |= I2O_SGL_END;
+ /* Perform reply buffer DMA synchronisation. */
+ if (sc->sc_curib++ == 0)
+ bus_dmamap_sync(sc->sc_dmat, sc->sc_rep_dmamap, 0,
+ sc->sc_rep_size, BUS_DMASYNC_PREREAD);
+
if ((rv = iop_post(sc, mb)) != 0)
return (rv);