Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a061a5a0 authored by Andiry Xu's avatar Andiry Xu Committed by Greg Kroah-Hartman
Browse files

USB: xHCI: allocate bigger ring for isochronous endpoint



Isochronous endpoint needs a bigger size of transfer ring. Isochronous URB
consists of multiple packets, each packet needs a isoc td to carry, and
there will be multiple trbs inserted to the ring at one time. One segment
is too small for isochronous endpoints, and it will result in
room_on_ring() check failure and the URB is failed to enqueue.

Allocate bigger ring for isochronous endpoint. 8 segments should be enough.
This will be replaced with dynamic ring expansion in the future.

Signed-off-by: default avatarAndiry Xu <andiry.xu@amd.com>
Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 04e51901
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -1112,6 +1112,16 @@ int xhci_endpoint_init(struct xhci_hcd *xhci,
	ep_ctx = xhci_get_ep_ctx(xhci, virt_dev->in_ctx, ep_index);

	/* Set up the endpoint ring */
	/*
	 * Isochronous endpoint ring needs bigger size because one isoc URB
	 * carries multiple packets and it will insert multiple tds to the
	 * ring.
	 * This should be replaced with dynamic ring resizing in the future.
	 */
	if (usb_endpoint_xfer_isoc(&ep->desc))
		virt_dev->eps[ep_index].new_ring =
			xhci_ring_alloc(xhci, 8, true, mem_flags);
	else
		virt_dev->eps[ep_index].new_ring =
			xhci_ring_alloc(xhci, 1, true, mem_flags);
	if (!virt_dev->eps[ep_index].new_ring) {