Hello Stelian, As promised, here is the first patch to test. I looked at your logging output, and noticed that the device you mailed me the logging from contained an interrupt endpoint (3 endpoints). My USB sticks do not have such an endpoint, so that was the only difference in the lsusb output. In the mean time I found such a device here also, but that one worked also without problems... So, my suggestion is to look it in a different area. I compared the Linux code and the U-boot code, and found another difference. U-boot uses timeouts on Control requests between 100 and 500 ms, while Linux uses a 5 second timeout. Maybe your device is slower than my devices, and maybe that is where we have to look. (Notice that my devices always respond between 70 and 95 ms on a control request, so 100 ms is very short in the first place) So, here is the first patch. Can you please test if this helps? If it does not help, I would like to wait until you are able to verify if your problem with _your_ USB sticks also exists on a AT91sam9261-ek, to be able to differentiate if the problem is USB stick related or SoC related. Make the USB timeout on a Control request equal to max. 5 seconds. This is an experimental patch to test if this is the cause of some USB sticks not functional in U-boot. It is a difference between U-Boot and the Linux kernel, where Linux always uses a max. of 5 seconds timeout on a control request, and U-boot uses 100ms, 300ms and 500ms timeouts. Signed-off-by: Remy Bohmer --- common/usb.c | 4 ++-- common/usb_storage.c | 16 ++++++++-------- include/usb.h | 8 +++++++- 3 files changed, 17 insertions(+), 11 deletions(-) Index: u-boot-git-22092008/common/usb.c =================================================================== --- u-boot-git-22092008.orig/common/usb.c 2008-09-22 14:29:36.000000000 +0200 +++ u-boot-git-22092008/common/usb.c 2008-09-22 14:29:37.000000000 +0200 @@ -397,7 +397,7 @@ int usb_clear_halt(struct usb_device *de result = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), USB_REQ_CLEAR_FEATURE, USB_RECIP_ENDPOINT, 0, - endp, NULL, 0, USB_CNTL_TIMEOUT * 3); + endp, NULL, 0, USB_CNTL_TIMEOUT); /* don't clear if failed */ if (result < 0) @@ -513,7 +513,7 @@ int usb_set_interface(struct usb_device ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), USB_REQ_SET_INTERFACE, USB_RECIP_INTERFACE, alternate, interface, NULL, 0, - USB_CNTL_TIMEOUT * 5); + USB_CNTL_TIMEOUT); if (ret < 0) return ret; Index: u-boot-git-22092008/common/usb_storage.c =================================================================== --- u-boot-git-22092008.orig/common/usb_storage.c 2008-09-22 14:29:37.000000000 +0200 +++ u-boot-git-22092008/common/usb_storage.c 2008-09-22 14:29:37.000000000 +0200 @@ -327,7 +327,7 @@ static int us_one_transfer(struct us_dat USB_STOR_PRINTF("Bulk xfer 0x%x(%d) try #%d\n", (unsigned int)buf, this_xfer, 11 - maxtry); result = usb_bulk_msg(us->pusb_dev, pipe, buf, - this_xfer, &partial, USB_CNTL_TIMEOUT*5); + this_xfer, &partial, USB_CNTL_TIMEOUT); USB_STOR_PRINTF("bulk_msg returned %d xferred %d/%d\n", result, partial, this_xfer); if(us->pusb_dev->status!=0) { @@ -393,7 +393,7 @@ static int usb_stor_BBB_reset(struct us_ USB_STOR_PRINTF("BBB_reset\n"); result = usb_control_msg(us->pusb_dev, usb_sndctrlpipe(us->pusb_dev,0), US_BBB_RESET, USB_TYPE_CLASS | USB_RECIP_INTERFACE, - 0, us->ifnum, 0, 0, USB_CNTL_TIMEOUT*5); + 0, us->ifnum, 0, 0, USB_CNTL_TIMEOUT); if((result < 0) && (us->pusb_dev->status & USB_ST_STALLED)) { @@ -433,7 +433,7 @@ static int usb_stor_CB_reset(struct us_d cmd[1] = 4; result = usb_control_msg(us->pusb_dev, usb_sndctrlpipe(us->pusb_dev,0), US_CBI_ADSC, USB_TYPE_CLASS | USB_RECIP_INTERFACE, - 0, us->ifnum, cmd, sizeof(cmd), USB_CNTL_TIMEOUT*5); + 0, us->ifnum, cmd, sizeof(cmd), USB_CNTL_TIMEOUT); /* long wait for reset */ wait_ms(1500); @@ -485,7 +485,7 @@ int usb_stor_BBB_comdat(ccb *srb, struct /* copy the command data into the CBW command data buffer */ /* DST SRC LEN!!! */ memcpy(cbw.CBWCDB, srb->cmd, srb->cmdlen); - result = usb_bulk_msg(us->pusb_dev, pipe, &cbw, UMASS_BBB_CBW_SIZE, &actlen, USB_CNTL_TIMEOUT*5); + result = usb_bulk_msg(us->pusb_dev, pipe, &cbw, UMASS_BBB_CBW_SIZE, &actlen, USB_CNTL_TIMEOUT); if (result < 0) USB_STOR_PRINTF("usb_stor_BBB_comdat:usb_bulk_msg error\n"); return result; @@ -517,7 +517,7 @@ int usb_stor_CB_comdat(ccb *srb, struct result = usb_control_msg(us->pusb_dev, usb_sndctrlpipe(us->pusb_dev,0), US_CBI_ADSC, USB_TYPE_CLASS | USB_RECIP_INTERFACE, 0, us->ifnum, - srb->cmd, srb->cmdlen, USB_CNTL_TIMEOUT*5); + srb->cmd, srb->cmdlen, USB_CNTL_TIMEOUT); USB_STOR_PRINTF("CB_transport: control msg returned %d, status %X\n",result,us->pusb_dev->status); /* check the return code for the command */ if (result < 0) { @@ -603,7 +603,7 @@ int usb_stor_BBB_clear_endpt_stall(struc /* ENDPOINT_HALT = 0, so set value to 0 */ result = usb_control_msg(us->pusb_dev, usb_sndctrlpipe(us->pusb_dev,0), USB_REQ_CLEAR_FEATURE, USB_RECIP_ENDPOINT, - 0, endpt, 0, 0, USB_CNTL_TIMEOUT*5); + 0, endpt, 0, 0, USB_CNTL_TIMEOUT); return result; } @@ -643,7 +643,7 @@ int usb_stor_BBB_transport(ccb *srb, str pipe = pipein; else pipe = pipeout; - result = usb_bulk_msg(us->pusb_dev, pipe, srb->pdata, srb->datalen, &data_actlen, USB_CNTL_TIMEOUT*5); + result = usb_bulk_msg(us->pusb_dev, pipe, srb->pdata, srb->datalen, &data_actlen, USB_CNTL_TIMEOUT); /* special handling of STALL in DATA phase */ if((result < 0) && (us->pusb_dev->status & USB_ST_STALLED)) { USB_STOR_PRINTF("DATA:stall\n"); @@ -670,7 +670,7 @@ int usb_stor_BBB_transport(ccb *srb, str again: USB_STOR_PRINTF("STATUS phase\n"); result = usb_bulk_msg(us->pusb_dev, pipein, &csw, UMASS_BBB_CSW_SIZE, - &actlen, USB_CNTL_TIMEOUT*5); + &actlen, USB_CNTL_TIMEOUT); /* special handling of STALL in STATUS phase */ if((result < 0) && (retry < 1) && (us->pusb_dev->status & USB_ST_STALLED)) { Index: u-boot-git-22092008/include/usb.h =================================================================== --- u-boot-git-22092008.orig/include/usb.h 2008-09-22 14:24:42.000000000 +0200 +++ u-boot-git-22092008/include/usb.h 2008-09-22 14:38:08.000000000 +0200 @@ -39,7 +39,13 @@ #define USB_MAXCHILDREN 8 /* This is arbitrary */ #define USB_MAX_HUB 16 -#define USB_CNTL_TIMEOUT 100 /* 100ms timeout */ +/* + * timeouts, in milliseconds, used for sending/receiving control messages + * they typically complete within a few frames (msec) after they're issued + * USB identifies 5 second timeouts, maybe more in a few cases, and a few + * slow devices (like some MGE Ellipse UPSes) actually push that limit. + */ +#define USB_CNTL_TIMEOUT 5000 /* String descriptor */ struct usb_string_descriptor { --