From: Jeremy Kerr Date: Mon, 23 Mar 2009 16:55:08 +0000 (+0000) Subject: powerpc: Add write barrier before enabling DTL flags X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=82631f5dd114e52239fb3d1e270a49d37c088b46;p=linux-beck.git 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 Signed-off-by: Benjamin Herrenschmidt --- 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;