summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2005-10-16 19:16:37 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2005-10-16 19:16:37 +0000
commit1dff71432beb18269c81f4f690878baff68bda1f (patch)
tree9088d9d1b8eaeb5310ecbffdc4b31e6c8ac11d47 /sys
parentb59284b76df5c1ee34c54842a2c5214e47b24cdf (diff)
Don't pound UNIT ATTENTION retries in as fast as possible. If we are
going to retry the command, pause for a second to let the condition clear. Just as we do for certain NOT READY conditions. Found with the help of, and fixes Ed Wandasiewicz's IBM USB Memory key. ok deraadt@
Diffstat (limited to 'sys')
-rw-r--r--sys/scsi/scsi_base.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/scsi/scsi_base.c b/sys/scsi/scsi_base.c
index 86e36f6aaa7..101d4cd0919 100644
--- a/sys/scsi/scsi_base.c
+++ b/sys/scsi/scsi_base.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsi_base.c,v 1.90 2005/10/10 20:06:11 krw Exp $ */
+/* $OpenBSD: scsi_base.c,v 1.91 2005/10/16 19:16:36 krw Exp $ */
/* $NetBSD: scsi_base.c,v 1.43 1997/04/02 02:29:36 mycroft Exp $ */
/*
@@ -1015,14 +1015,18 @@ scsi_interpret_sense(xs)
error = EINVAL;
break;
case SKEY_UNIT_ATTENTION:
- if (sense->add_sense_code == 0x29)
+ if (sense->add_sense_code == 0x29) {
+ xs->error = XS_BUSY; /* wait & retry */
return (ERESTART); /* device or bus reset */
+ }
if ((sc_link->flags & SDEV_REMOVABLE) != 0)
sc_link->flags &= ~SDEV_MEDIA_LOADED;
if ((xs->flags & SCSI_IGNORE_MEDIA_CHANGE) != 0 ||
/* XXX Should reupload any transient state. */
- (sc_link->flags & SDEV_REMOVABLE) == 0)
- return ERESTART;
+ (sc_link->flags & SDEV_REMOVABLE) == 0) {
+ xs->error = XS_BUSY; /* wait & retry */
+ return (ERESTART);
+ }
error = EIO;
break;
case SKEY_WRITE_PROTECT: