usb: Increase root hub reset signaling time to prevent retry
authorMathias Nyman <mathias.nyman@linux.intel.com>
Wed, 16 Aug 2017 11:23:25 +0000 (14:23 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Aug 2017 22:26:26 +0000 (15:26 -0700)
commit74072bae88fb3b0f8b54ec88055abfda758fcba1
tree0e86c598489ed3c143e309a5b157c47328d53d27
parent8ca1358bd9b1c7a98c8f3210c1aaa2577975a389
usb: Increase root hub reset signaling time to prevent retry

Save 80ms device enumeration time by increasing root hub port reset time

The 50ms reset signaling time is not enough for most root hub ports.
Increasing the reset time to 60ms allows host controllers to finish port
reset and removes a retry causing an extra 50ms delay.

The USB 2 specification requires "at least 50ms" for driving root
port reset. The current msleep is exactly 50ms which may not be
enough if there are any delays between writing the reset bit to host
controller portsc register and phy actually driving reset.

On Haswell, Skylake and Kabylake xHC port reset took in average 52-59ms

The 80ms improvement comes from (40ms * 2 port resets) save at enumeration
for each device connected to a root hub port.

more details about root port reset in USB2 section 7.1.7.5:.
"Software must ensure that resets issued to the root ports drive reset
long enough to overwhelm any concurrent resume attempts by downstream
devices. It is required that resets from root ports have a duration of
at least 50 ms (TDRSTR).

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/core/hub.c