summaryrefslogtreecommitdiffstats
path: root/sys/cam/cam_periph.c
diff options
context:
space:
mode:
authormjacob <mjacob@FreeBSD.org>1999-10-16 23:53:09 +0000
committermjacob <mjacob@FreeBSD.org>1999-10-16 23:53:09 +0000
commit8c211e8c8b6890d181b64632ddf5f2e97146d428 (patch)
treeded5e6bfaab51b648a4ae9fe1aeedc92cc4f6916 /sys/cam/cam_periph.c
parent25ab9f2150fa1e7e374781b5a5da9d5058a6efcf (diff)
downloadFreeBSD-src-8c211e8c8b6890d181b64632ddf5f2e97146d428.zip
FreeBSD-src-8c211e8c8b6890d181b64632ddf5f2e97146d428.tar.gz
Put an upper bound on the number of BUSY status retries we'll do (use the
retry count for the ccb). This is probably not quite the right thing, but it is better than silently hanging on (possibly broken) h/w which is what we do now. Reviewed by:Justin/Ken: they weren't entirely happy about it but didn't say no.
Diffstat (limited to 'sys/cam/cam_periph.c')
-rw-r--r--sys/cam/cam_periph.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c
index 6ed5ddf..089c5f0 100644
--- a/sys/cam/cam_periph.c
+++ b/sys/cam/cam_periph.c
@@ -1522,15 +1522,18 @@ cam_periph_error(union ccb *ccb, cam_flags camflags,
/*
* Restart the queue after either another
* command completes or a 1 second timeout.
+ * If we have any retries left, that is.
*/
- /*
- * XXX KDM ask JTG about this again, do we need to
- * be looking at the retry count here?
- */
- error = ERESTART;
- relsim_flags = RELSIM_RELEASE_AFTER_TIMEOUT
- | RELSIM_RELEASE_AFTER_CMDCMPLT;
- timeout = 1000;
+ retry = ccb->ccb_h.retry_count > 0;
+ if (retry) {
+ ccb->ccb_h.retry_count--;
+ error = ERESTART;
+ relsim_flags = RELSIM_RELEASE_AFTER_TIMEOUT
+ | RELSIM_RELEASE_AFTER_CMDCMPLT;
+ timeout = 1000;
+ } else {
+ error = EIO;
+ }
break;
case SCSI_STATUS_RESERV_CONFLICT:
error = EIO;
OpenPOWER on IntegriCloud