public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ben Greear <greearb@candelatech.com>
To: linux-kernel <linux-kernel@vger.kernel.org>
Cc: rusty@rustcorp.com.au
Subject: PATCH:  Allow user to force 'tsc' to be treated as stable.
Date: Thu, 05 Feb 2009 11:49:25 -0800	[thread overview]
Message-ID: <498B42C5.7010905@candelatech.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 316 bytes --]

Allow user to force TSC as stable clock-source.
Works around BIOS issues in the FWA-7304 (Via CN700 chipset)
system, and possibly others.

This is against 2.6.29-rc3.

Signed-Off-By:  Ben Greear<greearb@candelatech.com>

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


[-- Attachment #2: patch0.patch --]
[-- Type: text/x-patch, Size: 1731 bytes --]

diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index ca89e15..0578fcb 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -54,6 +54,7 @@ static LIST_HEAD(clocksource_list);
 static DEFINE_SPINLOCK(clocksource_lock);
 static char override_name[32];
 static int finished_booting;
+static int force_tsc_stable;
 
 /* clocksource_done_booting - Called near the end of core bootup
  *
@@ -82,6 +83,14 @@ static unsigned long watchdog_resumed;
 #define WATCHDOG_INTERVAL (HZ >> 1)
 #define WATCHDOG_THRESHOLD (NSEC_PER_SEC >> 4)
 
+static int __init parse_force_tsc_stable(char *arg)
+{
+	force_tsc_stable = 1;
+	return 0;
+}
+early_param("force_tsc_stable", parse_force_tsc_stable);
+
+
 static void clocksource_ratewd(struct clocksource *cs, int64_t delta)
 {
 	if (delta > -WATCHDOG_THRESHOLD && delta < WATCHDOG_THRESHOLD)
@@ -89,9 +98,16 @@ static void clocksource_ratewd(struct clocksource *cs, int64_t delta)
 
 	printk(KERN_WARNING "Clocksource %s unstable (delta = %Ld ns)\n",
 	       cs->name, delta);
-	cs->flags &= ~(CLOCK_SOURCE_VALID_FOR_HRES | CLOCK_SOURCE_WATCHDOG);
-	clocksource_change_rating(cs, 0);
-	list_del(&cs->wd_list);
+	if (force_tsc_stable && (strcmp(cs->name, "tsc") == 0))
+		printk(KERN_WARNING "Forcing tsc to be treated as stable due to force_tsc_stable=1\n");
+	else {
+		printk(KERN_WARNING "  This clock is no longer valid for WATCHDOG or HIGH-RES.\n");
+		if (strcmp(cs->name, "tsc") == 0)
+			printk(KERN_WARNING "  Use force_tsc_stable=1 to override.\n");
+		cs->flags &= ~(CLOCK_SOURCE_VALID_FOR_HRES | CLOCK_SOURCE_WATCHDOG);
+		clocksource_change_rating(cs, 0);
+		list_del(&cs->wd_list);
+	}
 }
 
 static void clocksource_watchdog(unsigned long data)

             reply	other threads:[~2009-02-05 19:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-05 19:49 Ben Greear [this message]
2009-02-05 19:59 ` PATCH: Allow user to force 'tsc' to be treated as stable Ingo Molnar
2009-02-05 20:38   ` Ben Greear
2009-02-05 21:02     ` Ingo Molnar
2009-02-05 21:18 ` Frans Pop
2009-02-06 14:36 ` Jiri Kosina
2009-02-06 17:52   ` Ben Greear
2009-02-06 19:40     ` Thomas Gleixner
2009-02-06 23:24     ` Jiri Kosina

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=498B42C5.7010905@candelatech.com \
    --to=greearb@candelatech.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    /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