summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorgibbs <gibbs@FreeBSD.org>1999-02-11 07:07:27 +0000
committergibbs <gibbs@FreeBSD.org>1999-02-11 07:07:27 +0000
commit51586d35df380fdff615b6954dfa7fba7e88a1b3 (patch)
tree077a3792332ad86d4811c4e4d34a8624b1deae49 /sys
parent6c6407eea425e4465e4edd541e7490b16c330207 (diff)
downloadFreeBSD-src-51586d35df380fdff615b6954dfa7fba7e88a1b3.zip
FreeBSD-src-51586d35df380fdff615b6954dfa7fba7e88a1b3.tar.gz
Correct a race condition where a target mode SCB dma could occur
before we finished setting the pending phase information. Use the ALL_TARGETS_MASK #define instead of 0xffff for the default ultraenb mask.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/aic7xxx/aic7xxx.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/sys/dev/aic7xxx/aic7xxx.c b/sys/dev/aic7xxx/aic7xxx.c
index e442be5..22aa52d 100644
--- a/sys/dev/aic7xxx/aic7xxx.c
+++ b/sys/dev/aic7xxx/aic7xxx.c
@@ -36,7 +36,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: aic7xxx.c,v 1.15 1999/01/14 06:14:14 gibbs Exp $
+ * $Id: aic7xxx.c,v 1.16 1999/01/15 23:24:23 gibbs Exp $
*/
/*
* A few notes on features of the driver.
@@ -3347,7 +3347,7 @@ ahc_init(struct ahc_softc *ahc)
AHC_TERM_ENB_A|AHC_TERM_ENB_B;
ahc->discenable = ALL_TARGETS_MASK;
if ((ahc->features & AHC_ULTRA) != 0)
- ahc->ultraenb = 0xffff;
+ ahc->ultraenb = ALL_TARGETS_MASK;
} else {
ahc->discenable = ~((ahc_inb(ahc, DISC_DSB + 1) << 8)
| ahc_inb(ahc, DISC_DSB));
@@ -4114,6 +4114,12 @@ ahc_execute_scb(void *arg, bus_dma_segment_t *dm_segs, int nsegments,
op = BUS_DMASYNC_PREWRITE;
bus_dmamap_sync(ahc->dmat, scb->dmamap, op);
+
+ if (ccb->ccb_h.func_code == XPT_CONT_TARGET_IO) {
+ scb->hscb->cmdpointer |= DPHASE_PENDING;
+ if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN)
+ scb->hscb->cmdpointer |= (TARGET_DATA_IN << 8);
+ }
} else {
scb->hscb->SG_pointer = 0;
scb->hscb->data = 0;
@@ -4272,11 +4278,6 @@ ahc_setup_data(struct ahc_softc *ahc, struct ccb_scsiio *csio,
segs = (struct bus_dma_segment *)csio->data_ptr;
ahc_execute_scb(scb, segs, csio->sglist_cnt, 0);
}
- if (ccb_h->func_code == XPT_CONT_TARGET_IO) {
- hscb->cmdpointer |= DPHASE_PENDING;
- if ((ccb_h->flags & CAM_DIR_MASK) == CAM_DIR_IN)
- hscb->cmdpointer |= (TARGET_DATA_IN << 8);
- }
} else {
ahc_execute_scb(scb, NULL, 0, 0);
}
OpenPOWER on IntegriCloud