linux/drivers/usb/dwc3
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
..
core.c usb: dwc3: Capture new capability register GHWPARAMS9 2021-04-23 13:05:15 +02:00
core.h usb: dwc3: gadget: Rename EOPF event macros to Suspend 2021-05-10 14:45:49 +02:00
debug.h usb: dwc3: gadget: Rename EOPF event macros to Suspend 2021-05-10 14:45:49 +02:00
debugfs.c usb: dwc3: fix incorrect kernel-doc comment syntax in files 2021-04-02 15:20:51 +02:00
drd.c usb: dwc3: drd: Improve dwc3_get_extcon() style 2020-12-28 15:51:40 +01:00
dwc3-exynos.c usb: dwc3: exynos: fix incorrect kernel-doc comment syntax 2021-04-02 15:20:54 +02:00
dwc3-haps.c usb: dwc3: haps: Constify the software node 2021-02-04 15:42:06 +01:00
dwc3-imx8mp.c usb: dwc3: imx8mp: fix error return code in dwc3_imx8mp_probe() 2021-05-10 14:58:41 +02:00
dwc3-keystone.c usb: dwc3: fix incorrect kernel-doc comment syntax in files 2021-04-02 15:20:51 +02:00
dwc3-meson-g12a.c usb: dwc3: meson-g12a: disable clk on error handling path in probe 2020-12-28 15:45:14 +01:00
dwc3-of-simple.c usb: dwc3: Add driver for Xilinx platforms 2021-03-23 12:48:14 +01:00
dwc3-omap.c usb: dwc3: omap: improve extcon initialization 2021-05-10 15:04:37 +02:00
dwc3-pci.c usb: dwc3: pci: Enable usb2-gadget-lpm-disable for Intel Merrifield 2021-05-10 14:40:21 +02:00
dwc3-qcom.c usb: dwc3: qcom: Detect DWC3 DT-nodes using compatible string 2021-04-10 10:46:09 +02:00
dwc3-st.c usb: dwc3: st: fix incorrect kernel-doc comment syntax in file 2021-04-02 15:20:46 +02:00
dwc3-xilinx.c usb: dwc3: xilinx: Remove the extra freeing of clocks 2021-04-09 16:05:32 +02:00
ep0.c usb: dwc3: ep0: Fix delay status handling 2020-10-27 11:33:53 +02:00
gadget.c usb: dwc3: gadget: Properly track pending and queued SG 2021-05-21 14:25:07 +02:00
gadget.h usb: dwc3: add cancelled reasons for dwc3 requests 2021-04-02 15:27:36 +02:00
host.c usb: dwc3: host: Use software node API with the properties 2021-02-05 10:08:19 +01:00
io.h usb: dwc3: fix incorrect kernel-doc comment syntax in files 2021-04-02 15:20:51 +02:00
Kconfig usb: dwc3: Add driver for Xilinx platforms 2021-03-23 12:48:14 +01:00
Makefile usb: dwc3: Add driver for Xilinx platforms 2021-03-23 12:48:14 +01:00
trace.c usb: dwc3: fix incorrect kernel-doc comment syntax in files 2021-04-02 15:20:51 +02:00
trace.h usb: dwc3: fix incorrect kernel-doc comment syntax in files 2021-04-02 15:20:51 +02:00
ulpi.c usb: dwc3: ulpi: Fix USB2.0 HS/FS/LS PHY suspend regression 2020-12-28 15:55:44 +01:00