[PATCH] usb: xhci: Add 2nd memory barrier to giveback_first_trb()

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

 



There needs to be a wmb() barrier between the write to the cycle bit
in the first TRB and the write to the doorbell register.

Since it isn't needed in the other places the doobell is rung
(because the ring contents haven't been changed) add it to
giveback_first_trb() rather than somewhere later.

Signed-off-by: David Laight <david.laight@xxxxxxxxxx>
---
This patch will only apply cleanly if my earlier patch that affects
the previous line has also been applied.

 drivers/usb/host/xhci-ring.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 35dfed0..8bce4c3 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -3136,6 +3136,7 @@ static void giveback_first_trb(struct xhci_hcd *xhci, int slot_id,
 	 */
 	wmb();
 	start_trb->field[3] ^= cpu_to_le32(TRB_CYCLE);
+	wmb();
 	xhci_ring_ep_doorbell(xhci, slot_id, ep_index, stream_id);
 }
 
-- 
1.8.1.2



--
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