All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: Marc SCHAEFER <schaefer@alphanet.ch>,
	Micha?? Pecio <michal.pecio@gmail.com>
Cc: linux-usb@vger.kernel.org
Subject: Re: Strange issues with UAS URB cancellation
Date: Wed, 4 Sep 2024 17:26:28 +0300	[thread overview]
Message-ID: <71c073de-8af5-4457-88eb-91a709c2d941@linux.intel.com> (raw)
In-Reply-To: <ZtdmOiKN6hb2Y82I@alphanet.ch>

Hi

Looks like there are two cases that might be related.

One is that the device seems to send more data than host asks for.
This triggers a babble error pointing to a already returned transfer, so error
does not get properly handled.

Other issue is the "WARN Set TR Deq Ptr cmd invalid because of stream ID configuration" error.

xhci driver queues a set TR Deq Ptr command when canceling transfers.
This error shown if there is an TRB_ERROR in the actual command we queue.

I can start working on some debugging patches as well if you have the time to try
them out.

More details inlined in log below:

On 3.9.2024 22.40, Marc SCHAEFER wrote:
> Re,
> 
> On Tue, Sep 03, 2024 at 05:45:35PM +0200, Micha?? Pecio wrote:
>> Hmm, this is possibly not a coincidence, but it's also not the same
>> "ERROR Transfer event TRB DMA ptr not part of current TD" that happened
> 
> Got one:
> 
> Sep  3 21:32:58 video kernel: [11408.230466] xhci_hcd 0000:01:00.0: WARN Set TR Deq Ptr cmd invalid because of stream ID configuration
Set TR Deq command completes with TRB_ERROR, meaning the command xhci driver queues was faulty.
I'm guessing we somehow mess up the stream ID when xhci driver craetes the TRB.

> Sep  3 21:32:58 video udisksd[962]: Error performing housekeeping for drive /org/freedesktop/UDisks2/drives/WDC_WD40EURX_63BMCY0_WD_WCC7K6KTRC7F: Error updating SMART data: sk_disk_smart_read_data: Operation not supported (udisks-error-quark, 0)
> Sep  3 21:32:58 video kernel: [11408.247189] xhci_hcd 0000:01:00.0: ERROR Transfer event TRB DMA ptr not part of current TD ep_index 10 comp_code 3
Transfer event with comp_code 3 which is "Babble Detected Error", but the event doesn't point to a pending transfer

> Sep  3 21:32:58 video kernel: [11408.247197] xhci_hcd 0000:01:00.0: Looking for event-dma 00000000d9911140 trb-start 00000000d9911150 trb-end 00000000d9911940 seg-start 00000000d9911000 seg-end 00000000d9911ff0
The "Babble Detected Error" event points to transfer at 0000000d9911140,
this is one transfer block before the expected trasnfer 0000000d9911150.

This means the Babble Detected Error was intended for the previous transfers, which xhci driver has
already given back to class driver.

A Babble error will halt the endpoint, but xhci driver doesn't recover the endpoint as
event doesn't map to any transfer. This needs to be fixed.

Thanks
Mathias

  reply	other threads:[~2024-09-04 14:24 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-23 19:18 Strange issues with USB device Marc SCHAEFER
2024-08-24  6:44 ` Michał Pecio
2024-08-24  6:51   ` Marc SCHAEFER
2024-08-24  8:44     ` Michał Pecio
2024-08-26  5:17       ` Marc SCHAEFER
2024-09-03  7:48         ` Strange issues with UAS URB cancellation Michał Pecio
2024-09-03 12:55           ` Marc SCHAEFER
2024-09-03 13:22             ` Michał Pecio
2024-09-03 13:50               ` Marc SCHAEFER
2024-09-03 13:52                 ` Marc SCHAEFER
2024-09-03 13:55                   ` Marc SCHAEFER
2024-09-03 15:45                     ` Michał Pecio
2024-09-03 19:40                       ` Marc SCHAEFER
2024-09-04 14:26                         ` Mathias Nyman [this message]
2024-09-04 16:36                           ` Marc SCHAEFER
2024-09-05 13:52                             ` Mathias Nyman
2024-09-05 15:01                               ` Marc SCHAEFER
2024-09-05 15:06                                 ` Marc SCHAEFER
2024-09-05 17:24                                   ` Marc SCHAEFER
2024-09-05 18:20                                     ` Marc SCHAEFER
2024-09-09 15:24                                     ` Mathias Nyman
2024-09-09 16:21                                       ` Marc SCHAEFER
2024-09-11 14:25                                         ` Mathias Nyman
2024-09-12 15:22                                           ` Mathias Nyman
2024-08-25 16:32   ` Strange issues with USB device Marc SCHAEFER

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=71c073de-8af5-4457-88eb-91a709c2d941@linux.intel.com \
    --to=mathias.nyman@linux.intel.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=michal.pecio@gmail.com \
    --cc=schaefer@alphanet.ch \
    /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.