summaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorPeter Chen <peter.chen@freescale.com>2011-11-21 14:10:49 +0800
committerJason Liu <r64343@freescale.com>2012-01-09 21:07:43 +0800
commit3ab0c204513f45910537a6672df93776031845cd (patch)
treece7304b4859abee5a5592391dec279e252322966 /drivers/usb
parent493c238e195c014f7c4f6751cf037f5d55cb14c2 (diff)
ENGR00161644 usb-gadget: prime directly for status dTD of ep0
During the setup transfer, if prime status just after prime the data, but before the data completes, there is a potential problem: The device's qTD has NO direction bit, If the IN request(Status Stage) is added to qTD list while the OUT (Data Stage) is priming, then the IN will not prime by software, it will prime automatically by controller as OUT. We met one usb hang issue during repeat plug in/out test at i.mx6q that the data status has finished but status has never finished, it is most likely above issue. After this fix, the repeat plug in/out test passes successfully. Signed-off-by: Peter Chen <peter.chen@freescale.com>
Diffstat (limited to 'drivers/usb')
-rwxr-xr-xdrivers/usb/gadget/arcotg_udc.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/usb/gadget/arcotg_udc.c b/drivers/usb/gadget/arcotg_udc.c
index 91f99391fb58..391ba5820527 100755
--- a/drivers/usb/gadget/arcotg_udc.c
+++ b/drivers/usb/gadget/arcotg_udc.c
@@ -865,8 +865,13 @@ static int fsl_queue_td(struct fsl_ep *ep, struct fsl_req *req)
? (1 << (ep_index(ep) + 16))
: (1 << (ep_index(ep)));
- /* check if the pipe is empty */
- if (!(list_empty(&ep->queue))) {
+ /*
+ * check if
+ * - the request is empty, and
+ * - the request is not the status request for ep0
+ */
+ if (!(list_empty(&ep->queue)) &&
+ !((ep_index(ep) == 0) && (req->req.length == 0))) {
/* Add td to the end */
struct fsl_req *lastreq;
lastreq = list_entry(ep->queue.prev, struct fsl_req, queue);