usb: dwc3: gadget: don't clear EP_BUSY too early
authorFelipe Balbi <balbi@ti.com>
Fri, 29 May 2015 15:06:38 +0000 (10:06 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 3 Aug 2015 16:29:05 +0000 (09:29 -0700)
commit0343379cabd1736cce291f4555d239a66813f987
treecd781cfba2e0a3cdac927726378354d7b814f6a7
parentf46bc2957ec103ae9dccf4eb55ad2c40173c5144
usb: dwc3: gadget: don't clear EP_BUSY too early

commit e18b7975c885bc3a938b9a76daf32957ea0235fa upstream.

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)
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/dwc3/gadget.c