Blob Blame History Raw
From: Thomas Gleixner <tglx@linutronix.de>
Subject: x86/tsc: Make CONFIG_X86_TSC=n build work again
Git-commit: c0fc9b1350a317da22b310d68117b0d01cb9065e
Patch-mainline: v4.15-rc1
References: bsc#1082579
Acked-by: Jiri Bohac <jbohac@suse.cz>

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 |    4 ++++
 1 file changed, 4 insertions(+)

--- a/arch/x86/include/asm/tsc.h
+++ b/arch/x86/include/asm/tsc.h
@@ -41,7 +41,11 @@ extern unsigned long native_calibrate_ts
 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