aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/tsc.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-08-24 14:52:06 -0400
committerH. Peter Anvin <hpa@zytor.com>2008-08-24 20:16:28 -0400
commit060700b571717c997a2ea5e2049b848fa248ee13 (patch)
tree46bdd7a9eb5cbb95458fc9839270d2e503fa6c4c /arch/x86/kernel/tsc.c
parent8735728ef8dc935c4fb351f913758fdbb62c308d (diff)
x86: do not enable TSC notifier if we don't need it
Impact: crash on non-TSC-equipped CPUs Don't enable the TSC notifier if we *either*: 1. don't have a CPU, or 2. have a CPU with constant TSC. In either of those cases, the notifier is either damaging (1) or useless(2). From: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch/x86/kernel/tsc.c')
-rw-r--r--arch/x86/kernel/tsc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index 46af71676738..9bed5cae4bdc 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -325,6 +325,10 @@ static struct notifier_block time_cpufreq_notifier_block = {
325 325
326static int __init cpufreq_tsc(void) 326static int __init cpufreq_tsc(void)
327{ 327{
328 if (!cpu_has_tsc)
329 return 0;
330 if (boot_cpu_has(X86_FEATURE_CONSTANT_TSC))
331 return 0;
328 cpufreq_register_notifier(&time_cpufreq_notifier_block, 332 cpufreq_register_notifier(&time_cpufreq_notifier_block,
329 CPUFREQ_TRANSITION_NOTIFIER); 333 CPUFREQ_TRANSITION_NOTIFIER);
330 return 0; 334 return 0;