Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 28f110a2 authored by Hemant Kumar's avatar Hemant Kumar
Browse files

usb: core: Add support to skip extended bus resume delay



By default skip_extended_resume_delay module parameter
allows to skip extra 40ms delay upon usb bus resume.
This delay was added on top of host bus resume which
is driven for 20ms. Skipping extra delay reduces over
all bus resume latency.

Change-Id: I31a83abc057c345f29d204a63e7571b880678e69
Signed-off-by: default avatarHemant Kumar <hemantk@codeaurora.org>
parent dd914d68
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -53,6 +53,11 @@ static void hub_event(struct work_struct *work);
/* synchronize hub-port add/remove and peering operations */
DEFINE_MUTEX(usb_port_peer_mutex);

static bool skip_extended_resume_delay = 1;
module_param(skip_extended_resume_delay, bool, 0644);
MODULE_PARM_DESC(skip_extended_resume_delay,
		"removes extra delay added to finish bus resume");

/* cycle leds on hubs that aren't blinking for attention */
static bool blinkenlights;
module_param(blinkenlights, bool, S_IRUGO);
@@ -3481,6 +3486,7 @@ 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 (!skip_extended_resume_delay)
			usleep_range(USB_RESUME_TIMEOUT * 1000,
					(USB_RESUME_TIMEOUT + 1) * 1000);