[PATCH] usb: ehci: fix update qtd->token in qh_append_tds

Ming Lei ming.lei at canonical.com
Sat Aug 27 13:20:27 EDT 2011


On Sun, Aug 28, 2011 at 12:57 AM, Ming Lei <ming.lei at canonical.com> wrote:

>> Are you sure?  Have you read the documentation about memory barriers to
>> confirm this?
> I read the doc again, :-), and it mentions few about mb/wmb/rmb, I think
> my above description is still not correct. Generally speaking, mb only
> means there is a order between two accesses.
> Now I think only one mb() after 'dummy->hw_token = token;' is enough:
> HC will read the up-to-date value of qtd->hw_token after mb() is executed
> because of the effect of the mb(), which should be guaranteed by mb.

Looks like there is still another similar problem in qh_link_async():
the last wmb
should be changed into mb, because HC will read 'head->hw->hw_next' from qh
descriptor and this pointer in qh is read only for HC. But this problem can't be
observed on ARM, since wmb on ARM is same with mb.

Ming Lei

More information about the linux-arm-kernel mailing list