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

Commit 2d950c32 authored by Manu Gautam's avatar Manu Gautam Committed by Mayank Rana
Browse files

usb: xhci: Set bulk EP maxpacket to 8 for buggy FS devices



Some FS devices report maxpacket size as 4 for their BULK EPs
which is incorrect as per USB specification. This results in
ep_config command to controller timing out and enumeration fails.
As minimum maxpacket size for FS is 8, hence override the same
for such devices.

CRs-fixed: 1002876
Change-Id: I70c2210b4eb93f557eef306fcbc11308b7b33e07
Signed-off-by: default avatarManu Gautam <mgautam@codeaurora.org>
Signed-off-by: default avatarMayank Rana <mrana@codeaurora.org>
parent 79d42bd7
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1507,6 +1507,11 @@ int xhci_endpoint_init(struct xhci_hcd *xhci,
	/* Some devices get this wrong */
	if (usb_endpoint_xfer_bulk(&ep->desc) && udev->speed == USB_SPEED_HIGH)
		max_packet = 512;

	if (usb_endpoint_xfer_bulk(&ep->desc) && udev->speed == USB_SPEED_FULL
				&& max_packet < 8)
		max_packet = 8;

	/* xHCI 1.0 and 1.1 indicates that ctrl ep avg TRB Length should be 8 */
	if (usb_endpoint_xfer_control(&ep->desc) && xhci->hci_version >= 0x100)
		avg_trb_len = 8;