usb: core: Reduce resume signalling time for devices behind external hub

Squashing commit 28f110a27130("usb: core: Add support to skip
extended bus resume delay") and e97aab2199f3("usb: core: Drive resume
for 20ms for devices behind external hub") with few modifications.

This change removes extra 40ms delay upon bus resume for the
exteral hub and reduce the resume signalling time from 40ms to
20ms for devices behind the external hub(s). Skipping extra
delay reduces over all bus resume latency.

Change-Id: I948626bbaae0c78553543347a1c7d5b8168c08cd
Signed-off-by: Pratham Pratap <prathampratap@codeaurora.org>
This commit is contained in:
Pratham Pratap 2021-01-20 01:20:10 +05:30 • committed by Gerrit - the friendly Code Review server
commit 9b04395cec
2 changed files with 4 additions and 3 deletions

View file

@ -3568,8 +3568,9 @@ 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-" : ""));
usleep_range(USB_RESUME_TIMEOUT * 1000,
(USB_RESUME_TIMEOUT + 1) * 1000);
if (udev->parent != udev->bus->root_hub)
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

View file

@ -309,7 +309,7 @@ void usb_put_intf(struct usb_interface *intf);
* should cope with both LPJ calibration errors and devices not following every
* detail of the USB Specification.
*/
#define USB_RESUME_TIMEOUT 40 /* ms */
#define USB_RESUME_TIMEOUT 20 /* ms */
/**
* struct usb_interface_cache - long-term representation of a device interface