On Fri, Mar 26, 2021 at 12:03:41PM +0800, LeoLiu-oc wrote:
commit 4fdc1790e6a9ef22399c6bc6e63b80f4609f3b7e
upstream.
On plug-in of my USB-C device, its USB_SS_PORT_LS_SS_INACTIVE
link state bit is set. Greping all the kernel for this bit shows
that the port status requests a warm-reset this way.
This just happens, if its the only device on the root hub, the hub
therefore resumes and the HCDs status_urb isn't yet available.
If a warm-reset request is detected, this sets the hubs event_bits,
which will prevent any auto-suspend and allows the hubs workqueue
to warm-reset the port later in port_event.
v1->v2:
-Resubmit the patch according to the rule of Backport patch.
Suggestion: unless very important information been given in the
changelog, such as design change, mass rewrite, etc, in normal
situation, we'd suggest put the changelogs under '---' line, which
makes them to be visible to reviewers and be invisible when
commiting the patch.
Thanks,
Caspar
Signed-off-by: LeoLiu-oc <LeoLiu-oc(a)zhaoxin.com>
---
drivers/usb/core/hub.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index b33ec768404b..22e233afc6f6 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -1128,6 +1128,11 @@ static void hub_activate(struct usb_hub *hub,
enum hub_activation_type type)
USB_SS_PORT_LS_POLLING))
need_debounce_delay = true;
+ /* 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);
+
/* Clear status-change flags; we'll debounce later */
if (portchange & USB_PORT_STAT_C_CONNECTION) {
need_debounce_delay = true;
--
2.20.1
_______________________________________________
Cloud Kernel mailing list -- cloud-kernel(a)lists.openanolis.org
To unsubscribe send an email to cloud-kernel-leave(a)lists.openanolis.org
--
Thanks,
Caspar