From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: sarah.a.sharp@linux.intel.com, linuxppc-dev@ozlabs.org,
linux-usb@vger.kernel.org, Matt Evans <matt@ozlabs.org>
Subject: Re: [PATCH v2 3/5] xhci: Add rmb() between reading event validity & event data access.
Date: Wed, 30 Mar 2011 08:23:49 +1100 [thread overview]
Message-ID: <1301433829.2402.694.camel@pasglop> (raw)
In-Reply-To: <201103291156.47822.dmitry.torokhov@gmail.com>
On Tue, 2011-03-29 at 11:56 -0700, Dmitry Torokhov wrote:
> > + /*
> > + * Barrier between reading the TRB_CYCLE (valid) flag above
> and any
> > + * speculative reads of the event's flags/data below.
> > + */
> > + rmb();
> > /* FIXME: Handle more event types. */
> > switch ((le32_to_cpu(event->event_cmd.flags) &
> TRB_TYPE_BITMASK)) {
>
> Isn't it the same memory that is being read the first time around? How
> reordering could happen here?
We don't try to enforce ordering specifically with the subsequent read
of the flags that is visible in the snipped above (indeed that's the
same address and so hopefully should be in program order), but all
subsequent reads which could have been performed speculatively such as
the rest of the event and including whatever other in memory information
the chip might have updated prior to sending the event.
Cheers,
Ben.
prev parent reply other threads:[~2011-03-29 21:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-25 7:44 [PATCH 3/5] xhci: Add rmb() between reading event validity & event data access Matt Evans
2011-03-25 23:11 ` Segher Boessenkool
2011-03-28 4:52 ` [PATCH v2 " Matt Evans
2011-03-28 22:20 ` Sarah Sharp
2011-03-29 18:56 ` Dmitry Torokhov
2011-03-29 21:23 ` Benjamin Herrenschmidt [this message]
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=1301433829.2402.694.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-usb@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=matt@ozlabs.org \
--cc=sarah.a.sharp@linux.intel.com \
/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).