]> www.infradead.org Git - users/dwmw2/linux.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)
committerFelipe Balbi <balbi@kernel.org>
Thu, 24 Sep 2020 08:56:01 +0000 (11:56 +0300)
commitd97c78a1908e59a1fdbcbece87cd0440b5d7a1f2
treeb40473c2b1da41d86769218a671d5487cd92d41f
parentc503672abe1348f10f5a54a662336358c6e1a297
usb: dwc3: gadget: END_TRANSFER before CLEAR_STALL command

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>
drivers/usb/dwc3/core.h
drivers/usb/dwc3/ep0.c
drivers/usb/dwc3/gadget.c
drivers/usb/dwc3/gadget.h