mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: john stultz <johnstul@us.ibm.com>
To: Andrew Morton <akpm@osdl.org>
Cc: lkml <linux-kernel@vger.kernel.org>
Subject: [PATCH] Blacklist TSC from systems where it is known to be bad
Date: Thu, 19 Jan 2006 15:23:15 -0800	[thread overview]
Message-ID: <1137712995.27699.124.camel@cog.beaverton.ibm.com> (raw)

	This patch adds a blacklist infrastructure to the TSC clocksource as
well as an entry for the 380XD Thinkpad. This allows us to manually add
systems (mainly older-laptops) where the TSC frequency is changed by the
BIOS without any notification to the OS.

The justification for using a blacklist instead of trying to detect the
problem is because the detectable symptoms are exactly the same as what
is observed when interrupts arrive too frequently (a semi-common issue
w/ broken PIT hardware), and the number of other older laptops with this
issue is likely small.

This patch resolves bugme bug #5868.

thanks
-john


diff --git a/arch/i386/kernel/tsc.c b/arch/i386/kernel/tsc.c
index cab2546..7e72219 100644
--- a/arch/i386/kernel/tsc.c
+++ b/arch/i386/kernel/tsc.c
@@ -9,6 +9,7 @@
 #include <linux/cpufreq.h>
 #include <linux/jiffies.h>
 #include <linux/init.h>
+#include <linux/dmi.h>
 
 #include <asm/delay.h>
 #include <asm/tsc.h>
@@ -359,6 +360,27 @@ static int tsc_update_callback(void)
 	return change;
 }
 
+static int __init dmi_mark_tsc_unstable(struct dmi_system_id *d)
+{
+	printk(KERN_NOTICE "%s detected: marking TSC unstable.\n",
+		       d->ident);
+	mark_tsc_unstable();
+	return 0;
+}
+
+/* List of systems that have known TSC problems */
+static struct dmi_system_id __initdata bad_tsc_dmi_table[] = {
+	{
+	 .callback = dmi_mark_tsc_unstable,
+	 .ident = "IBM Thinkpad 380XD",
+	 .matches = {
+		     DMI_MATCH(DMI_BOARD_VENDOR, "IBM"),
+		     DMI_MATCH(DMI_BOARD_NAME, "2635FA0"),
+		     },
+	 },
+	 {}
+};
+
 /*
  * Make an educated guess if the TSC is trustworthy and synchronized
  * over all CPUs.
@@ -376,16 +398,21 @@ static __init int unsynchronized_tsc(voi
  	return num_possible_cpus() > 1;
 }
 
-/* NUMAQ can't use TSC: */
 static int __init init_tsc_clocksource(void)
 {
-	/* TSC initialization is done in arch/i386/kernel/tsc.c */
+
 	if (cpu_has_tsc && tsc_khz && !tsc_disable) {
-		if (unsynchronized_tsc()) /* lower rating if unsynced */
+		/* check blacklist */
+		dmi_check_system(bad_tsc_dmi_table);
+
+		if (unsynchronized_tsc()) /* mark unstable if unsynced */
 			mark_tsc_unstable();
 		current_tsc_khz = tsc_khz;
 		clocksource_tsc.mult = clocksource_khz2mult(current_tsc_khz,
 							clocksource_tsc.shift);
+		/* lower the rating if we already know its unstable: */
+		if (check_tsc_unstable())
+			clocksource_tsc.rating = 50;
 		register_clocksource(&clocksource_tsc);
 	}
 





             reply	other threads:[~2006-01-19 23:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-19 23:23 john stultz [this message]
2006-01-19 23:24 ` john stultz

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=1137712995.27699.124.camel@cog.beaverton.ibm.com \
    --to=johnstul@us.ibm.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®