linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] usb: core: reduce power-on-good delay time of root hub
@ 2021-04-10  1:20 Chunfeng Yun
  2021-11-01  3:33 ` Walt Jr. Brake
       [not found] ` <5e907ccd-40bb-2ece-fe05-1a65a74f3aa2@gmail.com>
  0 siblings, 2 replies; 15+ messages in thread
From: Chunfeng Yun @ 2021-04-10  1:20 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Alan Stern
  Cc: Matthias Brugger, Chunfeng Yun, Nishad Kamdar, linux-usb,
	linux-kernel, linux-arm-kernel, linux-mediatek, Eddie Hung

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 <stern@rowland.harvard.edu>
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
---
v2: remove RFC tag, and add acked-by Alan
---
 drivers/usb/core/hub.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/core/hub.h b/drivers/usb/core/hub.h
index 73f4482d833a..22ea1f4f2d66 100644
--- a/drivers/usb/core/hub.h
+++ b/drivers/usb/core/hub.h
@@ -148,8 +148,10 @@ static inline unsigned hub_power_on_good_delay(struct usb_hub *hub)
 {
 	unsigned delay = hub->descriptor->bPwrOn2PwrGood * 2;
 
-	/* Wait at least 100 msec for power to become stable */
-	return max(delay, 100U);
+	if (!hub->hdev->parent)	/* root hub */
+		return delay;
+	else /* Wait at least 100 msec for power to become stable */
+		return max(delay, 100U);
 }
 
 static inline int hub_port_debounce_be_connected(struct usb_hub *hub,
-- 
2.18.0


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2021-11-06 14:41 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-10  1:20 [PATCH v2] usb: core: reduce power-on-good delay time of root hub Chunfeng Yun
2021-11-01  3:33 ` Walt Jr. Brake
     [not found] ` <5e907ccd-40bb-2ece-fe05-1a65a74f3aa2@gmail.com>
2021-11-01 14:06   ` Alan Stern
2021-11-02  9:05     ` Mathias Nyman
2021-11-02 20:29       ` Walt Jr. Brake
2021-11-03 20:37         ` Mathias Nyman
2021-11-05 10:00           ` Greg Kroah-Hartman
2021-11-05 13:30             ` Alan Stern
2021-11-05 16:00               ` [PATCH] xhci: Fix USB 3.1 enumeration issues by increasing roothub power-on-good delay Mathias Nyman
2021-11-05 16:09                 ` Mathias Nyman
2021-11-05 17:32                   ` Walt Jr. Brake
2021-11-05 19:41                     ` Mathias Nyman
2021-11-05 16:15                 ` Greg KH
2021-11-05 19:56                   ` Mathias Nyman
2021-11-06 14:41                     ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).