All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: "Rene D. Obermueller" <cmdrrdo@gmail.com>
Cc: linux-usb@vger.kernel.org
Subject: Re: ERROR: unexpected command completion code 0x11 for DJ-Tech CTRL (resending as plain text ;)
Date: Mon, 23 Dec 2019 14:14:36 +0200	[thread overview]
Message-ID: <98997f07-80ef-b86a-6702-448e68ff4ffa@linux.intel.com> (raw)
In-Reply-To: <d65f140c-0854-62a5-f21e-5d92f0575635@gmail.com>

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;

  parent reply	other threads:[~2019-12-23 12:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-20 13:50 ERROR: unexpected command completion code 0x11 for DJ-Tech CTRL (resending as plain text ;) Rene D. Obermueller
2019-12-20 14:48 ` Mathias Nyman
     [not found]   ` <d65f140c-0854-62a5-f21e-5d92f0575635@gmail.com>
2019-12-23 12:14     ` Mathias Nyman [this message]
2019-12-23 22:15       ` Rene D. Obermueller
2019-12-24 15:28       ` Alan Stern
2020-01-02 11:20         ` Mathias Nyman
2020-01-02 15:31           ` Alan Stern
2020-01-02 16:01             ` Mathias Nyman
2020-01-03  9:29               ` Felipe Balbi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=98997f07-80ef-b86a-6702-448e68ff4ffa@linux.intel.com \
    --to=mathias.nyman@linux.intel.com \
    --cc=cmdrrdo@gmail.com \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.