diff options
| author | Neeraj Upadhyay <neeraju@codeaurora.org> | 2018-09-05 01:52:07 -0400 |
|---|---|---|
| committer | Thomas Gleixner <tglx@linutronix.de> | 2018-09-06 09:21:37 -0400 |
| commit | f8b7530aa0a1def79c93101216b5b17cf408a70a (patch) | |
| tree | 8fec02ad4caba0c57a6a393069810831baaf4cdd | |
| parent | 60c1f89241d49bacf71035470684a8d7b4bb46ea (diff) | |
cpu/hotplug: Adjust misplaced smb() in cpuhp_thread_fun()
The smp_mb() in cpuhp_thread_fun() is misplaced. It needs to be after the
load of st->should_run to prevent reordering of the later load/stores
w.r.t. the load of st->should_run.
Fixes: 4dddfb5faa61 ("smp/hotplug: Rewrite AP state machine core")
Signed-off-by: Neeraj Upadhyay <neeraju@codeaurora.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra (Intel) <peterz@infraded.org>
Cc: josh@joshtriplett.org
Cc: peterz@infradead.org
Cc: jiangshanlai@gmail.com
Cc: dzickus@redhat.com
Cc: brendan.jackman@arm.com
Cc: malat@debian.org
Cc: mojha@codeaurora.org
Cc: sramana@codeaurora.org
Cc: linux-arm-msm@vger.kernel.org
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/1536126727-11629-1-git-send-email-neeraju@codeaurora.org
| -rw-r--r-- | kernel/cpu.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/cpu.c b/kernel/cpu.c index aa7fe85ad62e..eb4041f78073 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c | |||
| @@ -607,15 +607,15 @@ static void cpuhp_thread_fun(unsigned int cpu) | |||
| 607 | bool bringup = st->bringup; | 607 | bool bringup = st->bringup; |
| 608 | enum cpuhp_state state; | 608 | enum cpuhp_state state; |
| 609 | 609 | ||
| 610 | if (WARN_ON_ONCE(!st->should_run)) | ||
| 611 | return; | ||
| 612 | |||
| 610 | /* | 613 | /* |
| 611 | * ACQUIRE for the cpuhp_should_run() load of ->should_run. Ensures | 614 | * ACQUIRE for the cpuhp_should_run() load of ->should_run. Ensures |
| 612 | * that if we see ->should_run we also see the rest of the state. | 615 | * that if we see ->should_run we also see the rest of the state. |
| 613 | */ | 616 | */ |
| 614 | smp_mb(); | 617 | smp_mb(); |
| 615 | 618 | ||
| 616 | if (WARN_ON_ONCE(!st->should_run)) | ||
| 617 | return; | ||
| 618 | |||
| 619 | cpuhp_lock_acquire(bringup); | 619 | cpuhp_lock_acquire(bringup); |
| 620 | 620 | ||
| 621 | if (st->single) { | 621 | if (st->single) { |
