diff options
author | 2011-04-15 20:53:28 +0000 | |
---|---|---|
committer | 2011-04-15 20:53:28 +0000 | |
commit | ba8cbb4a615731df82a088c6322903ba45e6992c (patch) | |
tree | 384e1fe4654474473e06a5ae91779340ff2078fb /sys/dev/atapiscsi/atapiscsi.c | |
parent | More than a decade ago, interrupt handlers on sparc started returning 0 (diff) | |
download | wireguard-openbsd-ba8cbb4a615731df82a088c6322903ba45e6992c.tar.xz wireguard-openbsd-ba8cbb4a615731df82a088c6322903ba45e6992c.zip |
Change wdc_reset_channel() to take a `no wait' argument. Pass in turn this
argument to wdcreset(), to have it skip waiting until active channels see
their BUSY bit clear in the status register.
Use this feature in the resume path, during the first reset operation. The
first reset is supposed to only wake up the controller, and the disks don't
come back until the second reset is issued, therefore waiting for them to
report themselves as ready after the first reset, but before the second, is
moot - and as a matter of fact some controllers, such as the AMD 754 and
clones/offspring (e.g. Geode) keep the BUSY bit asserted after the first
reset.
Last, but not least, make sure wd@ata invokes wd_get_params() again before
returning from the resume code, as we will still be using polled transfers
for a short while.
This causes the Lemote Yeelong to resume within less than one second, instead
of the lousy 30 seconds wait between the two resets; and the wd_get_params()
voodoo prevents it from getting spurious ide interrupts afterwards.
wd_get_params() magic from dlg; rest of the work by yours truly after enough
prodding by dlg@ and pirofti@, among others. ok deraadt@ dlg@
Diffstat (limited to 'sys/dev/atapiscsi/atapiscsi.c')
-rw-r--r-- | sys/dev/atapiscsi/atapiscsi.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/atapiscsi/atapiscsi.c b/sys/dev/atapiscsi/atapiscsi.c index f40a8c2c9a1..4e324450c4b 100644 --- a/sys/dev/atapiscsi/atapiscsi.c +++ b/sys/dev/atapiscsi/atapiscsi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: atapiscsi.c,v 1.96 2010/11/18 21:13:19 miod Exp $ */ +/* $OpenBSD: atapiscsi.c,v 1.97 2011/04/15 20:53:28 miod Exp $ */ /* * This code is derived from code with the copyright below. @@ -311,9 +311,9 @@ atapiscsi_activate(struct device *self, int act) * the channel */ wdc_disable_intr(chp); - wdc_reset_channel(drvp); + wdc_reset_channel(drvp, 1); delay(10000); - wdc_reset_channel(drvp); + wdc_reset_channel(drvp, 0); wdc_enable_intr(chp); break; } @@ -1626,7 +1626,7 @@ wdc_atapi_reset_2(chp, xfer, timeout, ret) chp->wdc->sc_dev.dv_xname, chp->channel, xfer->drive); sc_xfer->error = XS_SELTIMEOUT; - wdc_reset_channel(drvp); + wdc_reset_channel(drvp, 0); xfer->next = wdc_atapi_done; return; |