linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mathias Nyman <mathias.nyman@intel.com>
To: Kai-Heng Feng <kai.heng.feng@canonical.com>,
	Mathias Nyman <mathias.nyman@linux.intel.com>
Cc: USB list <linux-usb@vger.kernel.org>
Subject: Re: ERROR Transfer event TRB DMA ptr not part of current TD ep_index 2 comp_code 13
Date: Tue, 26 Nov 2019 12:54:40 +0200	[thread overview]
Message-ID: <fa9c6b0a-fde6-db4c-6033-edc8165177f3@intel.com> (raw)
In-Reply-To: <72BADF0A-08FF-42FE-B957-F4098F8C34BD@canonical.com>

On 26.11.2019 11.44, Kai-Heng Feng wrote:
> 
>>> The log is quite large so I pasted it here:
>>> https://pastebin.ubuntu.com/p/wWpS8ctNrb/
>>> Kai-Heng
>>
>> Thanks, ring dumps shows xHC hardware never wrote an event to the event ring for the TRB at 0x487a0fe0.
>>
>> Event ring:
>> [   61.114263] xhci_hcd 0000:3f:00.0: 0x000000049803a5d0: TRB 0000000487a08fd0 status 'Short Packet' len 20416 slot 4 ep 3 type 'Transfer Event' flags e:c
>>   we got a short packet event for TRB at 0x487a08fd0, which is one TRB before
>> [   61.114269] xhci_hcd 0000:3f:00.0: 0x000000049803a5e0: TRB 0000000487a07a30 status 'Success' len 0 slot 4 ep 4 type 'Transfer Event' flags e:c
>> [   61.114275] xhci_hcd 0000:3f:00.0: 0x000000049803a5f0: TRB 0000000487a07a40 status 'Success' len 0 slot 4 ep 4 type 'Transfer Event' flags e:c
>> [   61.114281] xhci_hcd 0000:3f:00.0: 0x000000049803a600: TRB 0000000487a09000 status 'Short Packet' len 20416 slot 4 ep 3 type 'Transfer Event' flags e:c
>>   we got a short packet event for TRB at 487a09000, which is one TRB after,
>>   but no event for 0x487a0fe0
>>
>> The TRB at 0x487a0fe0 in the endpoint ring looks fine:
>> [   61.118683] xhci_hcd 0000:3f:00.0: 0x0000000487a08fc0: Buffer 000000046eef0000 length 32768 TD size 0 intr 0 type 'Normal' flags b:i:I:c:s:I:e:C
>> [   61.118689] xhci_hcd 0000:3f:00.0: 0x0000000487a08fd0: Buffer 000000048e740000 length 32768 TD size 0 intr 0 type 'Normal' flags b:i:I:c:s:I:e:C
>> [   61.118696] xhci_hcd 0000:3f:00.0: 0x0000000487a08fe0: Buffer 000000046ebe8000 length 32768 TD size 0 intr 0 type 'Normal' flags b:i:I:c:s:I:e:C
>> [   61.118702] xhci_hcd 0000:3f:00.0: 0x0000000487a08ff0: LINK 0000000487a09000 intr 0 type 'Link' flags i:c:T:C
>>
>> The TRB with missing event is similar to all the other Normal TRBs in the ring.
>> It has both interrupt on completion, and interrupt on short packet bits set.
>> Can't see any reason why an event wasn't generated.
> 
> Thanks for you analysis.
> The driver for xHCI is a little bit overwhelming, so I didn't read the code through.
> 
>>
>> It seems it's always the TRB just before the LINK TRB that is missing an event.
>> (address ends with 0xfe0).
>>
>> Best guess is that this particular xHC (ASmedia) can't correctly generate events
>> for the TRB right before Link  TRB
> 
> Is it possible to still use the TRB with missing event, based on this behavior?
> 
> Kai-Heng
> 

For OUT transfers we don't know if the data the trb dma pointer points to is sent or not.

For IN transfers you could in theory check if anything was written to the buffer provided,
but doing something like this would be very hackish.

-Mathias


      reply	other threads:[~2019-11-26 10:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-21  7:38 ERROR Transfer event TRB DMA ptr not part of current TD ep_index 2 comp_code 13 Kai-Heng Feng
2019-11-21 11:47 ` Greg KH
2019-11-21 16:44   ` Kai-Heng Feng
2019-11-21 11:48 ` Mathias Nyman
2019-11-21 16:43   ` Kai-Heng Feng
2019-11-22 12:17     ` Mathias Nyman
2019-11-22 15:10       ` Kai-Heng Feng
2019-11-22 16:35         ` Mathias Nyman
2019-11-26  9:44           ` Kai-Heng Feng
2019-11-26 10:54             ` Mathias Nyman [this message]

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=fa9c6b0a-fde6-db4c-6033-edc8165177f3@intel.com \
    --to=mathias.nyman@intel.com \
    --cc=kai.heng.feng@canonical.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@linux.intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).