xhci: Add rmb() between reading event validity & event data access.

On weakly-ordered systems, the reading of an event's content must occur
after reading the event's validity.

Signed-off-by: Matt Evans <matt@ozlabs.org>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
This commit is contained in:
Matt Evans 2011-03-29 13:40:51 +11:00 committed by Sarah Sharp
parent 28ccd2962c
commit 92a3da410a

View file

@ -2193,6 +2193,11 @@ static void xhci_handle_event(struct xhci_hcd *xhci)
}
xhci_dbg(xhci, "%s - OS owns TRB\n", __func__);
/*
* 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)) {
case TRB_TYPE(TRB_COMPLETION):