Skip to content

Commit f8b7530

Browse files
Neeraj UpadhyayKAGA-KOKO
authored andcommitted
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: 4dddfb5 ("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
1 parent 60c1f89 commit f8b7530

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

kernel/cpu.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -607,15 +607,15 @@ static void cpuhp_thread_fun(unsigned int cpu)
607607
bool bringup = st->bringup;
608608
enum cpuhp_state state;
609609

610+
if (WARN_ON_ONCE(!st->should_run))
611+
return;
612+
610613
/*
611614
* ACQUIRE for the cpuhp_should_run() load of ->should_run. Ensures
612615
* that if we see ->should_run we also see the rest of the state.
613616
*/
614617
smp_mb();
615618

616-
if (WARN_ON_ONCE(!st->should_run))
617-
return;
618-
619619
cpuhp_lock_acquire(bringup);
620620

621621
if (st->single) {

0 commit comments

Comments
 (0)