[U-Boot] problem with USB storage STALL status

Wolfgang Denk wd at denx.de
Mon Mar 4 12:12:08 CET 2013


Dear Anton Vasilyev,

In message <CALy29_0wpHEbVH3orjg-RWN41eKXDarRgY+Az0kucyG87i3kKg at mail.gmail.com> you wrote:
>
> Separating DATA phase and STATUS phase by mdelay(1) helps me solve current
> problem.
> 
> diff --git a/common/usb_storage.c b/common/usb_storage.c
> index fb322b4..ea88536 100644
> --- a/common/usb_storage.c
> +++ b/common/usb_storage.c
> @@ -740,6 +740,7 @@ static int usb_stor_BBB_transport(ccb *srb, struct
> us_data *us)
>  st:
>   retry = 0;
>  again:
> + mdelay(1);
>   USB_STOR_PRINTF("STATUS phase\n");
>   result = usb_bulk_msg(us->pusb_dev, pipein, csw, UMASS_BBB_CSW_SIZE,
>   &actlen, USB_CNTL_TIMEOUT*5);

Indentation is all wrong, and there is no SoB line.

> I din't find any explanation for this delay in USB specification, but at
> Linux Kernel I found similar separation (drivers/usb/storage.c):
> 
> /* Some USB-IDE converter chips need a 100us delay between the
>  * command phase and the data phase.  Some devices need a little
>  * more than that, probably because of clock rate inaccuracies. */

Are you sure that you really need 1000 us, instead of the 100 us given
here?  On which exact device does this happen?  Do other devices work
with shorter delays?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Remember that the best relationship is one in  which  your  love  for
each other exceeds your need for each other.             - Dalai Lama


More information about the U-Boot mailing list