Backout previous; defer bus_dmamap_sync(9) op against data buffer instead.

XXX ews4800mips (which has 128byte L2 cacheline) still has
XXX some problem in sd_read_capacity() on some unclear condition.
This commit is contained in:
tsutsui 2007-06-30 14:56:48 +00:00
parent 8c07627095
commit b00d562b51

View File

@ -1,4 +1,4 @@
/* $NetBSD: osiop.c,v 1.29 2007/06/30 14:32:50 tsutsui Exp $ */
/* $NetBSD: osiop.c,v 1.30 2007/06/30 14:56:48 tsutsui Exp $ */
/*
* Copyright (c) 2001 Izumi Tsutsui. All rights reserved.
@ -100,7 +100,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: osiop.c,v 1.29 2007/06/30 14:32:50 tsutsui Exp $");
__KERNEL_RCSID(0, "$NetBSD: osiop.c,v 1.30 2007/06/30 14:56:48 tsutsui Exp $");
/* #define OSIOP_DEBUG */
@ -404,9 +404,6 @@ osiop_scsipi_request(struct scsipi_channel *chan, scsipi_adapter_req_t req,
acb->status = ACB_S_READY;
acb->xs = xs;
/* Copy SCSI command to DMA buffer */
memcpy(acb->ds->scsipi_cmd, xs->cmd, xs->cmdlen);
/* Setup DMA map for data buffer */
if (xs->xs_control & (XS_CTL_DATA_IN | XS_CTL_DATA_OUT)) {
err = bus_dmamap_load(sc->sc_dmat, acb->datadma,
@ -423,9 +420,6 @@ osiop_scsipi_request(struct scsipi_channel *chan, scsipi_adapter_req_t req,
splx(s);
return;
}
bus_dmamap_sync(sc->sc_dmat, acb->datadma,
0, xs->datalen, (xs->xs_control & XS_CTL_DATA_IN) ?
BUS_DMASYNC_PREREAD : BUS_DMASYNC_PREWRITE);
}
acb->cmdlen = xs->cmdlen;
@ -930,6 +924,8 @@ osiop_start(struct osiop_softc *sc)
acb->intstat = 0;
/* Copy SCSI command to DMA buffer */
memcpy(ds->scsipi_cmd, xs->cmd, acb->cmdlen);
ds->cmd.count = acb->cmdlen;
ti = &sc->sc_tinfo[target];
@ -990,6 +986,10 @@ osiop_start(struct osiop_softc *sc)
ds->data[i].count = datadma->dm_segs[i].ds_len;
ds->data[i].addr = datadma->dm_segs[i].ds_addr;
}
/* sync xfer data buffer */
bus_dmamap_sync(sc->sc_dmat, acb->datadma,
0, acb->datalen, (xs->xs_control & XS_CTL_DATA_IN) ?
BUS_DMASYNC_PREREAD : BUS_DMASYNC_PREWRITE);
}
/* sync script data structure */