aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/tsc_sync.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2016-11-19 13:47:40 +0000
committerThomas Gleixner <tglx@linutronix.de>2016-11-29 19:23:18 +0100
commit4c5e3c63752162262c42424147f319b8571a20af (patch)
tree1c2f250ac0a0d6361b4be103a03ce432932b1946 /arch/x86/kernel/tsc_sync.c
parentx86/tsc: Sync test only for the first cpu in a package (diff)
downloadlinux-dev-4c5e3c63752162262c42424147f319b8571a20af.tar.xz
linux-dev-4c5e3c63752162262c42424147f319b8571a20af.zip
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 <tglx@linutronix.de> Reviewed-by: Ingo Molnar <mingo@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Yinghai Lu <yinghai@kernel.org> Cc: Borislav Petkov <bp@alien8.de> Link: http://lkml.kernel.org/r/20161119134017.892095627@linutronix.de Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/tsc_sync.c')
-rw-r--r--arch/x86/kernel/tsc_sync.c10
1 files changed, 5 insertions, 5 deletions
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
@@ -267,11 +267,6 @@ void check_tsc_sync_source(int cpu)
}
/*
- * 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:
*/
while (atomic_read(&start_count) != cpus - 1) {
@@ -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 */