powerpc: Add write barrier before enabling DTL flags

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>
This commit is contained in:
Jeremy Kerr 2009-03-23 16:55:08 +00:00 committed by Benjamin Herrenschmidt
parent 757c74d298
commit 82631f5dd1

View File

@ -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;