Search Linux Wireless

Re: [RFC][RFT][PATCH] p54usb: rx refill revamp

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux