summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormatthew <matthew@openbsd.org>2011-05-05 19:23:05 +0000
committermatthew <matthew@openbsd.org>2011-05-05 19:23:05 +0000
commitf11b21e7bcf4dacc7930c2086d1c32129f407630 (patch)
tree0aa3372ca81f9efde44f2f07eccd1b6ee821ba3a
parentadd support for muting the master channel on i2s based cards, this allows the (diff)
downloadwireguard-openbsd-f11b21e7bcf4dacc7930c2086d1c32129f407630.tar.xz
wireguard-openbsd-f11b21e7bcf4dacc7930c2086d1c32129f407630.zip
Go back to only attempting one IDENTIFY command against directly
attached devices as in the pre-port-multiplier code. (Devices attached via port multipliers still get multiple attempts though.) Also don't bother sleeping after the last iteration if all attempts failed. Discussed with dlg@ and Jonathan Matthew; ok dlg@
-rw-r--r--sys/dev/ata/atascsi.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/dev/ata/atascsi.c b/sys/dev/ata/atascsi.c
index e9877dedbaa..5f142a83892 100644
--- a/sys/dev/ata/atascsi.c
+++ b/sys/dev/ata/atascsi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: atascsi.c,v 1.103 2011/04/27 23:51:09 matthew Exp $ */
+/* $OpenBSD: atascsi.c,v 1.104 2011/05/05 19:23:05 matthew Exp $ */
/*
* Copyright (c) 2007 David Gwynne <dlg@openbsd.org>
@@ -331,8 +331,8 @@ atascsi_probe(struct scsi_link *link)
* identification from working, so we retry a few times
* with a fairly long delay.
*/
- int count = 5;
- do {
+ int count = (link->lun > 0) ? 6 : 1;
+ while (count--) {
xa = scsi_io_get(&ahp->ahp_iopool, SCSI_NOSLEEP);
if (xa == NULL)
panic("no free xfers on a new port");
@@ -358,8 +358,9 @@ atascsi_probe(struct scsi_link *link)
break;
}
dma_free(identify, sizeof(*identify));
- delay(5000000);
- } while (count--);
+ if (count > 0)
+ delay(5000000);
+ }
if (rv != 0) {
goto error;