twx-linux/drivers/usb
Mathias Nyman cc31dba9af xhci: Fix failure to detect ring expansion need.
commit b234c70fefa7532d34ebee104de64cc16f1b21e4 upstream.

Ring expansion checker may incorrectly assume a completely full ring
is empty, missing the need for expansion.

This is due to a special empty ring case where the dequeue ends up
ahead of the enqueue pointer. This is seen when enqueued TRBs fill up
exactly a segment, with enqueue then pointing to the end link TRB.
Once those TRBs are handled the dequeue pointer will follow the link
TRB and end up pointing to the first entry on the next segment, past
the enqueue.

This same enqueue - dequeue condition can be true if a ring is full,
with enqueue ending on that last link TRB before the dequeue pointer
on the next segment.

This can be seen when queuing several ~510 small URBs via usbfs in
one go before a single one is handled (i.e. dequeue not moved from first
entry in segment).

Expand the ring already when enqueue reaches the link TRB before the
dequeue segment, instead of expanding it when enqueue moves into the
dequeue segment.

Reported-by: Chris Yokum <linux-usb@mail.totalphase.com>
Closes: https://lore.kernel.org/all/949223224.833962.1709339266739.JavaMail.zimbra@totalphase.com
Tested-by: Chris Yokum <linux-usb@mail.totalphase.com>
Fixes: f5af638f0609 ("xhci: Fix transfer ring expansion size calculation")
Cc: stable@vger.kernel.org # v6.5+
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20240305132312.955171-2-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-04-03 15:28:42 +02:00
..
atm
c67x00 usb: c67x00-drv: Convert to platform remove callback returning void 2023-05-28 12:36:14 +01:00
cdns3 usb: cdns3: fix memory double free when handle zero packet 2024-03-01 13:35:02 +01:00
chipidea usb: chipidea: core: handle power lost in workqueue 2024-02-23 09:24:57 +01:00
class usb: cdc-acm: return correct error code on unsupported break 2024-01-25 15:35:53 -08:00
common usb: ulpi: Fix debugfs directory leak 2024-02-23 09:24:56 +01:00
core usb: port: Don't try to peer unused USB ports based on location 2024-04-03 15:28:42 +02:00
dwc2 USB: dwc2: write HCINT with INTMASK applied 2023-12-03 07:33:10 +01:00
dwc3 usb: dwc3-am62: Disable wakeup at remove 2024-04-03 15:28:25 +02:00
early
fotg210 usb: fotg210-hcd: delete an incorrect bounds test 2024-01-01 12:42:41 +00:00
gadget usb: gadget: ncm: Fix handling of zero block length packets 2024-04-03 15:28:42 +02:00
host xhci: Fix failure to detect ring expansion need. 2024-04-03 15:28:42 +02:00
image
isp1760 usb: isp1760: Convert to platform remove callback returning void 2023-05-28 12:38:01 +01:00
misc usb: misc: onboard-hub: add support for Microchip USB5744 2023-12-03 07:33:08 +01:00
mon usb: mon: Fix atomicity violation in mon_bin_vma_fault 2024-01-25 15:35:43 -08:00
mtu3 usb: Explicitly include correct DT includes 2023-07-25 18:20:02 +02:00
musb usb: musb: Get the musb_qh poniter after musb_giveback 2023-10-02 13:37:57 +02:00
phy usb: phy: generic: Get the vbus supply 2024-03-26 18:20:04 -04:00
renesas_usbhs usb: Explicitly include correct DT includes 2023-07-25 18:20:02 +02:00
roles usb: roles: don't get/set_role() when usb_role_switch is unregistered 2024-03-01 13:35:02 +01:00
serial USB: serial: cp210x: add pid/vid for TDK NC0110013M and MM0110113M 2024-04-03 15:28:24 +02:00
storage USB: usb-storage: Prevent divide-by-0 error in isd200_ata_command 2024-04-03 15:28:42 +02:00
typec usb: typec: altmodes/displayport: create sysfs nodes as driver's default device attribute group 2024-04-03 15:28:42 +02:00
usbip USB: usbip: fix stub_dev hub disconnect 2023-11-20 11:59:26 +01:00
Kconfig
Makefile
usb-skeleton.c