diff options
author | Alexander Yurchenko <grange@cvs.openbsd.org> | 2003-11-17 21:50:15 +0000 |
---|---|---|
committer | Alexander Yurchenko <grange@cvs.openbsd.org> | 2003-11-17 21:50:15 +0000 |
commit | 789b5a242accf30b34e9491d94d9990b42ff9a53 (patch) | |
tree | cddf90dd9e8cb3d2d9ee3b61f288db09d2d57dc2 /sys/dev/ic | |
parent | ab0c634b07d2f7166223fe38f55d1bf94b7b97d9 (diff) |
Don't wait for DRQ after issuing IDENTIFY command; instead check for DRQ
asserted after BSY is cleared in data read codepath. Solves delays in
probe.
The first version of this diff was done by costa@ a long time ago but
had some issues. This one is a partial sync with NetBSD.
ok costa@
Diffstat (limited to 'sys/dev/ic')
-rw-r--r-- | sys/dev/ic/wdc.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/dev/ic/wdc.c b/sys/dev/ic/wdc.c index 77e01c68609..876e876a746 100644 --- a/sys/dev/ic/wdc.c +++ b/sys/dev/ic/wdc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wdc.c,v 1.77 2003/11/13 23:29:14 grange Exp $ */ +/* $OpenBSD: wdc.c,v 1.78 2003/11/17 21:50:13 grange Exp $ */ /* $NetBSD: wdc.c,v 1.68 1999/06/23 19:00:17 bouyer Exp $ */ @@ -1813,17 +1813,19 @@ __wdccommand_intr(chp, xfer, irq) if (irq && (xfer->c_flags & C_TIMEOU) == 0) return 0; /* IRQ was not for us */ wdc_c->flags |= AT_TIMEOU; - __wdccommand_done(chp, xfer); - WDCDEBUG_PRINT(("__wdccommand_intr returned\n"), DEBUG_INTR); - return 1; + goto out; } if (chp->wdc->cap & WDC_CAPABILITY_IRQACK) chp->wdc->irqack(chp); - - if ((wdc_c->flags & AT_READ) && (chp->ch_status & WDCS_DRQ)) { + if (wdc_c->flags & AT_READ) { + if ((chp->ch_status & WDCS_DRQ) == 0) { + wdc_c->flags |= AT_TIMEOU; + goto out; + } wdc_input_bytes(drvp, data, bcount); /* Should we wait for device to indicate idle? */ } +out: __wdccommand_done(chp, xfer); WDCDEBUG_PRINT(("__wdccommand_intr returned\n"), DEBUG_INTR); return 1; |