aboutsummaryrefslogtreecommitdiff
path: root/lib/libusb/usb-xhci.c
diff options
context:
space:
mode:
authorNikunj A Dadhania <nikunj@linux.vnet.ibm.com>2015-09-18 14:16:57 +0530
committerAlexey Kardashevskiy <aik@ozlabs.ru>2015-10-06 12:50:31 +1100
commit2a37eb9a6a0c02622ee17c17b6de14362999737d (patch)
tree3c65c1c6467911cd6c50fc037b6c707513773c65 /lib/libusb/usb-xhci.c
parent41c2c5df4f582f2ffab0d5cfe34264f7eb9d0962 (diff)
downloadSLOF-2a37eb9a6a0c02622ee17c17b6de14362999737d.zip
SLOF-2a37eb9a6a0c02622ee17c17b6de14362999737d.tar.gz
SLOF-2a37eb9a6a0c02622ee17c17b6de14362999737d.tar.bz2
usb-xhci: add delay in shutdown path
QEMU implementation of XHCI doesn't implement halt properly. There might be ongoing activities and active DMAs, introduce 50ms delay during shutdown path. Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Diffstat (limited to 'lib/libusb/usb-xhci.c')
-rw-r--r--lib/libusb/usb-xhci.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/libusb/usb-xhci.c b/lib/libusb/usb-xhci.c
index aa8a066..c4ee387 100644
--- a/lib/libusb/usb-xhci.c
+++ b/lib/libusb/usb-xhci.c
@@ -870,6 +870,18 @@ static bool xhci_hcd_exit(struct xhci_hcd *xhcd)
SLOF_dma_map_out(xhcd->dcbaap_dma, (void *)xhcd->dcbaap, XHCI_DCBAAP_MAX_SIZE);
SLOF_dma_free((void *)xhcd->dcbaap, XHCI_DCBAAP_MAX_SIZE);
}
+
+ /*
+ * QEMU implementation of XHCI doesn't implement halt
+ * properly. It basically says that it's halted immediately
+ * but doesn't actually terminate ongoing activities and
+ * DMAs. This needs to be fixed in QEMU.
+ *
+ * For now, wait for 50ms grace time till qemu stops using
+ * this device.
+ */
+ SLOF_msleep(50);
+
return true;
}