From: Jeremy Kerr <jk@ozlabs.org>
To: Ben Herrenschmidt <benh@kernel.crashing.org>
Cc: linuxppc-dev@ozlabs.org
Subject: [PATCH] powerpc: Add write barrier before enabling DTL flags
Date: Tue, 24 Mar 2009 13:55:08 +1100 [thread overview]
Message-ID: <1237863308.620048.912148989400.1.gpush@pingu> (raw)
In-Reply-To: <<1236830152.729279.468331899806.3.gpush@pingu>>
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>
---
arch/powerpc/platforms/pseries/dtl.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/powerpc/platforms/pseries/dtl.c b/arch/powerpc/platforms/pseries/dtl.c
index dc9b0f8..fafcaa0 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;
next prev parent reply other threads:[~2009-03-24 2:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <<1236830152.729279.468331899806.3.gpush@pingu>
2009-03-24 2:40 ` [PATCH v2] powerpc: Add virtual processor dispatch trace log Jeremy Kerr
2009-03-24 2:55 ` Jeremy Kerr [this message]
2009-03-24 5:53 ` [PATCH] powerpc: Add write barrier before enabling DTL flags Michael Ellerman
2009-03-24 5:59 ` Jeremy Kerr
2009-03-25 0:44 ` Michael Ellerman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1237863308.620048.912148989400.1.gpush@pingu \
--to=jk@ozlabs.org \
--cc=benh@kernel.crashing.org \
--cc=linuxppc-dev@ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox