public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Michael Ellerman <michael@ellerman•id.au>
To: Jeremy Kerr <jk@ozlabs•org>
Cc: linuxppc-dev@ozlabs•org
Subject: Re: [PATCH] powerpc: Add write barrier before enabling DTL flags
Date: Tue, 24 Mar 2009 16:53:26 +1100	[thread overview]
Message-ID: <1237874006.6478.284.camel@localhost> (raw)
In-Reply-To: <1237863308.620048.912148989400.1.gpush@pingu>

[-- Attachment #1: Type: text/plain, Size: 1284 bytes --]

On Tue, 2009-03-24 at 13:55 +1100, Jeremy Kerr wrote:
> 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();

Wouldn't this still be a problem on a UP kernel?

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

  reply	other threads:[~2009-03-24  5:53 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 ` [PATCH] powerpc: Add write barrier before enabling DTL flags Jeremy Kerr
2009-03-24  5:53   ` Michael Ellerman [this message]
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=1237874006.6478.284.camel@localhost \
    --to=michael@ellerman$(echo .)id.au \
    --cc=jk@ozlabs$(echo .)org \
    --cc=linuxppc-dev@ozlabs$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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