summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2003-12-28 21:29:28 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2003-12-28 21:29:28 +0000
commit9153392616cf12b58fb115043538693e7eb991dc (patch)
tree4c8e0d96346fbccde6e54775ce137b9bbd1ceef0 /sys/dev
parent70cfecb07254fae5600eef7726bb20b9504aae93 (diff)
Give i/o's requeued as a result of aborts, timeouts, etc. a status of
XS_RESET rather than XS_NOERROR. This prevents unfinished i/o's from being treated as successfully completed ones. Don't bother setting SCB_REQUEUE in scb->flags since the scb is immediately thrown away. Make setting TAG_ENB a little more correct by doing it somewhere both the initial scb setup and subsequent tag resets have access to. Fix a typo. ok miod "I'm not an authoritative person on SCSI issues... though I'm learning!" @.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/aic7xxx_openbsd.c25
-rw-r--r--sys/dev/ic/aic7xxx_openbsd.h21
2 files changed, 26 insertions, 20 deletions
diff --git a/sys/dev/ic/aic7xxx_openbsd.c b/sys/dev/ic/aic7xxx_openbsd.c
index 57e62599823..3e8a861de51 100644
--- a/sys/dev/ic/aic7xxx_openbsd.c
+++ b/sys/dev/ic/aic7xxx_openbsd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aic7xxx_openbsd.c,v 1.15 2003/12/24 22:45:45 krw Exp $ */
+/* $OpenBSD: aic7xxx_openbsd.c,v 1.16 2003/12/28 21:29:27 krw Exp $ */
/* $NetBSD: aic7xxx_osm.c,v 1.14 2003/11/02 11:07:44 wiz Exp $ */
/*
@@ -252,15 +252,12 @@ ahc_done(struct ahc_softc *ahc, struct scb *scb)
break;
case CAM_BDR_SENT:
case CAM_SCSI_BUS_RESET:
+ case CAM_REQUEUE_REQ:
xs->error = XS_RESET;
break;
case CAM_SEL_TIMEOUT:
xs->error = XS_SELTIMEOUT;
break;
- case CAM_REQUEUE_REQ:
- scb->flags |= SCB_REQUEUE;
- xs->error = XS_NOERROR;
- break;
default:
xs->error = XS_DRIVER_STUFFUP;
break;
@@ -475,18 +472,8 @@ ahc_execute_scb(void *arg, bus_dma_segment_t *dm_segs, int nsegments)
scb->hscb->control |= MK_MESSAGE;
}
- if ((tstate->tagenable & mask) != 0) {
- switch (xs->cmd->opcode) {
- case INQUIRY:
- case TEST_UNIT_READY:
- case REQUEST_SENSE:
- /* Don't use tagged i/o on these commands */
- break;
- default:
- scb->hscb->control |= TAG_ENB;
- break;
- }
- }
+ if ((tstate->tagenable & mask) != 0)
+ ahc_set_transaction_tag(scb, TRUE, MSG_SIMPLE_TASK);
bus_dmamap_sync(ahc->parent_dmat, ahc->scb_data->hscb_dmamap,
0, ahc->scb_data->hscb_dmamap->dm_mapsize,
@@ -917,8 +904,8 @@ bus_reset:
timeout_add(&scb->xs->stimeout, 2 * hz);
ahc_unpause(ahc);
} else {
- /* Go "immediatly" to the bus reset */
- /* This shouldn't happen */
+ /* Go "immediately" to the bus reset. */
+ /* This shouldn't happen. */
ahc_set_recoveryscb(ahc, scb);
ahc_print_path(ahc, scb);
printf("SCB %d: Immediate reset. "
diff --git a/sys/dev/ic/aic7xxx_openbsd.h b/sys/dev/ic/aic7xxx_openbsd.h
index bb52f81791d..9c9519e3cf5 100644
--- a/sys/dev/ic/aic7xxx_openbsd.h
+++ b/sys/dev/ic/aic7xxx_openbsd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: aic7xxx_openbsd.h,v 1.9 2003/12/24 22:45:45 krw Exp $ */
+/* $OpenBSD: aic7xxx_openbsd.h,v 1.10 2003/12/28 21:29:27 krw Exp $ */
/* $NetBSD: aic7xxx_osm.h,v 1.7 2003/11/02 11:07:44 wiz Exp $ */
/*
@@ -325,6 +325,25 @@ uint32_t ahc_get_scsi_status(struct scb *scb)
static __inline
void ahc_set_transaction_tag(struct scb *scb, int enabled, u_int type)
{
+ /*
+ * Assume that enabled == 0, or tstate->tagenable has already
+ * been checked and found to be set.
+ */
+ switch (scb->xs->cmd->opcode) {
+ case INQUIRY:
+ case TEST_UNIT_READY:
+ case REQUEST_SENSE:
+ /* Don't use tagged i/o on these commands. */
+ enabled = 0;
+ break;
+ default:
+ break;
+ }
+
+ if (enabled)
+ scb->hscb->control |= TAG_ENB;
+ else
+ scb->hscb->control &= ~TAG_ENB;
}
static __inline