usb: dwc3: gadget: Ignore NoStream after End Transfer
authorThinh Nguyen <Thinh.Nguyen@synopsys.com>
Mon, 25 Oct 2021 23:21:10 +0000 (16:21 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Dec 2021 08:04:39 +0000 (09:04 +0100)
commitd92d8b5893668db88483fd85f96b7f9e5dadf544
tree84da19a227e942ebb94be01b15ce329d8798a56c
parent949fac2e09ddd1efdfbbe0ee155c3ac6c143e336
usb: dwc3: gadget: Ignore NoStream after End Transfer

commit d74dc3e9f58c28689cef1faccf918e06587367d3 upstream.

The End Transfer command from a stream endpoint will generate a NoStream
event, and we should ignore it. Currently we set the flag
DWC3_EP_IGNORE_NEXT_NOSTREAM to track this prior to sending the command,
and it will be cleared on the next stream event. However, a stream event
may be generated before the End Transfer command completion and
prematurely clear the flag. Fix this by setting the flag on End Transfer
completion instead.

Fixes: 140ca4cfea8a ("usb: dwc3: gadget: Handle stream transfers")
Cc: <stable@vger.kernel.org>
Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://lore.kernel.org/r/cee1253af4c3600edb878d11c9c08b040817ae23.1635203975.git.Thinh.Nguyen@synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/dwc3/gadget.c