usb: dwc3: gadget: Delay starting transfer
authorThinh Nguyen <Thinh.Nguyen@synopsys.com>
Thu, 19 Dec 2019 02:14:50 +0000 (18:14 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Jan 2020 09:39:23 +0000 (10:39 +0100)
commitda10bcdd6f70dc9977f2cf18f4783cf78520623a
tree46d2b92b7e1631d494cc14e6800b61c3b9236de2
parentc58d8bfc77a2c7f6ff6339b58c9fca7ae6f57e70
usb: dwc3: gadget: Delay starting transfer

If the END_TRANSFER command hasn't completed yet, then don't send the
START_TRANSFER command. The controller may not be able to start if
that's the case. Some controller revisions depend on this. See
commit 76a638f8ac0d ("usb: dwc3: gadget: wait for End Transfer to
complete"). Let's only send START_TRANSFER command after the
END_TRANSFER command had completed.

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/gadget.c