summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2010-02-14 12:24:12 +0000
committermav <mav@FreeBSD.org>2010-02-14 12:24:12 +0000
commit605daa112e5da2b84ead6e1e6888a43fcdfbb010 (patch)
tree36ef720fb749e92133497b651e9fdddbe276a483 /sys
parent37e80952d1040fc4ca852bb655c321c6a37c7c43 (diff)
downloadFreeBSD-src-605daa112e5da2b84ead6e1e6888a43fcdfbb010.zip
FreeBSD-src-605daa112e5da2b84ead6e1e6888a43fcdfbb010.tar.gz
MFp4:
After last running command completed, give commands in timeout state second time.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/siis/siis.c27
1 files changed, 25 insertions, 2 deletions
diff --git a/sys/dev/siis/siis.c b/sys/dev/siis/siis.c
index 1c6a2bb..b8820d2 100644
--- a/sys/dev/siis/siis.c
+++ b/sys/dev/siis/siis.c
@@ -1056,6 +1056,28 @@ siis_process_timeout(device_t dev)
}
}
+/* Must be called with channel locked. */
+static void
+siis_rearm_timeout(device_t dev)
+{
+ struct siis_channel *ch = device_get_softc(dev);
+ int i;
+
+ mtx_assert(&ch->mtx, MA_OWNED);
+ for (i = 0; i < SIIS_MAX_SLOTS; i++) {
+ struct siis_slot *slot = &ch->slot[i];
+
+ /* Do we have a running request on slot? */
+ if (slot->state < SIIS_SLOT_RUNNING)
+ continue;
+ if ((ch->toslots & (1 << i)) == 0)
+ continue;
+ callout_reset(&slot->timeout,
+ (int)slot->ccb->ccb_h.timeout * hz / 1000,
+ (timeout_t*)siis_timeout, slot);
+ }
+}
+
/* Locked by callout mechanism. */
static void
siis_timeout(struct siis_slot *slot)
@@ -1216,8 +1238,9 @@ siis_end_transaction(struct siis_slot *slot, enum siis_err_type et)
siis_issue_read_log(dev);
}
/* If all the reset of commands are in timeout - abort them. */
- } else if ((ch->rslots & ~ch->toslots) == 0)
- siis_process_timeout(dev);
+ } else if ((ch->rslots & ~ch->toslots) == 0 &&
+ et != SIIS_ERR_TIMEOUT)
+ siis_rearm_timeout(dev);
}
static void
OpenPOWER on IntegriCloud