[lkml]   [2019]   [Oct]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH] clocksource: tsc: respect tsc bootparam for clocksource_tsc_early
Introduction of clocksource_tsc_early broke functionality of "tsc=reliable"
and "tsc=nowatchdog" boot params, since clocksource_tsc_early is *always*
registered with CLOCK_SOURCE_MUST_VERIFY and thus put on the watchdog list.

If CPU is very busy during boot, the watchdog clocksource may not be
read frequently enough, resulting in a large difference that is treated as
"negative" by clocksource_delta() and incorrectly truncated to 0.

This false alarm causes TSC to be declared unstable:

clocksource: timekeeping watchdog on CPU1: Marking clocksource
'tsc-early' as unstable because the skew is too large:
clocksource: 'refined-jiffies' wd_now: fffb7019 wd_last: fffb6e28
mask: ffffffff
clocksource: 'tsc-early' cs_now: 52c3918b89d6 cs_last: 52c31d736d2e
mask: ffffffffffffffff
tsc: Marking TSC unstable due to clocksource watchdog

Work around this issue by respecting "tsc=reliable" or "tsc=nowatchdog"
boot params when registering clocksource_tsc_early.

Signed-off-by: Michael Zhivich <>
arch/x86/kernel/tsc.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index c59454c382fd..7e322e2daaf5 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -1505,6 +1505,9 @@ void __init tsc_init(void)

+ if (tsc_clocksource_reliable || no_tsc_watchdog)
+ clocksource_tsc_early.flags &= ~CLOCK_SOURCE_MUST_VERIFY;
clocksource_register_khz(&clocksource_tsc_early, tsc_khz);
 \ /
  Last update: 2019-10-02 16:16    [W:0.055 / U:4.616 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site