usb: dwc3: gadget: don't clear EP_BUSY too early
commit15720e560836d937e58f00316712ce3fb10c3e22
authorFelipe Balbi <balbi@ti.com>
Fri, 29 May 2015 15:06:38 +0000 (29 10:06 -0500)
committerSasha Levin <sasha.levin@oracle.com>
Sat, 4 Jul 2015 03:02:21 +0000 (3 23:02 -0400)
tree640f029602a84efeed3b068c2e34e201d05063d9
parenta927cb7a7c9153cc8f256bc53000b21dadded220
usb: dwc3: gadget: don't clear EP_BUSY too early

[ Upstream commit e18b7975c885bc3a938b9a76daf32957ea0235fa ]

In case of non-Isochronous transfers, we don't
want to clear DWC3_EP_BUSY flag until XferComplete
event. That's because XferInProgress was only enabled
so we can recycle TRBs and usb_requests quicker, but
there are still other pending requests being transferred.

In order to make sure we don't allow for another StartTransfer
command while the HW is still processing other transfers,
we must keep DWC3_EP_BUSY flag set and this what this patch
does.

Fixes: f3af36511e60 (usb: dwc3: gadget: always enable IOC on
bulk/interrupt transfers)
Cc: <stable@vger.kernel.org> # v3.15+
Reported-by: sundeep subbaraya <sundeep.lkml@gmail.com>
Tested-by: sundeep subbaraya <sundeep.lkml@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
drivers/usb/dwc3/gadget.c