summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcsapuntz <csapuntz@openbsd.org>2002-05-08 21:50:48 +0000
committercsapuntz <csapuntz@openbsd.org>2002-05-08 21:50:48 +0000
commit7e610aa157411d0cb98cd6b9fa96b20d1ac5705c (patch)
treec4db1808ae7dfe8bf0d39766c0b766757ead84d1
parentmove to sshd.sshd instead (diff)
downloadwireguard-openbsd-7e610aa157411d0cb98cd6b9fa96b20d1ac5705c.tar.xz
wireguard-openbsd-7e610aa157411d0cb98cd6b9fa96b20d1ac5705c.zip
Drives can go busy after IDENTIFY. Make sure drive is not busy before issuing
SET PIO mode. Heh, this might have been the cause of all those old PIO mode aborts.
-rw-r--r--sys/dev/atapiscsi/atapiscsi.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/sys/dev/atapiscsi/atapiscsi.c b/sys/dev/atapiscsi/atapiscsi.c
index c911a525ef9..368751e55e7 100644
--- a/sys/dev/atapiscsi/atapiscsi.c
+++ b/sys/dev/atapiscsi/atapiscsi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: atapiscsi.c,v 1.58 2002/03/16 17:13:22 csapuntz Exp $ */
+/* $OpenBSD: atapiscsi.c,v 1.59 2002/05/08 21:50:48 csapuntz Exp $ */
/*
* This code is derived from code with the copyright below.
@@ -1355,6 +1355,12 @@ wdc_atapi_ctrl(chp, xfer, timeout, ret)
break;
+ case ATAPI_PIOMODE_STATE:
+ errstring = "Post-Identify";
+ if (!(chp->ch_status & (WDCS_BSY | WDCS_DRQ)))
+ trigger_timeout = 0;
+ break;
+
case ATAPI_PIOMODE_WAIT_STATE:
errstring = "PIOMODE";
if (chp->ch_status & (WDCS_BSY | WDCS_DRQ))
@@ -1431,8 +1437,13 @@ wdc_atapi_ctrl(chp, xfer, timeout, ret)
}
drvp->state = ATAPI_PIOMODE_STATE;
+ /*
+ * Note, we can't go directly to set PIO mode
+ * because the drive is free to assert BSY
+ * after the transfer
+ */
+ break;
}
- /* fall through */
case ATAPI_PIOMODE_STATE:
piomode: