usb: xhci: keep the transaction count out of Max Packet Size
Subsystems (2)
PATCH 1/1 usb: xhci: keep the transaction count out of Max Packet Size
Bits 12:11 of wMaxPacketSize hold the number of additional transactions per microframe of high-speed isochronous and interrupt endpoints. xhci_get_endpoint_max_burst() already programs them as Max Burst Size, but xhci_set_configuration() copies them into Max Packet Size as well, so a high-bandwidth endpoint ends up with a Max Packet Size beyond the 1024 bytes a high-speed endpoint can have.
Mask them off, like Linux does since commit f94e0186312b ("USB: xhci:
Bandwidth allocation support"), with the mask fixed to cover bit 10 in commit dc07c91b9b40 ("xHCI: fix wMaxPacketSize mask").
--- drivers/usb/host/xhci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/host/xhci.c +2 -2
@@ -574,8 +574,8 @@ static int xhci_set_configuration(struct usb_device *udev) ep_ctx[ep_index]->ep_info2 =cpu_to_le32 (EP_TYPE (ep_type)); ep_ctx[ep_index]->ep_info2 |= -cpu_to_le32 (MAX_PACKET - (get_unaligned (&endpt_desc->wMaxPacketSize))); +cpu_to_le32 (MAX_PACKET (get_unaligned (&endpt_desc->wMaxPacketSize) & +USB_ENDPOINT_MAXP_MASK ));/* Allow 3 retries for everything but isoc, set CErr = 3 */ if (!usb_endpoint_xfer_isoc (endpt_desc))
Signature · 1 line
2.47.3
Sascha Hauer
AppliedQuoted 8 lines · Ahmad Fatoum
Bits 12:11 of wMaxPacketSize hold the number of additional transactions per microframe of high-speed isochronous and interrupt endpoints.
xhci_get_endpoint_max_burst()already programs them as Max Burst Size, butxhci_set_configuration()copies them into Max Packet Size as well, so a high-bandwidth endpoint ends up with a Max Packet Size beyond the 1024 bytes a high-speed endpoint can have.[...]
Applied, thanks!
[1/1] usb: xhci: keep the transaction count out of Max Packet Size
https://git.pengutronix.de/cgit/barebox/commit/?id=2c9589d5238c (link may not be stable)
Best regards,
Signature · 1 line
Sascha Hauer <[email protected]>