powerpc: Add write barrier before enabling DTL flags
authorJeremy Kerr <jk@ozlabs.org>
Mon, 23 Mar 2009 16:55:08 +0000 (16:55 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Fri, 27 Mar 2009 05:58:23 +0000 (16:58 +1100)
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>
arch/powerpc/platforms/pseries/dtl.c

index dc9b0f81e60f9420e0129cfa5bf68ca1c6185a41..fafcaa0e81ef593c6ed346493ed76926f21120c5 100644 (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;