aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/mvs
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2010-09-30 04:23:03 +0000
committerAlexander Motin <mav@FreeBSD.org>2010-09-30 04:23:03 +0000
commitad2f37604a95f2a088a6329d5e81eb5eac239afb (patch)
tree117843c6665a3dd7158991c9c6881d8e872c9f7f /sys/dev/mvs
parenta4a05399514c9a8a78e83fca566891e6b2292b23 (diff)
Notes
Diffstat (limited to 'sys/dev/mvs')
-rw-r--r--sys/dev/mvs/mvs.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/sys/dev/mvs/mvs.c b/sys/dev/mvs/mvs.c
index a7800ec689bc..8146665969e2 100644
--- a/sys/dev/mvs/mvs.c
+++ b/sys/dev/mvs/mvs.c
@@ -1551,6 +1551,7 @@ mvs_end_transaction(struct mvs_slot *slot, enum mvs_err_type et)
device_t dev = slot->dev;
struct mvs_channel *ch = device_get_softc(dev);
union ccb *ccb = slot->ccb;
+ int lastto;
//device_printf(dev, "cmd done status %d\n", et);
bus_dmamap_sync(ch->dma.workrq_tag, ch->dma.workrq_map,
@@ -1633,11 +1634,6 @@ mvs_end_transaction(struct mvs_slot *slot, enum mvs_err_type et)
ch->oslots &= ~(1 << slot->slot);
ch->rslots &= ~(1 << slot->slot);
ch->aslots &= ~(1 << slot->slot);
- if (et != MVS_ERR_TIMEOUT) {
- if (ch->toslots == (1 << slot->slot))
- xpt_release_simq(ch->sim, TRUE);
- ch->toslots &= ~(1 << slot->slot);
- }
slot->state = MVS_SLOT_EMPTY;
slot->ccb = NULL;
/* Update channel stats. */
@@ -1657,6 +1653,13 @@ mvs_end_transaction(struct mvs_slot *slot, enum mvs_err_type et)
ch->numpslots--;
ch->basic_dma = 0;
}
+ /* Cancel timeout state if request completed normally. */
+ if (et != MVS_ERR_TIMEOUT) {
+ lastto = (ch->toslots == (1 << slot->slot));
+ ch->toslots &= ~(1 << slot->slot);
+ if (lastto)
+ xpt_release_simq(ch->sim, TRUE);
+ }
/* If it was our READ LOG command - process it. */
if (ch->readlog) {
mvs_process_read_log(dev, ccb);