diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2010-01-05 00:16:31 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2010-01-05 00:16:31 +0000 |
commit | 4a7de402aa6c7593a4e2d82aef0f07297aa0200f (patch) | |
tree | 2b9d5b62121601e94563589416b4d721b7409b33 /sys | |
parent | 508b079cc04c98afb841270c5ccb4543ced0eb27 (diff) |
atapiscsi didnt call scsi_done when the xfer had SCSI_POLL set. this is
Bad.
this sort of worked before because the midlayer would sleep on the
ITSDONE flag in the scsi_xfer, which atapiscsi does set. however, with
the introduction of scsi_xs_sync, it now sleeps on a condition that is
only cleared if the adapter properly and correctly calls scsi_done when
it is in fact done with the xfer.
sorry guys.
ok krw@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/atapiscsi/atapiscsi.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/dev/atapiscsi/atapiscsi.c b/sys/dev/atapiscsi/atapiscsi.c index fb4d0c80c34..f6a03fe4ea1 100644 --- a/sys/dev/atapiscsi/atapiscsi.c +++ b/sys/dev/atapiscsi/atapiscsi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: atapiscsi.c,v 1.84 2009/11/27 09:18:01 sobrado Exp $ */ +/* $OpenBSD: atapiscsi.c,v 1.85 2010/01/05 00:16:30 dlg 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; + int s, ret = SUCCESSFULLY_QUEUED;; int idx; WDCDEBUG_PRINT(("wdc_atapi_send_cmd %s:%d:%d start\n", @@ -425,12 +425,14 @@ wdc_atapi_send_cmd(sc_xfer) } wdc_exec_xfer(chp, xfer); + if (xfer->c_flags & C_POLL) { #ifdef DIAGNOSTIC - if ((xfer->c_flags & C_POLL) != 0 && - (sc_xfer->flags & ITSDONE) == 0) - panic("wdc_atapi_send_cmd: polled command not done"); + if ((sc_xfer->flags & ITSDONE) == 0) + panic("wdc_atapi_send_cmd: polled command not done"); #endif - ret = (sc_xfer->flags & ITSDONE) ? COMPLETE : SUCCESSFULLY_QUEUED; + scsi_done(sc_xfer); + ret = COMPLETE; + } splx(s); return (ret); } |