From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org,
Mathias Nyman <mathias.nyman@linux.intel.com>,
Alan Stern <stern@rowland.harvard.edu>
Subject: [PATCH 3.18 06/20] usb: hub: Allow reset retry for USB2 devices on connect bounce
Date: Tue, 24 Oct 2017 14:57:33 +0200 [thread overview]
Message-ID: <20171024125652.144396128@linuxfoundation.org> (raw)
In-Reply-To: <20171024125651.887979850@linuxfoundation.org>
3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mathias Nyman <mathias.nyman@linux.intel.com>
commit 1ac7db63333db1eeff901bfd6bbcd502b4634fa4 upstream.
If the connect status change is set during reset signaling, but
the status remains connected just retry port reset.
This solves an issue with connecting a 90W HP Thunderbolt 3 dock
with a Lenovo Carbon x1 (5th generation) which causes a 30min loop
of a high speed device being re-discovererd before usb ports starts
working.
[...]
[ 389.023845] usb 3-1: new high-speed USB device number 55 using xhci_hcd
[ 389.491841] usb 3-1: new high-speed USB device number 56 using xhci_hcd
[ 389.959928] usb 3-1: new high-speed USB device number 57 using xhci_hcd
[...]
This is caused by a high speed device that doesn't successfully go to the
enabled state after the second port reset. Instead the connection bounces
(connected, with connect status change), bailing out completely from
enumeration just to restart from scratch.
Link: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1716332
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/core/hub.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -2667,13 +2667,16 @@ static int hub_port_wait_reset(struct us
if (!(portstatus & USB_PORT_STAT_CONNECTION))
return -ENOTCONN;
- /* bomb out completely if the connection bounced. A USB 3.0
- * connection may bounce if multiple warm resets were issued,
+ /* Retry if connect change is set but status is still connected.
+ * A USB 3.0 connection may bounce if multiple warm resets were issued,
* but the device may have successfully re-connected. Ignore it.
*/
if (!hub_is_superspeed(hub->hdev) &&
- (portchange & USB_PORT_STAT_C_CONNECTION))
- return -ENOTCONN;
+ (portchange & USB_PORT_STAT_C_CONNECTION)) {
+ usb_clear_port_feature(hub->hdev, port1,
+ USB_PORT_FEAT_C_CONNECTION);
+ return -EAGAIN;
+ }
if (!(portstatus & USB_PORT_STAT_ENABLE))
return -EBUSY;
next prev parent reply other threads:[~2017-10-24 12:57 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-24 12:57 [PATCH 3.18 00/20] 3.18.78-stable review Greg Kroah-Hartman
2017-10-24 12:57 ` [PATCH 3.18 01/20] USB: devio: Revert "USB: devio: Dont corrupt user memory" Greg Kroah-Hartman
2017-10-24 12:57 ` [PATCH 3.18 02/20] USB: core: fix out-of-bounds access bug in usb_get_bos_descriptor() Greg Kroah-Hartman
2017-10-24 12:57 ` [PATCH 3.18 03/20] USB: serial: metro-usb: add MS7820 device id Greg Kroah-Hartman
2017-10-24 12:57 ` [PATCH 3.18 04/20] usb: cdc_acm: Add quirk for Elatec TWN3 Greg Kroah-Hartman
2017-10-24 12:57 ` Greg Kroah-Hartman [this message]
2017-10-24 12:57 ` [PATCH 3.18 07/20] can: gs_usb: fix busy loop if no more TX context is available Greg Kroah-Hartman
2017-10-24 12:57 ` [PATCH 3.18 09/20] ALSA: seq: Enable use locking in all configurations Greg Kroah-Hartman
2017-10-24 12:57 ` [PATCH 3.18 10/20] ALSA: hda: Remove superfluous - added by printk conversion Greg Kroah-Hartman
2017-10-24 12:57 ` [PATCH 3.18 11/20] i2c: ismt: Separate I2C block read from SMBus block read Greg Kroah-Hartman
2017-10-24 12:57 ` [PATCH 3.18 12/20] brcmsmac: make some local variables static const to reduce stack size Greg Kroah-Hartman
2017-10-24 12:57 ` [PATCH 3.18 13/20] bus: mbus: fix window size calculation for 4GB windows Greg Kroah-Hartman
2017-10-24 12:57 ` [PATCH 3.18 14/20] KEYS: encrypted: fix dereference of NULL user_key_payload Greg Kroah-Hartman
2017-10-24 12:57 ` [PATCH 3.18 15/20] lib/digsig: " Greg Kroah-Hartman
2017-10-24 12:57 ` [PATCH 3.18 16/20] KEYS: dont let add_key() update an uninstantiated key Greg Kroah-Hartman
2017-10-24 12:57 ` [PATCH 3.18 18/20] parisc: Avoid trashing sr2 and sr3 in LWS code Greg Kroah-Hartman
2017-10-24 12:57 ` [PATCH 3.18 19/20] parisc: Fix double-word compare and exchange in LWS code on 32-bit kernels Greg Kroah-Hartman
2017-10-24 12:57 ` [PATCH 3.18 20/20] af_packet: dont pass empty blocks for PACKET_V3 Greg Kroah-Hartman
2017-10-24 21:27 ` [PATCH 3.18 00/20] 3.18.78-stable review Guenter Roeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171024125652.144396128@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mathias.nyman@linux.intel.com \
--cc=stable@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).