Skip to content

Commit

Permalink
powerpc: Add write barrier before enabling DTL flags
Browse files Browse the repository at this point in the history
Currently, we don't enforce any ordering for updates to the lppaca
when enabling dtl logging, so we may end up enabling logging before the
index fields have been established.

This change adds a smp_wmb() before doing the actual enable.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
  • Loading branch information
Jeremy Kerr authored and Benjamin Herrenschmidt committed Mar 27, 2009
1 parent 757c74d commit 82631f5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arch/powerpc/platforms/pseries/dtl.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ static int dtl_enable(struct dtl *dtl)
/* set our initial buffer indices */
dtl->last_idx = lppaca[dtl->cpu].dtl_idx = 0;

/* ensure that our updates to the lppaca fields have occurred before
* we actually enable the logging */
smp_wmb();

/* enable event logging */
lppaca[dtl->cpu].dtl_enable_mask = dtl_event_mask;

Expand Down

0 comments on commit 82631f5

Please sign in to comment.