linux-stable/drivers/usb
Thinh Nguyen 25dda9fc56 usb: dwc3: gadget: Properly track pending and queued SG
The driver incorrectly uses req->num_pending_sgs to track both the
number of pending and queued SG entries. It only prepares the next
request if the previous is done, and it doesn't update num_pending_sgs
until there is TRB completion interrupt. This may starve the controller
of more TRBs until the num_pending_sgs is decremented.

Fix this by decrementing the num_pending_sgs after they are queued and
properly track both num_mapped_sgs and num_queued_sgs.

Fixes: c96e6725db ("usb: dwc3: gadget: Correct the logic for queuing sgs")
Cc: <stable@vger.kernel.org>
Reported-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Tested-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Acked-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://lore.kernel.org/r/ba24591dbcaad8f244a3e88bd449bb7205a5aec3.1620874069.git.Thinh.Nguyen@synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-21 14:25:07 +02:00
..
atm drivers: usb: atm: use pr_err() and pr_warn() instead of raw printk() 2020-12-09 15:22:51 +01:00
c67x00 usb/c67x00: Replace tasklet with work 2021-01-26 18:36:37 +01:00
cdns3 usb: cdnsp: Fixes issue with Configure Endpoint command 2021-04-12 20:19:23 +08:00
chipidea usb: chipidea: tegra: Silence deferred probe error 2021-03-23 12:50:32 +01:00
class cdc-wdm: untangle a circular dependency between callback and softint 2021-05-10 14:39:51 +02:00
common usb: common: move function's kerneldoc next to its definition 2021-03-10 09:37:17 +01:00
core USB: usbfs: Don't WARN about excessively large memory allocations 2021-05-21 14:24:46 +02:00
dwc2 usb: dwc2: Remove obsolete MODULE_ constants from platform.c 2021-05-10 14:59:05 +02:00
dwc3 usb: dwc3: gadget: Properly track pending and queued SG 2021-05-21 14:25:07 +02:00
early
gadget SCSI misc on 20210428 2021-04-28 17:22:10 -07:00
host xhci: Add reset resume quirk for AMD xhci controller. 2021-05-13 14:47:36 +02:00
image
isp1760
misc usb: misc: adutux: fix whitespace coding style issue 2021-04-22 10:49:53 +02:00
mon
mtu3 usb: mtu3: drop CONFIG_OF 2021-03-26 14:47:19 +01:00
musb usb: musb: Fix an error message 2021-05-10 16:17:57 +02:00
phy usb: phy: phy-mxs-usb: Use of_device_get_match_data() 2021-01-18 18:35:46 +01:00
renesas_usbhs usb: renesas_usbhs: fix error return code of usbhsf_pkt_handler() 2021-03-23 12:42:15 +01:00
roles usb: roles: Call try_module_get() from usb_role_switch_find_by_fwnode() 2021-04-09 16:07:03 +02:00
serial USB/Thunderbolt patches for 5.13-rc1 2021-04-26 11:32:23 -07:00
storage usb: storage: datafab: remove redundant assignment of variable result 2021-04-22 10:52:10 +02:00
typec Driver core fixes for 5.13-rc2 2021-05-16 10:13:14 -07:00
usbip Scheduler updates for this cycle are: 2021-04-28 13:33:57 -07:00
Kconfig
Makefile usb: cdnsp: cdns3 Add main part of Cadence USBSSP DRD Driver 2020-12-29 12:36:13 +08:00
usb-skeleton.c