Commit 840fed6b authored by Herbert Pötzl's avatar Herbert Pötzl Committed by Linus Torvalds

[PATCH] improved wait_8254_wraparound()

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: default avatarHerbert Pötzl <herbert@13thfloor.at>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 42d29d5c
...@@ -877,23 +877,18 @@ static unsigned int __init get_8254_timer_count(void) ...@@ -877,23 +877,18 @@ static unsigned int __init get_8254_timer_count(void)
/* next tick in 8254 can be caught by catching timer wraparound */ /* next tick in 8254 can be caught by catching timer wraparound */
static void __init wait_8254_wraparound(void) static void __init wait_8254_wraparound(void)
{ {
unsigned int curr_count, prev_count=~0; unsigned int curr_count, prev_count;
int delta;
curr_count = get_8254_timer_count(); curr_count = get_8254_timer_count();
do { do {
prev_count = curr_count; prev_count = curr_count;
curr_count = get_8254_timer_count(); curr_count = get_8254_timer_count();
delta = curr_count-prev_count;
/* /* workaround for broken Mercury/Neptune */
* This limit for delta seems arbitrary, but it isn't, it's if (prev_count >= curr_count + 0x100)
* slightly above the level of error a buggy Mercury/Neptune curr_count = get_8254_timer_count();
* chipset timer can cause.
*/
} while (delta < 300); } while (prev_count >= curr_count);
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment