Copy SCSI command before bus_dmamap_sync(9) PREREAD ops against
data xfer buffer because command and data buffers might be in the same cacheline.
This commit is contained in:
parent
8df8a6ae3f
commit
8c07627095
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: osiop.c,v 1.28 2007/06/30 14:08:58 tsutsui Exp $ */
|
||||
/* $NetBSD: osiop.c,v 1.29 2007/06/30 14:32:50 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.28 2007/06/30 14:08:58 tsutsui Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: osiop.c,v 1.29 2007/06/30 14:32:50 tsutsui Exp $");
|
||||
|
||||
/* #define OSIOP_DEBUG */
|
||||
|
||||
|
@ -404,6 +404,9 @@ 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,
|
||||
|
@ -927,8 +930,6 @@ 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];
|
||||
|
|
Loading…
Reference in New Issue