这个补丁不是upstream commit 的全部,而是部分,在移植的时候尽量还是说明一
下。
BTW,看了一下代码树,这个补丁应该已经在ck里了。请 double check 一下代码
树的分支是否正确 (anolis_linux-next 或 anolis_master 分支均可)
https://codeup.openanolis.org/codeup/kernel/cloud-kernel
Thanks,
Caspar
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.
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