[PATCH] Re: x86_32 tsc/pit and hrtimers

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jeff Hansen
Date: Wednesday, October 8, 2008 - 2:43 pm

[HRTIMER]: Add highres=noverify option to bypass clocksource verification

This disregards the CLOCK_SOURCE_MUST_VERIFY flag on all clocksources.
This is particularly useful on legacy x86_32 systems that have no ACPI,
LAPIC, or HPET timers, where only TSC and PIT are available.

Thanks to Chris Snook for suggesting this.
---
  include/linux/clocksource.h |    2 ++
  kernel/hrtimer.c            |    2 ++
  kernel/time/clocksource.c   |    3 ++-
  3 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index 55e434f..90ae835 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -104,6 +104,8 @@ extern struct clocksource *clock;	/* current clocksource */
  #define CLOCK_SOURCE_WATCHDOG			0x10
  #define CLOCK_SOURCE_VALID_FOR_HRES		0x20

+extern int clocksource_noverify;
+
  /* simplify initialization of mask field */
  #define CLOCKSOURCE_MASK(bits) (cycle_t)((bits) < 64 ? ((1ULL<<(bits))-1) : -1)

diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index ab80515..2fdf59f 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -476,6 +476,8 @@ static int __init setup_hrtimer_hres(char *str)
  		hrtimer_hres_enabled = 0;
  	else if (!strcmp(str, "on"))
  		hrtimer_hres_enabled = 1;
+	else if (!strcmp(str, "noverify"))
+		clocksource_noverify = 1;
  	else
  		return 0;
  	return 1;
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index dadde53..d3c14c1 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;
+int clocksource_noverify;

  /* clocksource_done_booting - Called near the end of core bootup
   *
@@ -165,7 +166,7 @@ static void clocksource_check_watchdog(struct clocksource *cs)
  	unsigned long flags;

  	spin_lock_irqsave(&watchdog_lock, flags);
-	if (cs->flags & CLOCK_SOURCE_MUST_VERIFY) {
+	if (!clocksource_noverify && cs->flags & CLOCK_SOURCE_MUST_VERIFY) {
  		int started = !list_empty(&watchdog_list);

  		list_add(&cs->wd_list, &watchdog_list);
-- 
1.5.6.4

On Wed, 8 Oct 2008, Chris Snook wrote:

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
x86_32 tsc/pit and hrtimers, Jeff Hansen, (Tue Oct 7, 3:41 pm)
Re: x86_32 tsc/pit and hrtimers, Chris Snook, (Wed Oct 8, 11:41 am)
Re: x86_32 tsc/pit and hrtimers, Jeff Hansen, (Wed Oct 8, 12:46 pm)
Re: x86_32 tsc/pit and hrtimers, Chris Snook, (Wed Oct 8, 1:25 pm)
[PATCH] Re: x86_32 tsc/pit and hrtimers, Jeff Hansen, (Wed Oct 8, 2:43 pm)
Re: [PATCH] Re: x86_32 tsc/pit and hrtimers, Randy.Dunlap, (Wed Oct 8, 2:47 pm)
Re: [PATCH] Re: x86_32 tsc/pit and hrtimers, Chris Snook, (Wed Oct 8, 2:47 pm)
[PATCH] Re: x86_32 tsc/pit and hrtimers, Jeff Hansen, (Wed Oct 8, 2:56 pm)
Re: [PATCH] Re: x86_32 tsc/pit and hrtimers, Thomas Gleixner, (Thu Oct 9, 12:14 am)
Re: x86_32 tsc/pit and hrtimers, Pavel Machek, (Thu Oct 9, 10:20 am)
Re: [PATCH] Re: x86_32 tsc/pit and hrtimers, Chris Snook, (Thu Oct 9, 11:39 am)
Re: [PATCH] Re: x86_32 tsc/pit and hrtimers, Thomas Gleixner, (Thu Oct 9, 12:18 pm)
Re: [PATCH] Re: x86_32 tsc/pit and hrtimers, Jeff Hansen, (Thu Oct 9, 12:45 pm)
Re: [PATCH] Re: x86_32 tsc/pit and hrtimers, Thomas Gleixner, (Thu Oct 9, 12:53 pm)
Re: [PATCH] Re: x86_32 tsc/pit and hrtimers, Alok kataria, (Thu Oct 9, 1:45 pm)
Re: [PATCH] Re: x86_32 tsc/pit and hrtimers, Chris Snook, (Thu Oct 9, 2:03 pm)
[PATCH] Re: x86_32 tsc/pit and hrtimers, Jeff Hansen, (Thu Oct 9, 2:18 pm)
Re: [PATCH] Re: x86_32 tsc/pit and hrtimers, Alok Kataria, (Thu Oct 9, 2:53 pm)
Re: [PATCH] Re: x86_32 tsc/pit and hrtimers, Alok Kataria, (Thu Oct 9, 3:03 pm)
Re: [PATCH] Re: x86_32 tsc/pit and hrtimers, Chris Snook, (Thu Oct 9, 3:50 pm)
Re: [PATCH] Re: x86_32 tsc/pit and hrtimers, Alok Kataria, (Thu Oct 9, 4:22 pm)
Re: [PATCH] Re: x86_32 tsc/pit and hrtimers, Chris Snook, (Thu Oct 9, 4:37 pm)
[PATCH] Re: x86_32 tsc/pit and hrtimers, Jeff Hansen, (Fri Oct 10, 7:24 am)