On 20.12.2019 17.50, Rene D. Obermueller wrote:
Hello Mathias,
On 20.12.19 15:48, Mathias Nyman wrote:
0x11 is Parameter error "Asserted by a command if a Context parameter is invalid."
adding xhci tracing will show more details.
[...]
Your log shows it's related to the input context pointed to when
we issue a configure endpoint command:
[...]
Could be any part of the input context.
(input control context, slot context, or one of the endpoint context).
xhci tracepoints will show the input control context and the slot context.
If those seem fine we might need to add a hack that just dumps everything, including all endpoint contexts
thanks for the explanation and instructions. Attaching the trace output.
I've had a brief look at the trace, and I didn't see anything that was obvious to me, but that's probably not saying much. ;)
The Maximum Packet Size of the full-speed bulk endpoint looks a bit suspicious (maxp 4)
12478.521580: xhci_add_endpoint: State disabled mult 1 max P. Streams 0 interval 125 us max ESIT payload 0 CErr 3 Type Bulk OUT burst 0 maxp 4 deq 00000000fff71001
For full speed bulk endpoints only support 8, 16, 32 and 64 bytes Max Packet sizes.
Host are not required to support other values. See USB2 spec section 5.8.3 for details
Maybe forcing it to one of the allowed values could work.
Does the below hack help? (untested)?
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index 3b1388fa2f36..29102776baed 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -1476,8 +1476,12 @@ int xhci_endpoint_init(struct xhci_hcd *xhci,
if (!usb_endpoint_xfer_isoc(&ep->desc))
err_count = 3;
/* 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) {
+ if (udev->speed == USB_SPEED_HIGH)
+ max_packet = 512;
+ if (udev->speed == USB_SPEED_FULL)
+ max_packet = 1 << (fls(clamp_val(max_packet, 8, 64)) - 1);
+ }
/* 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;