MLK-16088 usb: gadget: ci_udc: waiting finish when submit one request
authorPeng Fan <peng.fan@nxp.com>
Wed, 26 Jul 2017 07:34:09 +0000 (15:34 +0800)
committerJason Liu <jason.hui.liu@nxp.com>
Thu, 2 Nov 2017 18:37:04 +0000 (02:37 +0800)
After submit a request and hardware starting transfer, wait
the transfer complete. Also set req_primed with value false.

Then we could do multile fastboot_tx_write_str in fastboot.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
drivers/usb/gadget/ci_udc.c

index 05c01ce..603b242 100644 (file)
@@ -1,6 +1,7 @@
 /*
  * Copyright 2011, Marvell Semiconductor Inc.
  * Lei Wen <leiwen@marvell.com>
+ * Copyright 2017 NXP
  *
  * SPDX-License-Identifier:    GPL-2.0+
  *
@@ -523,6 +524,11 @@ static void ci_ep_submit_next_request(struct ci_ep *ci_ep)
                bit = EPT_RX(num);
 
        writel(bit, &udc->epprime);
+       /* Waiting transfer finish */
+       while (readl(&udc->epprime) & bit)
+               ;
+       /* Set false to accept following request */
+       ci_ep->req_primed = false;
 }
 
 static int ci_ep_dequeue(struct usb_ep *_ep, struct usb_request *_req)