Date: Sun, 03 Jul 2005 00:37:59 -0000 From: Nate Lawson <nate@root.org> To: current@freebsd.org Cc: stable@freebsd.org Subject: Re: patch: fix 30 second hang while resuming Message-ID: <422253D7.7000504@root.org> In-Reply-To: <42224897.7050006@root.org> References: <42224897.7050006@root.org>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
Nate Lawson wrote:
> My system hangs a long time in ata_generic_reset() while resuming. I
> did some hunting and found that the loop was running for the full 310 *
> 100 ms (31 seconds). The bug is that the loop never exits when mask
> goes to 0 even though this is a termination condition (see end of the
> loop where the code masks off 1 and 2).
>
> The attached patch fixes this by exiting when the mask is set to 0
> instead of looping the full 31 seconds. This is correct since setting
> the mask to 0 is how the loop marks master/slave "done". It also has a
> minor whitespace fix.
Apologies, the last patch was not quite right. You need to check that
both status values are not "busy" as well as the mask. This check could
be merged in elsewhere as well. This was just a convenient place to put it.
Please use the attached patch instead.
--
Nate
[-- Attachment #2 --]
Index: sys/dev/ata/ata-lowlevel.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/ata/ata-lowlevel.c,v
retrieving revision 1.51
diff -u -r1.51 ata-lowlevel.c
--- sys/dev/ata/ata-lowlevel.c 24 Dec 2004 13:38:25 -0000 1.51
+++ sys/dev/ata/ata-lowlevel.c 27 Feb 2005 23:09:17 -0000
@@ -619,8 +619,11 @@
(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,
[-- Attachment #3 --]
_______________________________________________
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?422253D7.7000504>
