From: Artur Skawina <art.08.09@gmail.com>
To: Christian Lamparter <chunkeey@web.de>
Cc: Artur Skawina <art.08.09@gmail.com>, linux-wireless@vger.kernel.org
Subject: Re: [RFC][RFT][PATCH] p54usb: rx refill revamp
Date: Thu, 22 Jan 2009 23:51:35 +0100 [thread overview]
Message-ID: <4978F877.2070609@gmail.com> (raw)
In-Reply-To: <200901222339.59965.chunkeey@web.de>
Christian Lamparter wrote:
> well, I took a quick look into the usb code...
> (I know this isn't "usb_poison_anchored_urbs", or usb_kill_anchored_urbs,
> but they have to use this ones!)
>
> void usb_kill_urb(struct urb *urb)
> {
> might_sleep();
> if (!(urb && urb->dev && urb->ep))
> return;
> atomic_inc(&urb->reject);
>
> usb_hcd_unlink_urb(urb, -ENOENT);
> wait_event(usb_kill_urb_queue, atomic_read(&urb->use_count) == 0);
>
> atomic_dec(&urb->reject);
> }
>
> vs.
>
> void usb_poison_urb(struct urb *urb)
> {
> might_sleep();
> if (!(urb && urb->dev && urb->ep))
> return;
> atomic_inc(&urb->reject);
>
> usb_hcd_unlink_urb(urb, -ENOENT);
> wait_event(usb_kill_urb_queue, atomic_read(&urb->use_count) == 0);
> }
>
> it looks like usb_poison_urb doesn't do what I though it does...
> In fact the way I see it now... there's no advantage if we use it,
> we can stick usb_kill_anchored_urb, right?
the difference is that after an urb is killed it can be resubmitted;
after it's poisoned it will always fail w/ -EPERM.
usb_poison_anchored_urbs() will not only poison all anchored urbs
but also mark the anchor itself -- and the usb_anchor_urb() call will
then also poison every urb it anchors.
So once you have called usb_poison_anchored_urbs(A), you can count
on every single urb that either already was or is subsequently
anchored to A to always fail on submission.
And any urbs that were already submitted at the time of the
usb_poison_anchored_urbs(A) call will have gone through the completion.
artur
next prev parent reply other threads:[~2009-01-22 22:51 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-21 13:50 [RFC][RFT][PATCH] p54usb: rx refill revamp Christian Lamparter
2009-01-21 16:04 ` Artur Skawina
2009-01-21 18:24 ` Christian Lamparter
2009-01-21 19:32 ` Artur Skawina
2009-01-21 20:56 ` Christian Lamparter
2009-01-21 23:22 ` Artur Skawina
2009-01-22 15:00 ` Christian Lamparter
2009-01-22 15:43 ` Artur Skawina
2009-01-22 21:39 ` Christian Lamparter
2009-01-22 21:45 ` Artur Skawina
2009-01-22 22:12 ` Christian Lamparter
2009-01-22 5:40 ` Artur Skawina
2009-01-22 15:09 ` Christian Lamparter
2009-01-22 15:52 ` Artur Skawina
2009-01-22 16:01 ` Christian Lamparter
2009-01-22 19:19 ` Artur Skawina
2009-01-22 21:02 ` Christian Lamparter
2009-01-22 22:05 ` Artur Skawina
2009-01-22 22:39 ` Christian Lamparter
2009-01-22 22:51 ` Artur Skawina [this message]
2009-01-23 1:11 ` Artur Skawina
2009-01-21 20:06 ` Larry Finger
2009-01-21 20:51 ` Christian Lamparter
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=4978F877.2070609@gmail.com \
--to=art.08.09@gmail.com \
--cc=chunkeey@web.de \
--cc=linux-wireless@vger.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).