Commit b8af4562 authored by Mikhail Vanyulin's avatar Mikhail Vanyulin Committed by Thomas Schäfer
Browse files

usb: add delays to fix USB sticks enumeration failures



usb.c: Force delay 100ms between each control messages to fix Transcend
        and Kingston DT sticks fail to be enumerated.
ehci-hcd.c:
    - increase EHCI host controller handshake delay to 10 ms
    - add 10 ms delay in ehci_submit_async function for control pipes
      to support slow device detection
Signed-off-by: Mikhail Vanyulin's avatarMikhail Vanyulin <mvanyulin@dev.rtsoft.ru>
parent 78c7ecd8
......@@ -232,6 +232,8 @@ int usb_control_msg(struct usb_device *dev, unsigned int pipe,
return -EINVAL;
}
mdelay(100);
/* set setup command */
setup_packet->requesttype = requesttype;
setup_packet->request = request;
......
......@@ -166,7 +166,7 @@ static int handshake(uint32_t *ptr, uint32_t mask, uint32_t done, int usec)
uint32_t result;
do {
result = ehci_readl(ptr);
udelay(5);
udelay(10);
if (result == ~(uint32_t)0)
return -1;
result &= mask;
......@@ -608,6 +608,11 @@ ehci_submit_async(struct usb_device *dev, unsigned long pipe, void *buffer,
ts = get_timer(0);
vtd = &qtd[qtd_counter - 1];
timeout = USB_TIMEOUT_MS(pipe);
/* Add delay for control pipe to support slow USB thumb devices */
if (usb_pipecontrol(pipe)) {
mdelay(10);
timeout += 1000;
}
do {
/* Invalidate dcache */
invalidate_dcache_range((unsigned long)&ctrl->qh_list,
......@@ -958,7 +963,7 @@ static int ehci_submit_root(struct usb_device *dev, unsigned long pipe,
goto unknown;
}
mdelay(1);
mdelay(5);
len = min3(srclen, (int)le16_to_cpu(req->length), length);
if (srcptr != NULL && len > 0)
memcpy(buffer, srcptr, len);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment