]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] improved wait_8254_wraparound()
authorHerbert Pötzl <herbert@13thfloor.at>
Tue, 11 Jan 2005 09:45:29 +0000 (01:45 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 11 Jan 2005 09:45:29 +0000 (01:45 -0800)
hopefully 'better' fix for broken Intel Mercury/Neptune in
wait_8254_wraparound() ...

Rationale:

changing HZ to higher values (like 5k,10k or 20k) will hang machines using
wait_8254_wraparound() indefinitely, because a suboptimal workaround for
buggy Intel Mercury/Neptune chipsets is in place.

this was tested on several machines, unfortunately none with a broken Intel
Mercury/Neptune chipset, and it works fine with various HZ values ...

Signed-off-by: Herbert Pötzl <herbert@13thfloor.at>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/i386/kernel/apic.c

index df8900b1f1670a17a5db0c43eecec3214da701bf..406f5a93d01b8c61418ae4ec4bbbe5aa4f5492cb 100644 (file)
@@ -877,23 +877,18 @@ static unsigned int __init get_8254_timer_count(void)
 /* next tick in 8254 can be caught by catching timer wraparound */
 static void __init wait_8254_wraparound(void)
 {
-       unsigned int curr_count, prev_count=~0;
-       int delta;
+       unsigned int curr_count, prev_count;
 
        curr_count = get_8254_timer_count();
-
        do {
                prev_count = curr_count;
                curr_count = get_8254_timer_count();
-               delta = curr_count-prev_count;
 
-       /*
-        * This limit for delta seems arbitrary, but it isn't, it's
-        * slightly above the level of error a buggy Mercury/Neptune
-        * chipset timer can cause.
-        */
+               /* workaround for broken Mercury/Neptune */
+               if (prev_count >= curr_count + 0x100)
+                       curr_count = get_8254_timer_count();
 
-       } while (delta < 300);
+       } while (prev_count >= curr_count);
 }
 
 /*