diff mbox

[U-Boot,v5,11/15] usb: ohci: Remove unnecessary delays from hc_start and power power-on paths

Message ID 1431259827-8109-12-git-send-email-hdegoede@redhat.com
State Accepted
Delegated to: Simon Glass
Headers show

Commit Message

Hans de Goede May 10, 2015, 12:10 p.m. UTC
The usb spec says that we must wait a minimum amount of time after port
power on (exact time is in the hub descriptor), this is something which
we must not only do for root ports but also for external hub ports, which
is why the common usb_hub code already waits a full second after powering
up ports. Having a separate wait for just the root hub in the ohci-hcd
code only leads to doing the waiting twice for the root ports, so drop the
wait from the ohci-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 10, 2015, 4:11 p.m. UTC | #1
On Sunday, May 10, 2015 at 02:10:23 PM, Hans de Goede wrote:
> The usb spec says that we must wait a minimum amount of time after port
> power on (exact time is in the hub descriptor), this is something which
> we must not only do for root ports but also for external hub ports, which
> is why the common usb_hub code already waits a full second after powering
> up ports. Having a separate wait for just the root hub in the ohci-hcd
> code only leads to doing the waiting twice for the root ports, so drop the
> wait from the ohci-hcd code.
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Acked-by: Marek Vasut <marex@denx.de>

Best regards,
Marek Vasut
Simon Glass May 11, 2015, 10:37 p.m. UTC | #2
On 10 May 2015 at 10:11, Marek Vasut <marex@denx.de> wrote:
> On Sunday, May 10, 2015 at 02:10:23 PM, Hans de Goede wrote:
>> The usb spec says that we must wait a minimum amount of time after port
>> power on (exact time is in the hub descriptor), this is something which
>> we must not only do for root ports but also for external hub ports, which
>> is why the common usb_hub code already waits a full second after powering
>> up ports. Having a separate wait for just the root hub in the ohci-hcd
>> code only leads to doing the waiting twice for the root ports, so drop the
>> wait from the ohci-hcd code.
>>
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>
> Acked-by: Marek Vasut <marex@denx.de>

Applied to u-boot-dm, thanks!
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;