linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
	Alan Stern <stern@rowland.harvard.edu>
Cc: Mathias Nyman <mathias.nyman@intel.com>,
	Guido Kiener <Guido.Kiener@rohde-schwarz.com>,
	dave penkler <dpenkler@gmail.com>,
	Dmitry Vyukov <dvyukov@google.com>,
	syzbot <syzbot+e2eae5639e7203360018@syzkaller.appspotmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"lee.jones@linaro.org" <lee.jones@linaro.org>,
	USB list <linux-usb@vger.kernel.org>,
	"bp@alien8.de" <bp@alien8.de>,
	"dwmw@amazon.co.uk" <dwmw@amazon.co.uk>,
	"hpa@zytor.com" <hpa@zytor.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"luto@kernel.org" <luto@kernel.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"syzkaller-bugs@googlegroups.com"
	<syzkaller-bugs@googlegroups.com>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"x86@kernel.org" <x86@kernel.org>
Subject: Re: [syzbot] INFO: rcu detected stall in tx
Date: Tue, 25 May 2021 01:16:54 +0300	[thread overview]
Message-ID: <f9b96ec8-cf5c-6d62-2ec2-390dd72ea4d4@linux.intel.com> (raw)
In-Reply-To: <354a16cb-ba96-aa6f-7f10-388e6201e56d@synopsys.com>

On 24.5.2021 22.23, Thinh Nguyen wrote:
> Alan Stern wrote:
>> On Mon, May 24, 2021 at 06:18:59PM +0300, Mathias Nyman wrote:
>>> On 20.5.2021 23.30, Thinh Nguyen wrote:
>>>> As for the xhci driver, there maybe a case where the stream URB never
>>>> gets to complete because the transaction err_count is not properly
>>>> updated. The err_count for transaction error is stored in ep_ring, but
>>>> the xhci driver may not be able to lookup the correct ep_ring based on
>>>> TRB address for streams. There are cases for streams where the event
>>>> TRBs have their TRB pointer field cleared to '0' (xhci spec section
>>>> 4.12.2). If the xhci driver doesn't see ep_ring for transaction error,
>>>> it automatically does a soft-retry. This is seen from one of our
>>>> testings that the driver was repeatedly doing soft-retry until the class
>>>> driver timed out.
>>>>
>>>> Hi Mathias, maybe you have some comment on this? Thanks.
>>>
>>> This is true, if TRB pointer is 0 then there is no retry limit for soft retry.
>>> We should add one and prevent a loop. after e few soft resets we can end with a
>>> hard reset to clear the host side endpoint halt.
>>>
>>> We don't know the URB that was being tansferred during the error, and can't 
>>> give it back with a proper error code.
>>> In that sense we still end up waiting for a timeout and someone to cancel
>>> the urb.
>>
>> That's not good.  There may not be a timeout; drivers expect transfers 
>> to complete with a failure, not to be retried indefinitely.
>>
>> However, if you do know which endpoint/stream the error is connected to, 
>> you should be able to get the URB.  It will be the first one queued for 
>> that endpoint/stream.
>>
> 
> When the xhci can't recover a transfer with soft-retry, no outstanding
> transfer can proceed/complete for the endpoint. If the TRB pointer is 0,
> we just don't know which stream or endpoint ring it's for, but we know
> all the outstanding URBs of an endpoint. Let's may as well return an
> error status for all of them after a limited number of soft-retries.

We get the endpoint, but not the stream.

I guess we could walk through each stream of this endpoint, and return the 
first URB of every stream that has a pending URB.
xHCI spec claims to supports 65533 streams per endpoint, but in real life 
UAS probably only uses a few per endpoint?

-Mathias 

  reply	other threads:[~2021-05-24 22:14 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-19 16:14 Re: Re: Re: Re: Re: [syzbot] INFO: rcu detected stall in tx Guido Kiener
2021-05-19 17:35 ` Alan Stern
2021-05-19 19:38   ` Thinh Nguyen
2021-05-20  2:01     ` Alan Stern
2021-05-20 20:30       ` Thinh Nguyen
2021-05-20 21:05         ` Recovering from transaction errors [was: Re: [syzbot] INFO: rcu detected stall in tx] Alan Stern
2021-05-20 21:23           ` Thinh Nguyen
2021-05-21  1:21             ` Alan Stern
2021-05-21  2:12               ` Thinh Nguyen
2021-05-21 14:34                 ` Alan Stern
2021-05-21 20:00                   ` Thinh Nguyen
2021-05-24 15:18         ` [syzbot] INFO: rcu detected stall in tx Mathias Nyman
2021-05-24 18:55           ` Alan Stern
2021-05-24 19:23             ` Thinh Nguyen
2021-05-24 22:16               ` Mathias Nyman [this message]
2021-05-24 22:48                 ` Thinh Nguyen
2021-05-19 18:04 ` Re: Re: Re: Re: " Lee Jones
  -- strict thread matches above, loose matches on Subject: below --
2021-05-20 21:25 Guido Kiener
2021-05-21  1:24 ` Alan Stern
2021-05-21 22:17   ` guido
2021-05-22  2:13     ` Alan Stern
     [not found] <000000000000a9b79905c04e25a0@google.com>
2021-04-19  7:27 ` Dmitry Vyukov
2021-06-28  6:38   ` Zhang, Qiang
2021-06-28 14:17     ` Alan Stern
2021-06-27 20:20 ` syzbot
2021-09-04  7:55 ` syzbot

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=f9b96ec8-cf5c-6d62-2ec2-390dd72ea4d4@linux.intel.com \
    --to=mathias.nyman@linux.intel.com \
    --cc=Guido.Kiener@rohde-schwarz.com \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=bp@alien8.de \
    --cc=dpenkler@gmail.com \
    --cc=dvyukov@google.com \
    --cc=dwmw@amazon.co.uk \
    --cc=gregkh@linuxfoundation.org \
    --cc=hpa@zytor.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mathias.nyman@intel.com \
    --cc=mingo@redhat.com \
    --cc=stern@rowland.harvard.edu \
    --cc=syzbot+e2eae5639e7203360018@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=tglx@linutronix.de \
    --cc=x86@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 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).