]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.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)
committerStefan Bader <stefan.bader@canonical.com>
Thu, 10 Dec 2020 11:06:06 +0000 (12:06 +0100)
commita1512e5fab843a49e226f8808e95e400eb19e2f3
tree7bf2696e1b4a736e0b39437122338eca7b28f62f
parent04828ee4fe75723163e6b2a97b7797f6808b1c3c
usb: dwc3: gadget: Reclaim extra TRBs after request completion

BugLink: https://bugs.launchpad.net/bugs/1905618
[ 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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/usb/dwc3/gadget.c