]> rtime.felk.cvut.cz Git - zynq/linux.git/commitdiff
usb: dwc3: gadget: ISOC transfers should be stopped before starting a transfer
authorAnurag Kumar Vulisha <anurag.kumar.vulisha@xilinx.com>
Thu, 26 Apr 2018 07:19:17 +0000 (12:49 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Thu, 26 Apr 2018 14:32:20 +0000 (16:32 +0200)
For ISOC transfers the requests are not queued until the HOST requests
for data and XferNotReady event is generated .But XferNotReady event
is not getting generated for ISOC transfers for the second time after
Endpoint configuration. Since ISOC packets depend on the XferNotReady
events, they will not be queued to controller. Because of this issue
timeout happens on the application layer.

This patch fixes this issue by issuing END TRANSFER command before
starting any ISOC transfers. Doing so will make the controller clear
the previous allocated endpoint resources and reallocate resources
when the transfer is requested. Because of this change XferNotReady
events will be generated when host requests for the ISOC transfer.

Signed-off-by: Anurag Kumar Vulisha <anurag.kumar.vulisha@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/usb/dwc3/gadget.c

index a0f8c0251f46004bf4f274b9b58f7f889d077c0a..3a031821e6975cea3f1411db34d80586eff2a0a2 100644 (file)
@@ -1392,7 +1392,8 @@ static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req)
         */
        if (usb_endpoint_xfer_isoc(dep->endpoint.desc)) {
                if ((dep->flags & DWC3_EP_PENDING_REQUEST)) {
-                       if (dep->flags & DWC3_EP_TRANSFER_STARTED) {
+                       if ((dep->flags & DWC3_EP_TRANSFER_STARTED) ||
+                           !(dep->flags & DWC3_EP_BUSY)) {
                                dwc3_stop_active_transfer(dwc, dep->number, true);
                                dep->flags = DWC3_EP_ENABLED;
                        } else {