linux/drivers/usb/dwc3
Amit Virdi adcf241285 usb: dwc3: gadget: Stop TRB preparation after limit is reached
commit 39e60635a0 upstream.

DWC3 gadget sets up a pool of 32 TRBs for each EP during initialization. This
means, the max TRBs that can be submitted for an EP is fixed to 32. Since the
request queue for an EP is a linked list, any number of requests can be queued
to it by the gadget layer.  However, the dwc3 driver must not submit TRBs more
than the pool it has created for. This limit wasn't respected when SG was used
resulting in submitting more than the max TRBs, eventually leading to
non-transfer of the TRBs submitted over the max limit.

Root cause:
When SG is used, there are two loops iterating to prepare TRBs:
 - Outer loop over the request_list
 - Inner loop over the SG list
The code was missing break to get out of the outer loop.

Fixes: eeb720fb21 (usb: dwc3: gadget: add support for SG lists)
Signed-off-by: Amit Virdi <amit.virdi@st.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2015-01-27 08:18:56 -08:00
..
core.c usb: dwc3: core: fix ordering for PHY suspend 2014-10-05 14:52:20 -07:00
core.h usb: dwc3: fix randconfig build errors 2014-05-06 07:59:33 -07:00
debug.h usb: dwc3: switch to GPL v2 only 2013-07-29 13:56:44 +03:00
debugfs.c usb: dwc3: switch to GPL v2 only 2013-07-29 13:56:44 +03:00
dwc3-exynos.c usb: dwc3: fix the glue drivers using the nop phy 2013-12-19 09:27:41 -06:00
dwc3-keystone.c usb: dwc3: add Keystone specific glue layer 2013-12-12 13:43:07 -06:00
dwc3-omap.c usb: dwc3: omap: fix ordering for runtime pm calls 2014-10-05 14:52:15 -07:00
dwc3-pci.c usb: dwc3: fix the glue drivers using the nop phy 2013-12-19 09:27:41 -06:00
ep0.c usb: dwc3: gadget: fix set_halt() bug with pending transfers 2014-11-14 09:00:11 -08:00
gadget.c usb: dwc3: gadget: Stop TRB preparation after limit is reached 2015-01-27 08:18:56 -08:00
gadget.h usb: dwc3: gadget: fix set_halt() bug with pending transfers 2014-11-14 09:00:11 -08:00
host.c usb: dwc3: switch to GPL v2 only 2013-07-29 13:56:44 +03:00
io.h usb: dwc3: switch to GPL v2 only 2013-07-29 13:56:44 +03:00
Kconfig usb: dwc3: add Keystone specific glue layer 2013-12-12 13:43:07 -06:00
Makefile usb: dwc3: add Keystone specific glue layer 2013-12-12 13:43:07 -06:00
platform_data.h usb: dwc3: adapt to use dr_mode device tree helper 2013-07-29 13:56:51 +03:00