Message ID | 20220509091343.39471-2-jianhui.lee@canonical.com |
---|---|
State | New |
Headers | show |
Series | Bail out when USB port is stuck in reset loop | expand |
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 22adb595e21b..599d88142bd5 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -3014,8 +3014,12 @@ static int hub_port_reset(struct usb_hub *hub, int port1, status); } - /* Check for disconnect or reset */ - if (status == 0 || status == -ENOTCONN || status == -ENODEV) { + /* + * Check for disconnect or reset, and bail out after several + * reset attempts to avoid warm reset loop. + */ + if (status == 0 || status == -ENOTCONN || status == -ENODEV || + (status == -EBUSY && i == PORT_RESET_TRIES - 1)) { usb_clear_port_feature(hub->hdev, port1, USB_PORT_FEAT_C_RESET);