Skip to content

Commit

Permalink
MIPS: CMP: Fix memory barriers for correct operation of amon_cpu_start
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Dearman ([email protected])
Signed-off-by: Ralf Baechle <[email protected]>
  • Loading branch information
chrisdearman authored and ralfbaechle committed Nov 2, 2009
1 parent cea2be4 commit 2ee0a42
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions arch/mips/mti-malta/malta-amon.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,12 @@ void amon_cpu_start(int cpu,
launch->sp = sp;
launch->a0 = a0;

/* Make sure target sees parameters before the go bit */
smp_mb();

smp_wmb(); /* Target must see parameters before go */
launch->flags |= LAUNCH_FGO;
smp_wmb(); /* Target must see go before we poll */

while ((launch->flags & LAUNCH_FGONE) == 0)
;
smp_rmb(); /* Target will be updating flags soon */
pr_debug("launch: cpu%d gone!\n", cpu);
}

0 comments on commit 2ee0a42

Please sign in to comment.