From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753299AbcKSNuX (ORCPT ); Sat, 19 Nov 2016 08:50:23 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:53755 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752795AbcKSNuS (ORCPT ); Sat, 19 Nov 2016 08:50:18 -0500 Message-Id: <20161119134017.892095627@linutronix.de> User-Agent: quilt/0.63-1 Date: Sat, 19 Nov 2016 13:47:40 -0000 From: Thomas Gleixner To: LKML Cc: Ingo Molnar , Peter Zijlstra , x86@kernel.org, Borislav Petkov , Yinghai Lu Subject: [patch 6/8] x86/tsc: Move sync cleanup to a safe place References: <20161119133816.633700010@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Disposition: inline; filename=x86-tsc--Move-sync-cleanup-to-a-safe-place.patch Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- arch/x86/kernel/tsc_sync.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) --- a/arch/x86/kernel/tsc_sync.c +++ b/arch/x86/kernel/tsc_sync.c @@ -252,11 +252,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) { @@ -345,6 +340,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 */