diff options
| author | bouyer <bouyer@NetBSD.org> | 2010-02-21 18:50:10 +0000 |
|---|---|---|
| committer | bouyer <bouyer@NetBSD.org> | 2010-02-21 18:50:10 +0000 |
| commit | 8f7318d79437de0de43d2ad929f2c1911593938e (patch) | |
| tree | db6febb6f99934f06d36d91e98560d21701161cf /sys/dev | |
| parent | d31d8d052b00e5a31738c5c7ff9941b2a08cc708 (diff) | |
Fix confusion about PRE/POST in previous; and another place that has the
same issue. Also add a BUS_DMASYNC_POSTWRITE to the POLL operation.
Problem pointed out by tsutsui@.
Still not perfect (a BUS_DMASYNC_PREREAD would be needed after the
testing the condition in the POLL() macro), but closer.
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/i2o/iop.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/dev/i2o/iop.c b/sys/dev/i2o/iop.c index 50662a8ab82..9ff647d2646 100644 --- a/sys/dev/i2o/iop.c +++ b/sys/dev/i2o/iop.c @@ -1,4 +1,4 @@ -/* $NetBSD: iop.c,v 1.79 2010/02/21 14:16:47 bouyer Exp $ */ +/* $NetBSD: iop.c,v 1.80 2010/02/21 18:50:10 bouyer Exp $ */ /*- * Copyright (c) 2000, 2001, 2002, 2007 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: iop.c,v 1.79 2010/02/21 14:16:47 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: iop.c,v 1.80 2010/02/21 18:50:10 bouyer Exp $"); #include "iop.h" @@ -990,17 +990,17 @@ iop_ofifo_init(struct iop_softc *sc) mb[0] += 2 << 16; bus_dmamap_sync(sc->sc_dmat, sc->sc_scr_dmamap, 0, sizeof(*sw), - BUS_DMASYNC_PREWRITE); + BUS_DMASYNC_POSTWRITE); *sw = 0; bus_dmamap_sync(sc->sc_dmat, sc->sc_scr_dmamap, 0, sizeof(*sw), - BUS_DMASYNC_POSTWRITE); + BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); if ((rv = iop_post(sc, mb)) != 0) return (rv); POLL(5000, (bus_dmamap_sync(sc->sc_dmat, sc->sc_scr_dmamap, 0, sizeof(*sw), - BUS_DMASYNC_POSTREAD), + BUS_DMASYNC_POSTWRITE | BUS_DMASYNC_POSTREAD), *sw == htole32(I2O_EXEC_OUTBOUND_INIT_COMPLETE))); if (*sw != htole32(I2O_EXEC_OUTBOUND_INIT_COMPLETE)) { @@ -1535,17 +1535,17 @@ iop_reset(struct iop_softc *sc) mf.statushigh = (u_int32_t)((u_int64_t)pa >> 32); bus_dmamap_sync(sc->sc_dmat, sc->sc_scr_dmamap, 0, sizeof(*sw), - BUS_DMASYNC_PREWRITE); + BUS_DMASYNC_POSTWRITE); *sw = htole32(0); bus_dmamap_sync(sc->sc_dmat, sc->sc_scr_dmamap, 0, sizeof(*sw), - BUS_DMASYNC_POSTWRITE); + BUS_DMASYNC_PREWRITE|BUS_DMASYNC_PREREAD); if ((rv = iop_post(sc, (u_int32_t *)&mf))) return (rv); POLL(2500, (bus_dmamap_sync(sc->sc_dmat, sc->sc_scr_dmamap, 0, sizeof(*sw), - BUS_DMASYNC_POSTREAD), *sw != 0)); + BUS_DMASYNC_POSTWRITE | BUS_DMASYNC_POSTREAD), *sw != 0)); if (*sw != htole32(I2O_RESET_IN_PROGRESS)) { aprint_error_dev(&sc->sc_dv, "reset rejected, status 0x%x\n", le32toh(*sw)); |
