From: Paul Mackerras <paulus@samba.org>
To: Olof Johansson <olof@lixom.net>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [PATCH] powerpc: Fix race in the pasemi timebase calibration
Date: Wed, 22 Aug 2007 11:27:33 +1000 [thread overview]
Message-ID: <18123.37125.712301.914626@cargo.ozlabs.ibm.com> (raw)
In-Reply-To: <20070821220631.GA4304@lixom.net>
Olof Johansson writes:
> Make sure the new timebase value is available by the time take_timebase
> completes. Otherwise take_timebase might race with give_timebase,
> causing severe badness when the value later is modified (think looong
> hang trying to catch up with a very large number of lost ticks).
OK.
> @@ -61,6 +62,7 @@ static void __devinit pas_give_timebase(
> mtspr(SPRN_TBCTL, TBCTL_UPDATE_LOWER | (tb & 0xffffffff));
> mtspr(SPRN_TBCTL, TBCTL_UPDATE_UPPER | (tb >> 32));
> mtspr(SPRN_TBCTL, TBCTL_RESTART);
> + timebase_avail = 1;
No memory barrier before setting timebase_avail? Shouldn't there be
one?
Actually I don't understand that code at all. Your give_timebase
seems to freeze the timebase, read it, set it to the same value and
restart, all without synchronizing with the other cpu, and your
take_timebase does nothing except print the timebase. How does that
work?
Regards,
Paul.
next prev parent reply other threads:[~2007-08-22 1:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-21 22:06 [PATCH] powerpc: Fix race in the pasemi timebase calibration Olof Johansson
2007-08-22 1:27 ` Paul Mackerras [this message]
2007-08-22 2:12 ` Olof Johansson
2007-08-22 2:26 ` [PATCH] powerpc: Rework SMP timebase handoff for pasemi Olof Johansson
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=18123.37125.712301.914626@cargo.ozlabs.ibm.com \
--to=paulus@samba.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=olof@lixom.net \
/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;
as well as URLs for NNTP newsgroup(s).