USB: ci13xxx_udc: Don't flush inactive endpoints
The endpoint must be flushed prior to retiring pending requests.
This is done during disabling an endpoint. Don't flush an endpoint
if there are no pending requests. According databook flushing
endpoint may take large amount of time. This optimization will
make USB disconnect/reset processing a little bit faster.
CRs-Fixed: 445916
Change-Id: I035b624dbac4529bbe33a67f9e7e1916d4772d6f
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
diff --git a/drivers/usb/gadget/ci13xxx_udc.c b/drivers/usb/gadget/ci13xxx_udc.c
index 7851727..b9b8cd6 100644
--- a/drivers/usb/gadget/ci13xxx_udc.c
+++ b/drivers/usb/gadget/ci13xxx_udc.c
@@ -422,6 +422,10 @@
{
ktime_t start, diff;
int n = hw_ep_bit(num, dir);
+ struct ci13xxx_ep *mEp = &_udc->ci13xxx_ep[n];
+
+ if (list_empty(&mEp->qh.queue))
+ return 0;
start = ktime_get();
do {