All of lore.kernel.org
 help / color / mirror / Atom feed
From: Herbert Poetzl <herbert@13thfloor.at>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: Ingo Molnar <mingo@redhat.com>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>, Pavel Machek <pavel@ucw.cz>
Subject: improved wait_8254_wraparound()
Date: Thu, 6 Jan 2005 10:19:05 +0100	[thread overview]
Message-ID: <20050106091903.GC728@mail.13thfloor.at> (raw)


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 ...

please consider for inclusion or further testing ...

TIA,
Herbert


Signed-off-by: Herbert Pötzl <herbert@13thfloor.at>

diff -NurpP --minimal 
--- linux-2.6.10/arch/i386/kernel/apic.c	2004-12-25 01:54:43.000000000 +0100
+++ linux-2.6.10-fixed/arch/i386/kernel/apic.c	2005-01-02 10:57:33.000000000 +0100
@@ -877,23 +877,18 @@ static unsigned int __init get_8254_time
 /* 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);
 }
 
 /*


                 reply	other threads:[~2005-01-06  9:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050106091903.GC728@mail.13thfloor.at \
    --to=herbert@13thfloor.at \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pavel@ucw.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.