Skip to content

Commit 09364c7

Browse files
matnymangregkh
authored andcommitted
xhci: fix 20000ms port resume timeout
commit a54408d upstream. A uncleared PLC (port link change) bit will prevent furuther port event interrupts for that port. Leaving it uncleared caused get_port_status() to timeout after 20000ms while waiting to get the final port event interrupt for resume -> U0 state change. This is a targeted fix for a specific case where we get a port resume event racing with xhci resume. The port event interrupt handler notices xHC is not yet running and bails out early, leaving PLC uncleared. The whole xhci port resuming needs more attention, but while working on it it anyways makes sense to always ensure PLC is cleared in get_port_status before setting a new link state and waiting for its completion. Signed-off-by: Mathias Nyman <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 8294448 commit 09364c7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/usb/host/xhci-hub.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -768,6 +768,9 @@ static u32 xhci_get_port_status(struct usb_hcd *hcd,
768768
clear_bit(wIndex, &bus_state->resuming_ports);
769769

770770
set_bit(wIndex, &bus_state->rexit_ports);
771+
772+
xhci_test_and_clear_bit(xhci, port_array, wIndex,
773+
PORT_PLC);
771774
xhci_set_link_state(xhci, port_array, wIndex,
772775
XDEV_U0);
773776

0 commit comments

Comments
 (0)