]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[xhci] Delay after (possibly) forcing port link state to RxDetect
authorMichael Brown <mcb30@ipxe.org>
Wed, 11 Feb 2015 11:18:35 +0000 (11:18 +0000)
committerMichael Brown <mcb30@ipxe.org>
Wed, 11 Feb 2015 11:18:35 +0000 (11:18 +0000)
Some xHCI controllers (observed with a Renesas Electronics PCIe USB3
card) seem to require a delay after forcing the link state of USB3
ports to RxDetect.  Omitting this delay causes strange behaviour
including system lockups.

Add an unconditional 20ms delay after writing the port link states.
This seems to be sufficient to avoid the problem.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/drivers/usb/xhci.c
src/drivers/usb/xhci.h

index bf8cf1c8ae04126d3ab492c30fb76d5b2c48cf86..396d943dcf2abbc3ce27754f159fe24e8a6a044d 100644 (file)
@@ -2774,6 +2774,11 @@ static int xhci_hub_open ( struct usb_hub *hub ) {
                }
        }
 
+       /* Some xHCI cards seem to require an additional delay after
+        * setting the link state to RxDetect.
+        */
+       mdelay ( XHCI_LINK_STATE_DELAY_MS );
+
        /* Record hub driver private data */
        usb_hub_set_drvdata ( hub, xhci );
 
index 186ff27d00c23c67df16a82f7d38f1bcc487d55a..ec951bd61f35ec4680f9d35743186506a629731e 100644 (file)
@@ -236,6 +236,9 @@ enum xhci_default_psi_value {
 /** Port link state write strobe */
 #define XHCI_PORTSC_LWS 0x00010000UL
 
+/** Time to delay after writing the port link state */
+#define XHCI_LINK_STATE_DELAY_MS 20
+
 /** Connect status change */
 #define XHCI_PORTSC_CSC 0x00020000UL