]> git.baikalelectronics.ru Git - kernel.git/commit
usb: dwc3: gadget: Fix request completion check
authorThinh Nguyen <Thinh.Nguyen@synopsys.com>
Tue, 31 Mar 2020 08:40:35 +0000 (01:40 -0700)
committerFelipe Balbi <balbi@kernel.org>
Fri, 17 Apr 2020 07:07:01 +0000 (10:07 +0300)
commitc62ed4d3ade6668f596bc1cadebd244bd8f4e184
tree48577acb7e8f1f4d3cc266898f3b56d7c71b6fff
parent73d429cf5cb47630ad451ec397a6cefe63023849
usb: dwc3: gadget: Fix request completion check

A request may not be completed because not all the TRBs are prepared for
it. This happens when we run out of available TRBs. When some TRBs are
completed, the driver needs to prepare the rest of the TRBs for the
request. The check dwc3_gadget_ep_request_completed() shouldn't be
checking the amount of data received but rather the number of pending
TRBs. Revise this request completion check.

Cc: stable@vger.kernel.org
Fixes: c0a43704326b ("usb: dwc3: gadget: simplify IOC handling")
Signed-off-by: Thinh Nguyen <thinhn@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
drivers/usb/dwc3/gadget.c