summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/pseries/dtl.c
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2009-03-23 17:55:08 +0100
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-03-27 06:58:23 +0100
commit82631f5dd114e52239fb3d1e270a49d37c088b46 (patch)
treec56dd87c9659864f5a3bc5068c0cb877c39bc705 /arch/powerpc/platforms/pseries/dtl.c
parentpowerpc/mm: Introduce early_init_mmu() on 64-bit (diff)
downloadlinux-82631f5dd114e52239fb3d1e270a49d37c088b46.tar.xz
linux-82631f5dd114e52239fb3d1e270a49d37c088b46.zip
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>
Diffstat (limited to 'arch/powerpc/platforms/pseries/dtl.c')
-rw-r--r--arch/powerpc/platforms/pseries/dtl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/pseries/dtl.c b/arch/powerpc/platforms/pseries/dtl.c
index dc9b0f81e60f..fafcaa0e81ef 100644
--- a/arch/powerpc/platforms/pseries/dtl.c
+++ b/arch/powerpc/platforms/pseries/dtl.c
@@ -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;