Skip to content

Commit 90d28fb

Browse files
Chunfeng Yungregkh
authored andcommitted
usb: core: reduce power-on-good delay time of root hub
Return the exactly delay time given by root hub descriptor, this helps to reduce resume time etc. Due to the root hub descriptor is usually provided by the host controller driver, if there is compatibility for a root hub, we can fix it easily without affect other root hub Acked-by: Alan Stern <[email protected]> Signed-off-by: Chunfeng Yun <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 26b7595 commit 90d28fb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/usb/core/hub.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,10 @@ static inline unsigned hub_power_on_good_delay(struct usb_hub *hub)
148148
{
149149
unsigned delay = hub->descriptor->bPwrOn2PwrGood * 2;
150150

151-
/* Wait at least 100 msec for power to become stable */
152-
return max(delay, 100U);
151+
if (!hub->hdev->parent) /* root hub */
152+
return delay;
153+
else /* Wait at least 100 msec for power to become stable */
154+
return max(delay, 100U);
153155
}
154156

155157
static inline int hub_port_debounce_be_connected(struct usb_hub *hub,

0 commit comments

Comments
 (0)