summaryrefslogtreecommitdiff
path: root/sys/dev/ic/trm.c
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2010-11-02 22:15:10 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2010-11-02 22:15:10 +0000
commit8015784c5dccf3a6d8b98a0efe00a333321d59c6 (patch)
tree992bb1355be07d22454d1eb36a6d4ffa026345ee /sys/dev/ic/trm.c
parente4ca4ea0116539ecf115a09f5261f6b5210b296d (diff)
Make error message specify if a REQUEST SENSE has timed out, not the
original command. Return xs->error = XS_SENSE, when REQUEST SENSE times out, rather that XS_TIMEOUT. Reduces many useless retries of commands getting sense errors.
Diffstat (limited to 'sys/dev/ic/trm.c')
-rw-r--r--sys/dev/ic/trm.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/sys/dev/ic/trm.c b/sys/dev/ic/trm.c
index 07290996fd0..d59feefa852 100644
--- a/sys/dev/ic/trm.c
+++ b/sys/dev/ic/trm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trm.c,v 1.26 2010/11/02 14:55:01 krw Exp $
+/* $OpenBSD: trm.c,v 1.27 2010/11/02 22:15:09 krw Exp $
* ------------------------------------------------------------
* O.S : OpenBSD
* File Name : trm.c
@@ -646,8 +646,10 @@ trm_timeout(void *arg1)
if (xs != NULL) {
sc = xs->sc_link->adapter_softc;
sc_print_addr(xs->sc_link);
- printf("SCSI OpCode 0x%02x timed out\n",
- xs->cmd->opcode);
+ printf("SCSI OpCode 0x%02x ", xs->cmd->opcode);
+ if (pSRB->SRBFlag & TRM_AUTO_REQSENSE)
+ printf("REQUEST SENSE ");
+ printf("timed out\n");
pSRB->SRBFlag |= TRM_SCSI_TIMED_OUT;
trm_FinishSRB(sc, pSRB);
#ifdef TRM_DEBUG0
@@ -1967,7 +1969,13 @@ trm_FinishSRB(struct trm_softc *sc, struct trm_scsi_req_q *pSRB)
xs->error = XS_DRIVER_STUFFUP;
} else if ((pSRB->SRBFlag & TRM_SCSI_TIMED_OUT) != 0) {
- xs->error = XS_TIMEOUT;
+ if ((pSRB->SRBFlag & TRM_AUTO_REQSENSE) == 0)
+ xs->error = XS_TIMEOUT;
+ else {
+ bzero(&xs->sense, sizeof(xs->sense));
+ xs->status = SCSI_CHECK;
+ xs->error = XS_SENSE;
+ }
} else if ((pSRB->SRBFlag & TRM_AUTO_REQSENSE) != 0) {
s1 = &pSRB->scsisense;