From e8ab9a3cec6324942169b2f27110ab3f55cfd568 Mon Sep 17 00:00:00 2001 From: Peter Zijlstra Date: Wed, 29 May 2019 20:36:37 +0000 Subject: [PATCH] UPSTREAM: stop_machine: Fix stop_cpus_in_progress ordering Make sure the entire for loop has stop_cpus_in_progress set. BUG=b:152605392 TEST=run power_VideoCall test (cherry picked from commit 99d84bf8c65a7) Signed-off-by: Peter Zijlstra (Intel) Cc: Aaron Lu Cc: Valentin Schneider Cc: mingo@kernel.org Cc: Phil Auld Cc: Julien Desfossez Cc: Nishanth Aravamudan Link: https://lkml.kernel.org/r/0fd8fd4b99b9b9aa88d8b2dff897f7fd0d88f72c.1559129225.git.vpillai@digitalocean.com Signed-off-by: Joel Fernandes Change-Id: I17b678ba09f877699831702122057d2e0cc7fd43 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/2186280 Reviewed-by: Sonny Rao Reviewed-by: Sean Paul Signed-off-by: UtsavBalar1231 --- kernel/stop_machine.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/stop_machine.c b/kernel/stop_machine.c index 067cb83f37ea..583119e0c51c 100644 --- a/kernel/stop_machine.c +++ b/kernel/stop_machine.c @@ -375,6 +375,7 @@ static bool queue_stop_cpus_work(const struct cpumask *cpumask, */ preempt_disable(); stop_cpus_in_progress = true; + barrier(); for_each_cpu(cpu, cpumask) { work = &per_cpu(cpu_stopper.stop_work, cpu); work->fn = fn; @@ -383,6 +384,7 @@ static bool queue_stop_cpus_work(const struct cpumask *cpumask, if (cpu_stop_queue_work(cpu, work)) queued = true; } + barrier(); stop_cpus_in_progress = false; preempt_enable();