linux/drivers/usb
Mathias Nyman fe82f16aaf xhci: Fix incorrect tracking of free space on transfer rings
This incorrect tracking caused unnecessary ring expansion in some
usecases which over days of use consume a lot of memory.

xhci driver tries to keep track of free transfer blocks (TRBs) on the
ring buffer, but failed to add back some cancelled transfers that were
turned into no-op operations instead of just moving past them.

This can happen if there are several queued pending transfers which
then are cancelled in reverse order.

Solve this by counting the numer of steps we move the dequeue pointer
once we complete a transfer, and add it to the number of free trbs
instead of just adding the trb number of the current transfer.
This way we ensure we count the no-op trbs on the way as well.

Fixes: 55f6153d8c ("xhci: remove extra loop in interrupt context")
Cc: stable@vger.kernel.org
Reported-by: Miller Hunter <MillerH@hearthnhome.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217242
Tested-by: Miller Hunter <MillerH@hearthnhome.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20230515134059.161110-3-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-16 16:57:49 +02:00
..
atm
c67x00
cdns3 Merge 6.3-rc6 into usb-next 2023-04-10 08:56:59 +02:00
chipidea usb: chipidea: fix missing goto in ci_hdrc_probe 2023-04-20 11:16:42 +02:00
class USB: usbtmc: Fix direction for 0-length ioctl control messages 2023-05-13 17:25:49 +09:00
common Char/Misc drivers for 6.4-rc1 2023-04-27 12:07:50 -07:00
core Driver core changes for 6.4-rc1 2023-04-27 11:53:57 -07:00
dwc2 usb: dwc2: platform: add support for utmi optional clock 2023-04-20 10:17:06 +02:00
dwc3 usb: dwc3: fix a test for error in dwc3_core_init() 2023-05-13 18:52:04 +09:00
early usb: early: xhci-dbc: Use memcpy_and_pad() 2023-01-31 10:40:54 +01:00
fotg210 USB: fotg210: fix memory leak with using debugfs_lookup() 2023-02-06 13:46:42 +01:00
gadget usb: gadget: u_ether: Fix host MAC address case 2023-05-13 18:46:59 +09:00
host xhci: Fix incorrect tracking of free space on transfer rings 2023-05-16 16:57:49 +02:00
image scsi: usb: uas: Declare two host templates and host template pointers const 2023-03-24 19:20:00 -04:00
isp1760
misc USB: sisusbvga: Add endpoint checks 2023-04-20 11:43:22 +02:00
mon driver core: class: remove module * from class_create() 2023-03-17 15:16:33 +01:00
mtu3 usb: mtu3: add optional clock xhci_ck and frmcnt_ck 2023-04-20 11:17:05 +02:00
musb usb: musb: ux500: Convert to platform remove callback returning void 2023-04-05 19:07:42 +02:00
phy usb: phy: twl6030: Convert to platform remove callback returning void 2023-03-23 17:35:27 +01:00
renesas_usbhs usb: renesas_usbhs: drop of_match_ptr for ID table 2023-03-16 12:15:23 +01:00
roles driver core: class: remove module * from class_create() 2023-03-17 15:16:33 +01:00
serial Driver core changes for 6.4-rc1 2023-04-27 11:53:57 -07:00
storage usb-storage: fix deadlock when a scsi command timeouts more than once 2023-05-13 18:53:03 +09:00
typec usb: typec: tps6598x: Fix fault at module removal 2023-05-13 18:51:09 +09:00
usbip Including fixes from bpf, netfilter and can. 2022-12-21 08:41:32 -08:00
Kconfig usb: move config USB_USS720 to usb's misc Kconfig 2023-03-29 10:34:08 +02:00
Makefile usb: host: u132-hcd: Delete driver 2023-03-21 14:06:11 +01:00
usb-skeleton.c usb: add usb_set_intfdata() documentation 2022-11-29 08:56:09 +01:00