From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: "Oliver Neukum" <oneukum@suse.com>,
"Michal Pecio" <michal.pecio@gmail.com>,
"Bjørn Mork" <bjorn@mork.no>,
"USB list" <linux-usb@vger.kernel.org>
Subject: Re: correctly handling EPROTO
Date: Fri, 13 Mar 2026 22:45:32 +0000 [thread overview]
Message-ID: <20260313224528.dp6utjqzbdguwlbf@synopsys.com> (raw)
In-Reply-To: <9da0ac4f-12bf-4270-af6f-e08b5a89611b@rowland.harvard.edu>
On Fri, Mar 13, 2026, Alan Stern wrote:
> On Fri, Mar 13, 2026 at 11:33:48AM +0100, Oliver Neukum wrote:
> > On 13.03.26 08:53, Michal Pecio wrote:
> >
> > There are also these pesky software systems where a perpetual immediate
> > retry causes a livelock.
>
> Yes, we need to avoid this.
>
This can be handled by the class driver (e.g. fall back to port reset
after 3 retry failures in a row).
> > We have to ask ourselves to which extent we want to deal with failing
> > hardware. I would prefer to deal with true hardware failure separately,
> > but if you think that we need to include the possibility on a driver level,
> > please say so.
>
> I tend to group transaction-level errors like EPROTO into three
> categories:
>
> 1. Device has been unplugged, hub will notify us soon;
>
> 2. Unrecoverable device problem, needs reset or power cycle;
>
> 3. Short term problem (cable issue, EMI, system load).
>
> Retrying makes sense for 3 but not for 1 or 2. Unfortunately we can't
> tell which category a particular fault lies in.
There's no need to distinquish them if we have a proper fallback
recovery (such as reset/power cycle) should retry failed as noted above.
>
<snip>
>
> > [..]
> > > Summary:
> > >
> > > Retrying may or may not be productive - see 1.
> >
> > Does it hurt? Furthermore is it likelier to succeed if we clear
> > a halt before we do so?
> >
> > > In certain cases retries are impossible anyway - see 2b and 4b.
> > > Extra work by class specific means is inevitable. See "USB philosophy".
> >
> > We are handling errors. That is, conditions that should not happen
> > in the first place. Perfection will not serve us. Can we come to
> > something reasonable that will mostly work and not preclude going
> > to more drastic methods if it fails?
>
> And also bearing in mind that retrying will help only for problems of
> type 3 above. (Also bearing in mind that the most drastic methods
> involve manual intervention; they can't be done in software.)
>
Just want to give my 2-cent here: I experimented and have seen Windows
drivers do retry for MSC (particularly for UASP devices), and it works
well.
The retry is not specifically at the failed URB. It's a retry of the
UASP command where the data block offset is specified, and the entire
transfer is resent.
This will probably not work for application with isoc endpoints where
timing is critical or application without certain synchronization
protocol in its transfer header.
BR,
Thinh
next prev parent reply other threads:[~2026-03-13 22:46 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-12 13:55 correctly handling EPROTO Oliver Neukum
2026-03-12 14:21 ` Alan Stern
2026-03-12 15:57 ` Oliver Neukum
2026-03-13 7:53 ` Michal Pecio
2026-03-13 10:33 ` Oliver Neukum
2026-03-13 15:28 ` Alan Stern
2026-03-13 22:45 ` Thinh Nguyen [this message]
2026-03-14 2:39 ` Alan Stern
2026-03-16 12:58 ` Oliver Neukum
2026-03-16 14:02 ` Alan Stern
2026-03-16 14:47 ` Oliver Neukum
2026-03-16 17:33 ` Alan Stern
2026-03-16 19:32 ` Oliver Neukum
2026-03-17 9:05 ` Mathias Nyman
2026-03-17 14:31 ` Alan Stern
2026-03-17 16:20 ` Oliver Neukum
2026-03-17 18:03 ` Alan Stern
2026-03-18 9:54 ` Oliver Neukum
2026-03-18 17:46 ` Alan Stern
2026-03-18 21:38 ` Michal Pecio
2026-03-18 23:59 ` Thinh Nguyen
2026-03-19 2:07 ` Alan Stern
2026-03-19 23:16 ` Thinh Nguyen
2026-03-20 9:58 ` Michal Pecio
2026-03-20 16:20 ` Alan Stern
2026-03-20 17:49 ` Oliver Neukum
2026-03-21 2:14 ` Thinh Nguyen
2026-03-21 5:54 ` Michal Pecio
2026-03-21 15:58 ` Alan Stern
2026-03-28 21:22 ` Michal Pecio
2026-03-29 1:52 ` Alan Stern
2026-03-29 16:46 ` Michal Pecio
2026-03-23 10:26 ` Oliver Neukum
2026-03-24 1:06 ` Thinh Nguyen
2026-03-24 9:28 ` Oliver Neukum
2026-03-24 13:25 ` Alan Stern
2026-03-25 1:44 ` Thinh Nguyen
2026-03-19 1:56 ` Alan Stern
2026-03-19 8:40 ` Mathias Nyman
2026-03-19 23:34 ` Thinh Nguyen
2026-03-19 8:55 ` Michal Pecio
2026-03-19 14:24 ` Alan Stern
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=20260313224528.dp6utjqzbdguwlbf@synopsys.com \
--to=thinh.nguyen@synopsys.com \
--cc=bjorn@mork.no \
--cc=linux-usb@vger.kernel.org \
--cc=michal.pecio@gmail.com \
--cc=oneukum@suse.com \
--cc=stern@rowland.harvard.edu \
/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