> > Usbcore can't mark an URB as reusable.
> > Only the HCD can do that without a race
>
> In that context, that's what I meant.  From the perspective of
> all drivers except "hub" or HCDs, "usbcore" includes/hides
> all the HCDs.  They don't see HCDs, they talk to usbcore
> (which talks to the HCDs as neeeded).
>
> No HCD could resolve that race, any more than other
> parts of usbcore could, since it happens after the HCD
> has given up ownership of  the URB.
>
> >    (or the completion handler could)
>
> ONLY completion handlers can do that.  HCDs can't, as I
> just explained above.

Ok, it has to happen as a part of the interrupt service routine.
And it has to happen after the URB might be resubmitted, else
there is a race.
Thus, doing it with a flag (and both the urb->dev and the
urb->status methods are effectively flags) is difficult and we should really 
move to usage counting, where the counter is decremented after
the completion handler (here refering to the user supplied part)
returns to the HCD based part of the isr.
Giving up ownership of an URB would be equivalent to decrementing the counter 
to zero.
"if (urb->status == -EINPROGESS)" would become
"if (urb->users)". There's no race with completion handlers that
might resubmit.

        Regards
                Oliver

_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to