From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: anshuman.gupta@intel.com, mathias.nyman@intel.com,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: gregkh@linuxfoundation.org
Subject: Re: [PATCH] usb: reducing an usb-port auto-resume latency.
Date: Wed, 23 Aug 2017 10:56:32 +0300 [thread overview]
Message-ID: <599D3530.40603@linux.intel.com> (raw)
In-Reply-To: <1503469131-10838-1-git-send-email-anshuman.gupta@intel.com>
On 23.08.2017 09:18, anshuman.gupta@intel.com wrote:
> From: Anshuman Gupta <anshuman.gupta@intel.com>
>
> This patch will improve the variable auto-resume latency of an usb-port.
>
> When xhci gets a port status change event interrupt due to PORT_PLC
> (port link state transition), linux Host controller driver drives the
> resume signalling on the bus for the amount of time defined by
> USB_REUME_TIMEOUT(40ms) macro.
>
> This 40ms delay for resume signalling is in acceptable limit, but
> it get worse when xhci goes for polling mode in order to detect other
> events on its ports and modify rh_timer timer with a variable time out of
> 1ms to (HZ/4)ms.
>
> drivers/usb/core/hcd.c line 799
> mod_timer (&hcd->rh_timer, (jiffies/(HZ/4) + 1) * (HZ/4)).
>
> Due to above variable timeout usb auto-resume latency varies from
> 40ms to ~300ms.
>
> Log Snippet:
> ~128ms latency
> [ 53.112049] hub 1-0:1.0: state 7 ports 12 chg 0000 evt 0000
> [ 53.229200] hub 1-0:1.0: state 7 ports 12 chg 0000 evt 0004
> [ 53.240177] usb 1-2: usb wakeup-resume
> [ 53.240195] usb 1-2: finish resume
> [ 53.240357] usb usb1-port2: resume, status 0
> -----------------------------------------------------------------
> ~300ms latency
> [ 59.946620] hub 1-0:1.0: state 7 ports 12 chg 0000 evt 0000
> [ 59.979341] hub 1-0:1.0: state 7 ports 12 chg 0000 evt 0000
> [ 60.229342] hub 1-0:1.0: state 7 ports 12 chg 0000 evt 0004
> [ 60.251321] usb 1-2: usb wakeup-resume
> [ 60.251335] usb 1-2: finish resume
> [ 60.251539] usb usb1-port2: resume, status 0
>
> This variable resume latency can be optimized, as in case of PORT_PLC
> change event rh_timer has already been modified with USB_RESUME_TIMEOUT
> (40ms) delay,leaving the rest to GetPortStatus and started polling for
> root hub status (invoking usb_hcd_poll_rh_status).
> We can avoid polling as we have already modified rh_timer with
> delay of 40ms.
>
> This patch set the HCD_FLAG_POLL_RH to hcd->flags after modification of
> rh_timer, and avoids polling of root hub status. so rh_timer can fire
> after 40ms and usb device auto-resuem latency will be around 40ms.
>
> Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
> ---
Thanks,
adding and sending forward after 4.14-rc1
-Mathias
next prev parent reply other threads:[~2017-08-23 7:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-23 6:18 [PATCH] usb: reducing an usb-port auto-resume latency anshuman.gupta
2017-08-23 7:56 ` Mathias Nyman [this message]
2017-08-23 14:30 ` Alan Stern
2017-08-23 16:00 ` Mathias Nyman
2017-08-28 16:34 ` [PATCH v2] USB: xhci: reducing HS port " anshuman.gupta
[not found] ` <20170912055710.GB30093@anshuman.gupta@intel.com>
2017-09-13 6:55 ` Mathias Nyman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=599D3530.40603@linux.intel.com \
--to=mathias.nyman@linux.intel.com \
--cc=anshuman.gupta@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mathias.nyman@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox