[lkml]   [2017]   [Jul]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 4.12 066/196] xhci: fix 20000ms port resume timeout
4.12-stable review patch.  If anyone has any objections, please let me know.


From: Mathias Nyman <>

commit a54408d0a004757789863d74e29c2297edae0b4d 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 <>
Signed-off-by: Greg Kroah-Hartman <>

drivers/usb/host/xhci-hub.c | 3 +++
1 file changed, 3 insertions(+)

--- a/drivers/usb/host/xhci-hub.c
+++ b/drivers/usb/host/xhci-hub.c
@@ -899,6 +899,9 @@ static u32 xhci_get_port_status(struct u
clear_bit(wIndex, &bus_state->resuming_ports);

set_bit(wIndex, &bus_state->rexit_ports);
+ xhci_test_and_clear_bit(xhci, port_array, wIndex,
xhci_set_link_state(xhci, port_array, wIndex,

 \ /
  Last update: 2017-07-25 21:55    [W:0.542 / U:7.736 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site