[SLOF] [PATCH] xhci: add memory barrier after filling the trb

Nikunj A Dadhania nikunj at linux.vnet.ibm.com
Mon May 2 14:46:43 AEST 2016


A memory barrier was missing after updating the trb details.

Signed-off-by: Nikunj A Dadhania <nikunj at linux.vnet.ibm.com>
---
 lib/libusb/usb-xhci.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/libusb/usb-xhci.c b/lib/libusb/usb-xhci.c
index 858cd12..070c2ef 100644
--- a/lib/libusb/usb-xhci.c
+++ b/lib/libusb/usb-xhci.c
@@ -973,6 +973,7 @@ static void fill_trb_buff(struct xhci_command_trb *cmd,  uint32_t field1,
 	cycle_state = (val & 0x1) ? 0 : 1;
 	val =  cycle_state | (field4 & ~0x1);
 	cmd->field[3] = cpu_to_le32(val);
+	mb();
 
 	dprintf("CMD %016lx val %08x cycle_state %d field1 %08x, field2  %08x, field3 %08x field4 %08x\n",
 		cmd, val, cycle_state,
-- 
2.5.5



More information about the SLOF mailing list