From 6bacdeb7e0d08fc6d958010a97e4c82ae4f28df4 Mon Sep 17 00:00:00 2001 From: "Matthew N. Dodd" Date: Wed, 2 Mar 2005 03:34:51 +0000 Subject: [PATCH] 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 --- sys/dev/ata/ata-lowlevel.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/dev/ata/ata-lowlevel.c b/sys/dev/ata/ata-lowlevel.c index 52a50f3fbad..1e4d0bca777 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,