Re: [PATCH v2 3/5] xhci: Add rmb() between reading event validity & event data access.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux