usb: dwc3: gadget: Check END_TRANSFER completion
authorThinh Nguyen <Thinh.Nguyen@synopsys.com>
Thu, 19 Dec 2019 02:14:44 +0000 (18:14 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Jan 2020 09:39:23 +0000 (10:39 +0100)
commitc58d8bfc77a2c7f6ff6339b58c9fca7ae6f57e70
tree2768ffe8860e0ee2e6d17694262838611ebc9a1a
parent6b02af3465ee11b63a938b13bddbf7ecd92860f3
usb: dwc3: gadget: Check END_TRANSFER completion

While the END_TRANSFER command is sent but not completed, any request
dequeue during this time will cause the driver to issue the END_TRANSFER
command. The driver needs to submit the command only once to stop the
controller from processing further. The controller may take more time to
process the same command multiple times unnecessarily. Let's add a flag
DWC3_EP_END_TRANSFER_PENDING to check for this condition.

Fixes: 3aec99154db3 ("usb: dwc3: gadget: remove DWC3_EP_END_TRANSFER_PENDING")
Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/dwc3/core.h
drivers/usb/dwc3/ep0.c
drivers/usb/dwc3/gadget.c