diff mbox

[U-Boot,13/16] usb: ohci: Remove unnecessary delays from hc_start and power power-on paths

Message ID 1430862979-4684-14-git-send-email-hdegoede@redhat.com
State Changes Requested
Delegated to: Simon Glass
Headers show

Commit Message

Hans de Goede May 5, 2015, 9:56 p.m. UTC
The common usb_hub code already waits a full second after powering up ports,
so there is no need for additional delays inside the hcd code.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/usb/host/ohci-hcd.c | 4 ----
 1 file changed, 4 deletions(-)

Comments

Marek Vasut May 5, 2015, 11:01 p.m. UTC | #1
On Tuesday, May 05, 2015 at 11:56:16 PM, Hans de Goede wrote:
> The common usb_hub code already waits a full second after powering up
> ports, so there is no need for additional delays inside the hcd code.
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>

This makes a driver depend on the behavior of the subsystem, which might
change though, right ? Won't this bite us in the future ?

Best regards,
Marek Vasut
Hans de Goede May 10, 2015, 9:10 a.m. UTC | #2
Hi,

On 06-05-15 01:01, Marek Vasut wrote:
> On Tuesday, May 05, 2015 at 11:56:16 PM, Hans de Goede wrote:
>> The common usb_hub code already waits a full second after powering up
>> ports, so there is no need for additional delays inside the hcd code.
>>
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>
> This makes a driver depend on the behavior of the subsystem, which might
> change though, right ?  Won't this bite us in the future ?

Well since the usb spec says that we must wait a minimum amount of time
after port power on (exact time is in the hub descriptor) the subsys code
better not change otherwise we would be violating the spec in the future,
also note that we must not only do the wait for root ports but also
for external hub ports, so we can really never drop the wait from the
subsys code, and having a separate wait for just the root hub in the hcd
code will only lead to doing the waiting twice.

I'll change the commit message to make this clear.

Regards,

Hans
Marek Vasut May 10, 2015, 9:49 a.m. UTC | #3
On Sunday, May 10, 2015 at 11:10:00 AM, Hans de Goede wrote:
> Hi,

Hi!

> On 06-05-15 01:01, Marek Vasut wrote:
> > On Tuesday, May 05, 2015 at 11:56:16 PM, Hans de Goede wrote:
> >> The common usb_hub code already waits a full second after powering up
> >> ports, so there is no need for additional delays inside the hcd code.
> >> 
> >> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> > 
> > This makes a driver depend on the behavior of the subsystem, which might
> > change though, right ?  Won't this bite us in the future ?
> 
> Well since the usb spec says that we must wait a minimum amount of time
> after port power on (exact time is in the hub descriptor) the subsys code
> better not change otherwise we would be violating the spec in the future,
> also note that we must not only do the wait for root ports but also
> for external hub ports, so we can really never drop the wait from the
> subsys code, and having a separate wait for just the root hub in the hcd
> code will only lead to doing the waiting twice.
> 
> I'll change the commit message to make this clear.

Thanks!

Best regards,
Marek Vasut
diff mbox

Patch

diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index da500c0..dc0892f 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -1338,7 +1338,6 @@  pkt_print(ohci, NULL, dev, pipe, buffer, transfer_len,
 			OK(0);
 		case (RH_PORT_POWER):
 			WR_RH_PORTSTAT(RH_PS_PPS);
-			mdelay(100);
 			OK(0);
 		case (RH_PORT_ENABLE): /* BUG IN HUP CODE *********/
 			if (RD_RH_PORTSTAT & RH_PS_CCS)
@@ -1737,9 +1736,6 @@  static int hc_start(ohci_t *ohci)
 	ohci_writel(RH_HS_LPSC, &ohci->regs->roothub.status);
 #endif	/* OHCI_USE_NPS */
 
-	/* POTPGT delay is bits 24-31, in 2 ms units. */
-	mdelay((roothub_a(ohci) >> 23) & 0x1fe);
-
 	/* connect the virtual root hub */
 	ohci->rh.devnum = 0;