summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormdodd <mdodd@FreeBSD.org>2005-03-02 03:34:51 +0000
committermdodd <mdodd@FreeBSD.org>2005-03-02 03:34:51 +0000
commit85764e2aa43a5046d8133ab9efda5fd4e5d3b99e (patch)
treed6287fdd73e6c2fdd52e9f289fff8caf87d7867d
parentfd8046ee06939e0d3a24c14773b1c8d17410035e (diff)
downloadFreeBSD-src-85764e2aa43a5046d8133ab9efda5fd4e5d3b99e.zip
FreeBSD-src-85764e2aa43a5046d8133ab9efda5fd4e5d3b99e.tar.gz
In ata_generic_reset() while waiting for both master & slave to become
idle the 'mask' variable could be set to 0, resulting in the timeout loop running for the full 31 seconds. Handling this case eliminates long hangs on resume on some systems. Submitted by: Nate Lawson <nate AT root.org>
-rw-r--r--sys/dev/ata/ata-lowlevel.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/dev/ata/ata-lowlevel.c b/sys/dev/ata/ata-lowlevel.c
index 52a50f3..1e4d0bc 100644
--- a/sys/dev/ata/ata-lowlevel.c
+++ b/sys/dev/ata/ata-lowlevel.c
@@ -619,8 +619,11 @@ ata_generic_reset(struct ata_channel *ch)
(stat1 == err && lsb == err && msb == err && timeout > 5))
mask &= ~0x02;
}
+ if (mask == 0 && !(stat0 & ATA_S_BUSY) && !(stat1 & ATA_S_BUSY))
+ break;
+
ata_udelay(100000);
- }
+ }
if (bootverbose)
ata_printf(ch, -1,
OpenPOWER on IntegriCloud