usb: dwc3: gadget: clear DWC3_EP_TRANSFER_STARTED on cmd complete
authorFelipe Balbi <felipe.balbi@linux.intel.com>
Mon, 21 Jan 2019 10:58:27 +0000 (12:58 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Nov 2019 12:05:31 +0000 (13:05 +0100)
commita0608eec296d012637dd2879a961564e3d849b8d
treef386a452b53ad5d303c8467c3c58a21a6186e2cb
parentd0e8b35e915e4d5bcd0368b846c9b84090fea2f6
usb: dwc3: gadget: clear DWC3_EP_TRANSFER_STARTED on cmd complete

[ Upstream commit acbfa6c26f21a18830ee064b588c92334305b6af ]

We must wait until End Transfer completes in order to clear
DWC3_EP_TRANSFER_STARTED, otherwise we may confuse the driver.

This patch is in preparation to fix a rare race condition that happens
upon Disconnect Interrupt.

Tested-by: Thinh Nguyen <thinhn@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/dwc3/gadget.c