usb: core: Add 20ms of resume signalling while resuming usb device

Commit 9b04395cec ("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 <prathampratap@codeaurora.org>
This commit is contained in:
Pratham Pratap 2021-03-19 16:30:54 +05:30 • committed by Gerrit - the friendly Code Review server
commit d74075293e

View file

@ -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