android_kernel_samsung_sm8650/drivers/usb
Mathias Nyman 44f2ed29e1 xhci: Fix incorrect tracking of free space on transfer rings
commit fe82f16aafdaf8002281d3b9524291d4a4a28460 upstream.

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-24 17:32:49 +01:00
..
atm usb: move from strlcpy with unused retval to strscpy 2022-08-19 11:08:54 +02:00
c67x00 USB: c67x00: remove unnecessary check of res 2022-05-12 11:36:46 +02:00
cdns3 usb: cdnsp: Fixes error: uninitialized symbol 'len' 2023-04-13 16:55:26 +02:00
chipidea usb: chipidea: fix missing goto in ci_hdrc_probe 2023-05-11 23:03:30 +09:00
class USB: usbtmc: Fix direction for 0-length ioctl control messages 2023-05-24 17:32:48 +01:00
common USB: ULPI: fix memory leak with using debugfs_lookup() 2023-03-11 13:55:36 +01:00
core USB: fix memory leak with using debugfs_lookup() 2023-03-11 13:55:34 +01:00
dwc2 usb: dwc2: fix a devres leak in hw_enable upon suspend resume 2023-03-30 12:49:22 +02:00
dwc3 usb: dwc3: debugfs: Resume dwc3 before accessing registers 2023-05-24 17:32:48 +01:00
early usb: early: xhci-dbc: Fix a potential out-of-bound memory access 2023-03-10 09:33:35 +01:00
gadget Revert "usb: gadget: udc: core: Invoke usb_gadget_connect only when started" 2023-05-24 17:32:49 +01:00
host xhci: Fix incorrect tracking of free space on transfer rings 2023-05-24 17:32:49 +01:00
image usb/image: fix repeated words in comments 2022-07-27 14:33:53 +02:00
isp1760 usb: isp1760: Fix out-of-bounds array access 2022-05-19 18:10:59 +02:00
misc usb: misc: onboard-hub: add support for Microchip USB2517 USB 2.0 hub 2023-03-30 12:49:22 +02:00
mon usb: mon: make mmapped memory read only 2022-09-22 15:52:29 +02:00
mtu3 usb: mtu3: fix kernel panic at qmu transfer done irq handler 2023-05-11 23:03:30 +09:00
musb usb: musb: mediatek: don't unregister something that wasn't registered 2023-03-10 09:33:35 +01:00
phy USB/Thunderbolt changes for 6.1-rc1 2022-10-07 16:48:26 -07:00
renesas_usbhs usb: renesas: Fix refcount leak bug 2022-06-21 16:39:03 +02:00
roles usb: roles: fix of node refcount leak in usb_role_switch_is_parent() 2022-12-31 13:32:41 +01:00
serial USB: serial: option: add UNISOC vendor and TOZED LT70C product 2023-05-01 08:26:27 +09:00
storage usb-storage: fix deadlock when a scsi command timeouts more than once 2023-05-24 17:32:48 +01:00
typec usb: typec: altmodes/displayport: fix pin_assignment_show 2023-05-24 17:32:48 +01:00
usbip use less confusing names for iov_iter direction initializers 2023-02-09 11:28:04 +01:00
Kconfig
Makefile
usb-skeleton.c