Skip to content

Commit da35816

Browse files
Jim Dickersongregkh
authored andcommitted
usb: pci-quirks.c: Corrected timeout values used in handshake
commit 114ec3a6f9096d211a4aff4277793ba969a62c73 upstream. Servers were emitting failed handoff messages but were not waiting the full 1 second as designated in section 4.22.1 of the eXtensible Host Controller Interface specifications. The handshake was using wrong units so calls were made with milliseconds not microseconds. Comments referenced 5 seconds not 1 second as in specs. The wrong units were also corrected in a second handshake call. Signed-off-by: Jim Dickerson <jim.dickerson@hpe.com> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 46c7b1f commit da35816

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

drivers/usb/host/pci-quirks.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -969,7 +969,7 @@ EXPORT_SYMBOL_GPL(usb_disable_xhci_ports);
969969
*
970970
* Takes care of the handoff between the Pre-OS (i.e. BIOS) and the OS.
971971
* It signals to the BIOS that the OS wants control of the host controller,
972-
* and then waits 5 seconds for the BIOS to hand over control.
972+
* and then waits 1 second for the BIOS to hand over control.
973973
* If we timeout, assume the BIOS is broken and take control anyway.
974974
*/
975975
static void quirk_usb_handoff_xhci(struct pci_dev *pdev)
@@ -1015,9 +1015,9 @@ static void quirk_usb_handoff_xhci(struct pci_dev *pdev)
10151015
if (val & XHCI_HC_BIOS_OWNED) {
10161016
writel(val | XHCI_HC_OS_OWNED, base + ext_cap_offset);
10171017

1018-
/* Wait for 5 seconds with 10 microsecond polling interval */
1018+
/* Wait for 1 second with 10 microsecond polling interval */
10191019
timeout = handshake(base + ext_cap_offset, XHCI_HC_BIOS_OWNED,
1020-
0, 5000, 10);
1020+
0, 1000000, 10);
10211021

10221022
/* Assume a buggy BIOS and take HC ownership anyway */
10231023
if (timeout) {
@@ -1046,7 +1046,7 @@ static void quirk_usb_handoff_xhci(struct pci_dev *pdev)
10461046
* operational or runtime registers. Wait 5 seconds and no more.
10471047
*/
10481048
timeout = handshake(op_reg_base + XHCI_STS_OFFSET, XHCI_STS_CNR, 0,
1049-
5000, 10);
1049+
5000000, 10);
10501050
/* Assume a buggy HC and start HC initialization anyway */
10511051
if (timeout) {
10521052
val = readl(op_reg_base + XHCI_STS_OFFSET);

0 commit comments

Comments
 (0)