[SRU][B][E][PATCH 1/1] UBUNTU: SAUCE: Reapply "usb: handle warm-reset port requests on hub resume"

Matthew Ruffell matthew.ruffell at canonical.com
Fri Jul 24 04:36:49 UTC 2020


BugLink: https://bugs.launchpad.net/bugs/1859873

This reapplies upstream commit 4fdc1790e6a9ef22399c6bc6e63b80f4609f3b7e.

Our investigation has concluded that this commit does not introduce a
regression. The root cause turned out to be a defective batch of USB
cables which had their Tx and Rx lines mixed up. This commit simply
helps discover that there is a USB3 device in SS_INVALID link state,
caused by non spec compliant cables.

No amount of warm resets can correct signals being sent down the wrong
wires.

Signed-off-by: Matthew Ruffell <matthew.ruffell at canonical.com>
---
 drivers/usb/core/hub.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index b99602789ca2..7a27237f6b67 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -107,6 +107,8 @@ EXPORT_SYMBOL_GPL(ehci_cf_port_reset_rwsem);
 static void hub_release(struct kref *kref);
 static int usb_reset_and_verify_device(struct usb_device *udev);
 static int hub_port_disable(struct usb_hub *hub, int port1, int set_state);
+static bool hub_port_warm_reset_required(struct usb_hub *hub, int port1,
+		u16 portstatus);
 
 static inline char *portspeed(struct usb_hub *hub, int portstatus)
 {
@@ -1117,6 +1119,11 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type)
 						   USB_PORT_FEAT_ENABLE);
 		}
 
+		/* Make sure a warm-reset request is handled by port_event */
+		if (type == HUB_RESUME &&
+		    hub_port_warm_reset_required(hub, port1, portstatus))
+			set_bit(port1, hub->event_bits);
+
 		/*
 		 * Add debounce if USB3 link is in polling/link training state.
 		 * Link will automatically transition to Enabled state after
-- 
2.25.1




More information about the kernel-team mailing list