]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
usb: dwc3: gadget: Reclaim extra TRBs after request completion
authorThinh Nguyen <Thinh.Nguyen@synopsys.com>
Thu, 24 Sep 2020 08:21:24 +0000 (01:21 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Nov 2020 18:18:41 +0000 (19:18 +0100)
commitc140bebb066509710a8c83c9cec2ff866410db11
tree869aa1c3ed8de34449aa131665f1513222d1abe2
parentb77df211071a8881b01d28d5cf52d240db018bf7
usb: dwc3: gadget: Reclaim extra TRBs after request completion

[ Upstream commit 690e5c2dc29f8891fcfd30da67e0d5837c2c9df5 ]

An SG request may be partially completed (due to no available TRBs).
Don't reclaim extra TRBs and clear the needs_extra_trb flag until the
request is fully completed. Otherwise, the driver will reclaim the wrong
TRB.

Cc: stable@vger.kernel.org
Fixes: 1f512119a08c ("usb: dwc3: gadget: add remaining sg entries to ring")
Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/dwc3/gadget.c