x86/tsc: Make CONFIG_X86_TSC=n build work again
authorThomas Gleixner <tglx@linutronix.de>
Tue, 17 Oct 2017 06:49:37 +0000 (08:49 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 17 Oct 2017 06:53:15 +0000 (08:53 +0200)
tsc_async_resets is only available when CONFIG_X86_TSC=y. So a build with
CONFIG_X86_TSC=n breaks:

arch/x86/kernel/tsc.o: In function `tsc_init':
(.init.text+0x87b): undefined reference to `tsc_async_resets'

Add a stub define for the TSC=n case.

Side note: This config switch should simply be removed.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Fixes: 341102c3ef29 ("x86/tsc: Add option that TSC on Socket 0 being non-zero is valid")
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Mike Travis <mike.travis@hpe.com>
arch/x86/include/asm/tsc.h

index 79125f3609c47782039d752a952cfb0d28b0ee55..c016167720b1360e1bd71261d93560fd43a79eca 100644 (file)
@@ -42,7 +42,11 @@ extern unsigned long native_calibrate_tsc(void);
 extern unsigned long long native_sched_clock_from_tsc(u64 tsc);
 
 extern int tsc_clocksource_reliable;
+#ifdef CONFIG_X86_TSC
 extern bool tsc_async_resets;
+#else
+# define tsc_async_resets      false
+#endif
 
 /*
  * Boot-time check whether the TSCs are synchronized across