提交 b7116ebc 编写于 作者: S Sarah Sharp 提交者: Greg Kroah-Hartman

USB: xhci: Avoid compiler reordering in Link TRB giveback.

Force the compiler to write the cycle bit of the Link TRB last.  This
ensures that the hardware doesn't think it owns the Link TRB before we set
the chain bit.  Reported by Oliver in this thread:
	http://marc.info/?l=linux-usb&m=124091532410219&w=2Reported-by: NOliver Neukum <oliver@neukum.org>
Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 c96a2b81
......@@ -183,13 +183,14 @@ static void inc_enq(struct xhci_hcd *xhci, struct xhci_ring *ring, bool consumer
while (last_trb(xhci, ring, ring->enq_seg, next)) {
if (!consumer) {
if (ring != xhci->event_ring) {
next->link.control &= ~TRB_CHAIN;
next->link.control |= chain;
/* Give this link TRB to the hardware */
wmb();
if (next->link.control & TRB_CYCLE)
next->link.control &= (u32) ~TRB_CYCLE;
else
next->link.control |= (u32) TRB_CYCLE;
next->link.control &= ~TRB_CHAIN;
next->link.control |= chain;
}
/* Toggle the cycle bit after the last ring segment. */
if (last_trb_on_last_seg(xhci, ring, ring->enq_seg, next)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册