linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oliver Neukum <oneukum@suse.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: linux-usb@vger.kernel.org
Subject: Re: [RFC]extension of the anchor API
Date: Wed, 14 Apr 2021 10:12:01 +0200	[thread overview]
Message-ID: <30abed362c4b2e6af33078505ac9985389ad39bb.camel@suse.com> (raw)
In-Reply-To: <20210412150628.GA1420451@rowland.harvard.edu>

Am Montag, den 12.04.2021, 11:06 -0400 schrieb Alan Stern:
> On Mon, Apr 12, 2021 at 11:58:16AM +0200, Oliver Neukum wrote:

> > That presumes that the URBs will finish in order. I don't think such
> > an assumption can be made.
> 
> I don't understand -- I can't detect any such presumption.

OK, this shows that I am bad at explaining.
> 
> As far as I can tell, the only reason for maintaining the URBs in any 
> particular order on the anchor list is so that usb_kill_anchored_urbs 
> and usb_poison_anchored_urbs can kill them in reverse order of 
> submission.  THat's why the current code moves completed URBs to the end 
> of the list.

No longer strictly true, as the API has a call to submit everything
on an anchor, but I think it boils down to the same thing.

> If you keep a pointer to the most recently submitted URB, killing them 
> easy enough to do.  Start with that URB, then go backward through the 
> list (wrapping to the end when you reach the beginning of the list).

Yes, but that supposes that the next on the list has not been
resubmitted _before_ the one after it.

If you do not keep the list ordered, but in the initial order,
we can have the situation that A (happens most recently submitted)
is followed by B and C, but C was submitted before B.


> 
> The order in which the URBs complete doesn't matter, because trying to 
> unlink a completed URB won't cause any harm.

As long as it stays completed.

>   The only assumption here 
> is that URBs get submitted in the list's order (possibly circularly) -- 
> this should always be true.

I am afraid we cannot guarantee that. It might intuitively seem so,
but nothing guarantees that all URBs are going to the same endpoint.

	Regards
		Oliver



  reply	other threads:[~2021-04-14  8:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-25 11:03 [RFC]extension of the anchor API Oliver Neukum
2021-03-25 15:06 ` Alan Stern
2021-03-25 16:04   ` Oliver Neukum
2021-03-25 18:38     ` Alan Stern
2021-04-08  9:23       ` Oliver Neukum
2021-04-08 15:07         ` Alan Stern
2021-04-12  9:58           ` Oliver Neukum
2021-04-12 15:06             ` Alan Stern
2021-04-14  8:12               ` Oliver Neukum [this message]
2021-04-14 14:56                 ` Alan Stern
2021-04-15 11:23                   ` Oliver Neukum
2021-04-15 15:18                     ` 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=30abed362c4b2e6af33078505ac9985389ad39bb.camel@suse.com \
    --to=oneukum@suse.com \
    --cc=linux-usb@vger.kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).