stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "xhci: fix 20000ms port resume timeout" has been added to the 4.12-stable tree
@ 2017-07-25  0:05 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-07-25  0:05 UTC (permalink / raw)
  To: mathias.nyman, gregkh; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    xhci: fix 20000ms port resume timeout

to the 4.12-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     xhci-fix-20000ms-port-resume-timeout.patch
and it can be found in the queue-4.12 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From a54408d0a004757789863d74e29c2297edae0b4d Mon Sep 17 00:00:00 2001
From: Mathias Nyman <mathias.nyman@linux.intel.com>
Date: Thu, 20 Jul 2017 14:48:29 +0300
Subject: xhci: fix 20000ms port resume timeout

From: Mathias Nyman <mathias.nyman@linux.intel.com>

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 <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 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,
+						PORT_PLC);
 			xhci_set_link_state(xhci, port_array, wIndex,
 					XDEV_U0);
 


Patches currently in stable-queue which might be from mathias.nyman@linux.intel.com are

queue-4.12/xhci-fix-memleak-in-xhci_run.patch
queue-4.12/usb-xhci-fix-spinlock-recursion-for-usb2-test-mode.patch
queue-4.12/xhci-fix-null-pointer-dereference-when-cleaning-up-streams-for-removed-host.patch
queue-4.12/xhci-fix-20000ms-port-resume-timeout.patch
queue-4.12/xhci-bad-ethernet-performance-plugged-in-asm1042a-host.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-07-25  0:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-25  0:05 Patch "xhci: fix 20000ms port resume timeout" has been added to the 4.12-stable tree gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).