Patchwork [U-Boot] usb: increase delay after port reset

login
register
mail settings
Submitter Ilya Yanok
Date Nov. 10, 2011, 12:03 a.m.
Message ID <1320883438-12274-1-git-send-email-yanok@emcraft.com>
Download mbox | patch
Permalink /patch/124742/
State Rejected
Delegated to: Marek Vasut
Headers show

Comments

Ilya Yanok - Nov. 10, 2011, 12:03 a.m.
In our setup (OMAP3 EHCI host, keyboard, mouse mass storage and BT
dongle devices connected via several hubs) keyboard fails to initialize
during the bus scan (stalled endpoint while get_descriptor/64) and after
that keyboard is unusable (even in Linux) until power off/on.

Increasing the delay after port reset from 200ms to 260ms solves this
problem.

Signed-off-by: Ilya Yanok <yanok@emcraft.com>
---
 common/usb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Mike Frysinger - Nov. 10, 2011, 1:09 a.m.
On Wednesday 09 November 2011 19:03:58 Ilya Yanok wrote:
> In our setup (OMAP3 EHCI host, keyboard, mouse mass storage and BT
> dongle devices connected via several hubs) keyboard fails to initialize
> during the bus scan (stalled endpoint while get_descriptor/64) and after
> that keyboard is unusable (even in Linux) until power off/on.
> 
> Increasing the delay after port reset from 200ms to 260ms solves this
> problem.

ugh.  this doesn't sound like the right way to fix things.  looks like Linux 
has added a dynamic polling state that automatically deals with broken 
devices.  look at its hub_port_debounce.  seems like we should implement 
something like that instead of delaying longer and longer and making the 
situation needlessly worse for most systems.
-mike
Ilya Yanok - Nov. 16, 2011, 9:17 p.m.
Hi Mike,

On 10.11.2011 05:09, Mike Frysinger wrote:
> On Wednesday 09 November 2011 19:03:58 Ilya Yanok wrote:
>> In our setup (OMAP3 EHCI host, keyboard, mouse mass storage and BT
>> dongle devices connected via several hubs) keyboard fails to initialize
>> during the bus scan (stalled endpoint while get_descriptor/64) and after
>> that keyboard is unusable (even in Linux) until power off/on.
>>
>> Increasing the delay after port reset from 200ms to 260ms solves this
>> problem.
> 
> ugh.  this doesn't sound like the right way to fix things.  looks like Linux 
> has added a dynamic polling state that automatically deals with broken 
> devices.  look at its hub_port_debounce.  seems like we should implement 
> something like that instead of delaying longer and longer and making the 
> situation needlessly worse for most systems.

Thanks for the pointer. Unfortunately I don't have time to look into
this deeper and we will go with a workaround for now.

Maybe we will return to this later.

Regards, Ilya.
Marek Vasut - April 2, 2012, 5:29 p.m.
Dear Ilya Yanok,

> In our setup (OMAP3 EHCI host, keyboard, mouse mass storage and BT
> dongle devices connected via several hubs) keyboard fails to initialize
> during the bus scan (stalled endpoint while get_descriptor/64) and after
> that keyboard is unusable (even in Linux) until power off/on.
> 
> Increasing the delay after port reset from 200ms to 260ms solves this
> problem.

Do we still have this problem?

> Signed-off-by: Ilya Yanok <yanok@emcraft.com>
> ---
>  common/usb.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/common/usb.c b/common/usb.c
> index bed5116..5e282c6 100644
> --- a/common/usb.c
> +++ b/common/usb.c
> @@ -1147,7 +1147,7 @@ void usb_hub_port_connect_change(struct usb_device
> *dev, int port) return;
>  	}
> 
> -	wait_ms(200);
> +	wait_ms(260);
> 
>  	/* Allocate a new device struct for it */
>  	usb = usb_alloc_new_device();

Best regards,
Marek Vasut
Ilya Yanok - April 2, 2012, 7 p.m.
Hi Marek, Stefano,

On 02.04.2012 21:29, Marek Vasut wrote:
>> In our setup (OMAP3 EHCI host, keyboard, mouse mass storage and BT
>> dongle devices connected via several hubs) keyboard fails to initialize
>> during the bus scan (stalled endpoint while get_descriptor/64) and after
>> that keyboard is unusable (even in Linux) until power off/on.
>>
>> Increasing the delay after port reset from 200ms to 260ms solves this
>> problem.
> 
> Do we still have this problem?

Sorry, I'm not working with this board any more. I'm ccing Stefano,
probably he can answer.

Regards, Ilya.
Stefano Babic - April 3, 2012, 3:19 p.m.
On 02/04/2012 21:00, Ilya Yanok wrote:
> Hi Marek, Stefano,

Hi Marek,

> 
> On 02.04.2012 21:29, Marek Vasut wrote:
>>> In our setup (OMAP3 EHCI host, keyboard, mouse mass storage and BT
>>> dongle devices connected via several hubs) keyboard fails to initialize
>>> during the bus scan (stalled endpoint while get_descriptor/64) and after
>>> that keyboard is unusable (even in Linux) until power off/on.
>>>
>>> Increasing the delay after port reset from 200ms to 260ms solves this
>>> problem.
>>
>> Do we still have this problem?
> 
> Sorry, I'm not working with this board any more. I'm ccing Stefano,
> probably he can answer.

USB seems not working on this board, but the patch does not help. No
peripheral are found after bus scan, even if the delay is increased by
the patch. I will suggest to not apply this patch for the release and I
will try to investigate what is gone wrong on this board.

Best regards,
Stefano Babic
Marek Vasut - April 3, 2012, 4:16 p.m.
Dear Stefano Babic,

> On 02/04/2012 21:00, Ilya Yanok wrote:
> > Hi Marek, Stefano,
> 
> Hi Marek,
> 
> > On 02.04.2012 21:29, Marek Vasut wrote:
> >>> In our setup (OMAP3 EHCI host, keyboard, mouse mass storage and BT
> >>> dongle devices connected via several hubs) keyboard fails to initialize
> >>> during the bus scan (stalled endpoint while get_descriptor/64) and
> >>> after that keyboard is unusable (even in Linux) until power off/on.
> >>> 
> >>> Increasing the delay after port reset from 200ms to 260ms solves this
> >>> problem.
> >> 
> >> Do we still have this problem?
> > 
> > Sorry, I'm not working with this board any more. I'm ccing Stefano,
> > probably he can answer.
> 
> USB seems not working on this board, but the patch does not help. No
> peripheral are found after bus scan, even if the delay is increased by
> the patch. I will suggest to not apply this patch for the release and I
> will try to investigate what is gone wrong on this board.
> 
> Best regards,
> Stefano Babic

Ok, discarding from patchwork. Thanks!

Best regards,
Marek Vasut

Patch

diff --git a/common/usb.c b/common/usb.c
index bed5116..5e282c6 100644
--- a/common/usb.c
+++ b/common/usb.c
@@ -1147,7 +1147,7 @@  void usb_hub_port_connect_change(struct usb_device *dev, int port)
 		return;
 	}
 
-	wait_ms(200);
+	wait_ms(260);
 
 	/* Allocate a new device struct for it */
 	usb = usb_alloc_new_device();