From: Thomas Gleixner Date: Sat, 19 Nov 2016 13:47:40 +0000 (+0000) Subject: x86/tsc: Move sync cleanup to a safe place X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4c5e3c63752162262c42424147f319b8571a20af;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git x86/tsc: Move sync cleanup to a safe place Cleaning up the stop marker on the control CPU is wrong when we want to add retry support. Move the cleanup to the starting CPU. Signed-off-by: Thomas Gleixner Reviewed-by: Ingo Molnar Cc: Peter Zijlstra Cc: Yinghai Lu Cc: Borislav Petkov Link: http://lkml.kernel.org/r/20161119134017.892095627@linutronix.de Signed-off-by: Thomas Gleixner --- diff --git a/arch/x86/kernel/tsc_sync.c b/arch/x86/kernel/tsc_sync.c index fdb3b7befc47..8f394eeb936e 100644 --- a/arch/x86/kernel/tsc_sync.c +++ b/arch/x86/kernel/tsc_sync.c @@ -266,11 +266,6 @@ void check_tsc_sync_source(int cpu) return; } - /* - * Reset it - in case this is a second bootup: - */ - atomic_set(&stop_count, 0); - /* * Wait for the target to start or to skip the test: */ @@ -360,6 +355,11 @@ void check_tsc_sync_target(void) */ while (atomic_read(&stop_count) != cpus) cpu_relax(); + + /* + * Reset it for the next sync test: + */ + atomic_set(&stop_count, 0); } #endif /* CONFIG_SMP */