UPSTREAM: usb: dwc3: gadget: issue ENDTRANSFER conditional on resource_index
authorFelipe Balbi <felipe.balbi@linux.intel.com>
Tue, 21 Jun 2016 07:32:02 +0000 (10:32 +0300)
committerHuang, Tao <huangtao@rock-chips.com>
Tue, 16 Aug 2016 12:48:19 +0000 (20:48 +0800)
commit1360b6f0941cf79dea4b6ae758340399ef9ca744
tree9e9d57482d4a2e9b1e283bc93e1fd71acc81bb76
parent172121786ce09a2751c1ba4641a599ccb04db36b
UPSTREAM: usb: dwc3: gadget: issue ENDTRANSFER conditional on resource_index

Because of recent changes to transfer handling on
DWC3, we will not get XferComplete unless we
completely fill up our TRB ring. This means that we
might get a Reset or Disconnect without getting a
XferComplete first.

In order to correctly release our allocated Transfer
Resource, we must issue ENDTRANSFER command whenever
dep->resource_index is valid.

Change-Id: I6f78a239e26d754c2472f06789f820d42261d31d
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
(cherry picked from commit 0e146028eebf989e86d3fe9385b76434e954c84e)
drivers/usb/dwc3/gadget.c