]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
usb: dwc3: gadget: END_TRANSFER before CLEAR_STALL command
authorThinh Nguyen <Thinh.Nguyen@synopsys.com>
Thu, 3 Sep 2020 01:43:04 +0000 (18:43 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Nov 2020 10:51:39 +0000 (11:51 +0100)
commit9b69b26a3414e38d413c01b3cceb3ec8fc7b2b51
tree5e51512f2f73b85daf30bfd1b6b2f72b10556a78
parent0991df61eaa47b7aca2ef0b1ed43d15567be1124
usb: dwc3: gadget: END_TRANSFER before CLEAR_STALL command

commit d97c78a1908e59a1fdbcbece87cd0440b5d7a1f2 upstream.

According the programming guide (for all DWC3 IPs), when the driver
handles ClearFeature(halt) request, it should issue CLEAR_STALL command
_after_ the END_TRANSFER command completes. The END_TRANSFER command may
take some time to complete. So, delay the ClearFeature(halt) request
control status stage and wait for END_TRANSFER command completion
interrupt. Only after END_TRANSFER command completes that the driver
may issue CLEAR_STALL command.

Cc: stable@vger.kernel.org
Fixes: cb11ea56f37a ("usb: dwc3: gadget: Properly handle ClearFeature(halt)")
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
drivers/usb/dwc3/gadget.h