From d74075293e0b73371598dfc4f9d041be5fea1dfb Mon Sep 17 00:00:00 2001 From: Pratham Pratap Date: Fri, 19 Mar 2021 16:30:54 +0530 Subject: [PATCH] usb: core: Add 20ms of resume signalling while resuming usb device Commit 9b04395cecc6 ("usb: core: Reduce resume signalling time for devices behind external hub") removed resume signalling time for the devices which are connected behind external hub. Since the current kernel doesn't have skip_resume handling, the devices even connected to root hub will take this resume path while coming out of pm_suspend, and this will lead to reset-resume as the driver is not driving the resume signalling for 20ms. Fix this by removing the check and drive resume signalling for all the devices connected to the root hub. Change-Id: Id13b0b1b55e86ee698b8ae7276b2f55e66f4155e Signed-off-by: Pratham Pratap --- drivers/usb/core/hub.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index b69e8201a197..f9742293ce2b 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -3568,9 +3568,8 @@ int usb_port_resume(struct usb_device *udev, pm_message_t msg) /* drive resume for USB_RESUME_TIMEOUT msec */ dev_dbg(&udev->dev, "usb %sresume\n", (PMSG_IS_AUTO(msg) ? "auto-" : "")); - if (udev->parent != udev->bus->root_hub) - usleep_range(USB_RESUME_TIMEOUT * 1000, - (USB_RESUME_TIMEOUT + 1) * 1000); + usleep_range(USB_RESUME_TIMEOUT * 1000, + (USB_RESUME_TIMEOUT + 1) * 1000); /* Virtual root hubs can trigger on GET_PORT_STATUS to * stop resume signaling. Then finish the resume