diff options
author | Constantine Sapuntzakis <csapuntz@cvs.openbsd.org> | 2002-05-08 21:50:49 +0000 |
---|---|---|
committer | Constantine Sapuntzakis <csapuntz@cvs.openbsd.org> | 2002-05-08 21:50:49 +0000 |
commit | e23d810c230b590803a1b2e1f314119fce11f130 (patch) | |
tree | 6dbb8feb1cc90701a04b86ed643c3402978c2364 | |
parent | 451650031af1994845f388d424b20c966451b57d (diff) |
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.c | 15 |
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: |