x86/tsc: Always unregister clocksource_tsc_early
commitc2908cac1b043a6cb8584185b2ca438908873870
authorPeter Zijlstra <peterz@infradead.org>
Mon, 30 Apr 2018 10:00:09 +0000 (30 12:00 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 May 2018 07:53:12 +0000 (9 09:53 +0200)
treea6014759f8c003bcf5e83772e670c4d89b114695
parentc8db8614ead6f6c2de3fccd6ef328385b4bd51c2
x86/tsc: Always unregister clocksource_tsc_early

commit e9088adda13cd23249d4b0abb97ff8a81bf5573a upstream.

Don't leave the tsc-early clocksource registered if it errors out
early.

This was reported by Diego, who on his Core2 era machine got TSC
invalidated while it was running with tsc-early (due to C-states).
This results in keeping tsc-early with very bad effects.

Reported-and-Tested-by: Diego Viola <diego.viola@gmail.com>
Fixes: aa83c45762a2 ("x86/tsc: Introduce early tsc clocksource")
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: len.brown@intel.com
Cc: rjw@rjwysocki.net
Cc: diego.viola@gmail.com
Cc: rui.zhang@intel.com
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20180430100344.350507853@infradead.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kernel/tsc.c