Browse Source

[xhci] Delay after (possibly) forcing port link state to RxDetect

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>
tags/v1.20.1
Michael Brown 9 years ago
parent
commit
32d20fdd7e
2 changed files with 8 additions and 0 deletions
  1. 5
    0
      src/drivers/usb/xhci.c
  2. 3
    0
      src/drivers/usb/xhci.h

+ 5
- 0
src/drivers/usb/xhci.c View File

@@ -2774,6 +2774,11 @@ static int xhci_hub_open ( struct usb_hub *hub ) {
2774 2774
 		}
2775 2775
 	}
2776 2776
 
2777
+	/* Some xHCI cards seem to require an additional delay after
2778
+	 * setting the link state to RxDetect.
2779
+	 */
2780
+	mdelay ( XHCI_LINK_STATE_DELAY_MS );
2781
+
2777 2782
 	/* Record hub driver private data */
2778 2783
 	usb_hub_set_drvdata ( hub, xhci );
2779 2784
 

+ 3
- 0
src/drivers/usb/xhci.h View File

@@ -236,6 +236,9 @@ enum xhci_default_psi_value {
236 236
 /** Port link state write strobe */
237 237
 #define XHCI_PORTSC_LWS 0x00010000UL
238 238
 
239
+/** Time to delay after writing the port link state */
240
+#define XHCI_LINK_STATE_DELAY_MS 20
241
+
239 242
 /** Connect status change */
240 243
 #define XHCI_PORTSC_CSC 0x00020000UL
241 244
 

Loading…
Cancel
Save