Skip to content

Commit

Permalink
[PATCH] hpet: use read_timer_tsc only when CPU has TSC
Browse files Browse the repository at this point in the history
Only use read_timer_tsc only when CPU has TSC.  Thanks to Andrea for
pointing this out.  Should not be issue on any platforms as all recent
systems that has HPET also has CPUs that supports TSC.  The patch is still
required for correctness.

Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Venkatesh Pallipadi authored and Linus Torvalds committed Sep 5, 2005
1 parent 869f96a commit 4116c52
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion arch/i386/kernel/timers/timer_hpet.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ static void delay_hpet(unsigned long loops)
} while ((hpet_end - hpet_start) < (loops));
}

static struct timer_opts timer_hpet;

static int __init init_hpet(char* override)
{
unsigned long result, remain;
Expand Down Expand Up @@ -163,6 +165,8 @@ static int __init init_hpet(char* override)
}
set_cyc2ns_scale(cpu_khz/1000);
}
/* set this only when cpu_has_tsc */
timer_hpet.read_timer = read_timer_tsc;
}

/*
Expand All @@ -186,7 +190,6 @@ static struct timer_opts timer_hpet __read_mostly = {
.get_offset = get_offset_hpet,
.monotonic_clock = monotonic_clock_hpet,
.delay = delay_hpet,
.read_timer = read_timer_tsc,
};

struct init_timer_opts __initdata timer_hpet_init = {
Expand Down

0 comments on commit 4116c52

Please sign in to comment.