summaryrefslogtreecommitdiff
path: root/sys/dev/atapiscsi
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2010-01-11 00:00:54 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2010-01-11 00:00:54 +0000
commitb2480ddbed82117bd2bfb999763c61efa5292e31 (patch)
tree6434b1ed51a9f4a6f31989474a90e5d2e8f84617 /sys/dev/atapiscsi
parent7dd20475c8d4f96569ff09a7be4f95dda9251728 (diff)
Don't check ITSDONE since we know it is set in scsi_done(). Eliminates
possible references to xs which has been recycled. Slight tweak to dlg's previous fix for atapiscsi. ok dlg@ 'looks safe' miod@
Diffstat (limited to 'sys/dev/atapiscsi')
-rw-r--r--sys/dev/atapiscsi/atapiscsi.c32
1 files changed, 12 insertions, 20 deletions
diff --git a/sys/dev/atapiscsi/atapiscsi.c b/sys/dev/atapiscsi/atapiscsi.c
index 83de610b14b..c4e79eda6ab 100644
--- a/sys/dev/atapiscsi/atapiscsi.c
+++ b/sys/dev/atapiscsi/atapiscsi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: atapiscsi.c,v 1.86 2010/01/05 12:17:54 dlg Exp $ */
+/* $OpenBSD: atapiscsi.c,v 1.87 2010/01/11 00:00:53 krw Exp $ */
/*
* This code is derived from code with the copyright below.
@@ -327,7 +327,7 @@ wdc_atapi_send_cmd(sc_xfer)
struct channel_softc *chp = as->chp;
struct ata_drive_datas *drvp = &chp->ch_drive[as->drive];
struct wdc_xfer *xfer;
- int s, ret = SUCCESSFULLY_QUEUED;
+ int s;
int idx;
WDCDEBUG_PRINT(("wdc_atapi_send_cmd %s:%d:%d start\n",
@@ -425,16 +425,12 @@ wdc_atapi_send_cmd(sc_xfer)
}
wdc_exec_xfer(chp, xfer);
- if (xfer->c_flags & C_POLL) {
-#ifdef DIAGNOSTIC
- if ((sc_xfer->flags & ITSDONE) == 0)
- panic("wdc_atapi_send_cmd: polled command not done");
-#endif
- scsi_done(sc_xfer);
- ret = COMPLETE;
- }
splx(s);
- return (ret);
+
+ if (xfer->c_flags & C_POLL)
+ return (COMPLETE);
+ else
+ return (SUCCESSFULLY_QUEUED);
}
void
@@ -1575,16 +1571,12 @@ wdc_atapi_done(chp, xfer, timeout, ret)
(u_int)xfer->c_flags, sc_xfer->error), DEBUG_XFERS);
WDC_LOG_ATAPI_DONE(chp, xfer->drive, xfer->c_flags, sc_xfer->error);
- sc_xfer->flags |= ITSDONE;
-
- if (xfer->c_flags & C_POLL) {
+ if (xfer->c_flags & C_POLL)
wdc_enable_intr(chp);
- } else {
- WDCDEBUG_PRINT(("wdc_atapi_done: scsi_done\n"), DEBUG_XFERS);
- s = splbio();
- scsi_done(sc_xfer);
- splx(s);
- }
+
+ s = splbio();
+ scsi_done(sc_xfer);
+ splx(s);
xfer->next = NULL;
return;