UPSTREAM: usb: dwc3: fix for the isoc transfer EP_BUSY flag
authorKonrad Leszczynski <konrad.leszczynski@intel.com>
Mon, 8 Feb 2016 15:13:12 +0000 (16:13 +0100)
committerHuang, Tao <huangtao@rock-chips.com>
Tue, 16 Aug 2016 12:48:19 +0000 (20:48 +0800)
commit f3af36511e60 ("usb: dwc3: gadget: always
enable IOC on bulk/interrupt transfers") ended up
regressing Isochronous endpoints by clearing
DWC3_EP_BUSY flag too early, which resulted in
choppy audio playback over USB.

Fix that by partially reverting original commit and
making sure that we check for isochronous endpoints.

Change-Id: If2b5897f005bc5f6a4f475e8371c2654ac04a44a
Fixes: f3af36511e60 ("usb: dwc3: gadget: always enable IOC
on bulk/interrupt transfers")
Cc: <stable@vger.kernel.org>
Signed-off-by: Konrad Leszczynski <konrad.leszczynski@intel.com>
Signed-off-by: Rafal Redzimski <rafal.f.redzimski@intel.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
(cherry picked from commit 9cad39fe4e4a4fe95d8ea5a7b0692b0a6e89e38b)

drivers/usb/dwc3/gadget.c

index 42eef686061e1667b72c181655a499ec2dae2b43..7caffa744a9b1b0e3eea325632ad6da90e0be1b6 100644 (file)
@@ -2062,6 +2062,10 @@ static int dwc3_cleanup_done_reqs(struct dwc3 *dwc, struct dwc3_ep *dep,
                return 1;
        }
 
+       if (usb_endpoint_xfer_isoc(dep->endpoint.desc))
+               if ((event->status & DEPEVT_STATUS_IOC) &&
+                               (trb->ctrl & DWC3_TRB_CTRL_IOC))
+                       return 0;
        return 1;
 }