From 0355478a390846d493d71727301c42f4494362d1 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Sun, 2 Mar 2003 04:37:07 -0800 Subject: [PATCH] [PATCH] Don't panic if TSC is enabled and notsc is used Patch from: john stultz The kernel will currently panic if it was built with CONFIG_X86_TSC and someone boots it with `notsc'. Change it to just print a warning. --- arch/i386/kernel/timers/timer_tsc.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/arch/i386/kernel/timers/timer_tsc.c b/arch/i386/kernel/timers/timer_tsc.c index aedbefce21e16..d2586c096878d 100644 --- a/arch/i386/kernel/timers/timer_tsc.c +++ b/arch/i386/kernel/timers/timer_tsc.c @@ -299,6 +299,7 @@ static int init_tsc(void) return -ENODEV; } +#ifndef CONFIG_X86_TSC /* disable flag for tsc. Takes effect by clearing the TSC cpu flag * in cpu/common.c */ static int __init tsc_setup(char *str) @@ -306,7 +307,14 @@ static int __init tsc_setup(char *str) tsc_disable = 1; return 1; } - +#else +static int __init tsc_setup(char *str) +{ + printk(KERN_WARNING "notsc: Kernel compiled with CONFIG_X86_TSC, " + "cannot disable TSC.\n"); + return 1; +} +#endif __setup("notsc", tsc_setup); -- 2.53.0