Am Donnerstag, 29. April 2004 17:56 schrieb Alan Stern:
> On Thu, 29 Apr 2004, Oliver Neukum wrote:
> > > Can you come up with something better in terms of both space and time?
> >
> > I am still thinking, but I am shaping thoughts. Now for some questions:
> >
> > 1. Does waiting for the completion handler actually change the semantics?
> >     I would think not, but I am not sure.
>
> You mean, does it change the existing semantics of synchronous
> usb_unlink_urb()?  Yes, it does.  Currently usb_unlink_urb() guarantees
> that when it returns the completion handler will have finished _only_ if
> it returns with no error.  If it returns with an error code then the
> completion handler might not even have started running yet.

But we don't violate existing behavior, do we?
Always returning only after the completion handler has run seems
to be legal to me.

> > 2. Is there objection to introducing a 'phase' field to struct urb?
>
> I personally don't object, but other people do.  However, I doubt that
> adding such a field will be sufficient to do what you want.  There are
> pretty thorny problems associated with the possibility that the completion
> handler is allowed to resubmit the URB.  My version of usb_wait_for_urb()
> ignores those problems: If the URB is resubmitted by the completion
> handler my routine will hang.  For a general-purpose synchronous unlink
> that might not be acceptable.  (On the other hand, it might -- synchronous
> unlinks _ought_ to be uncommon and it doesn't make sense to automatically
> resubmit following a synchronous unlink.)

But doesn't the large majority of drivers unlink only synchronously?
It seems to me that the desired semantics for synchronous unlink
if the completion handler resubmits is to unlink the newly submitted urb.

> > 3. Under which circumstances can retval = hcd->driver->urb_dequeue (hcd,
> > urb); fail?
>
> That's slightly different from asking when usb_unlink_urb() can fail.
> hcd->driver->urb_dequeue() can fail if:
>
>       The URB is no longer queued, i.e., it has already completed
>       or otherwise been dequeued;

But in any such case giveback_urb() has been or will be called, right?

        Regards
                Oliver



-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE. 
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to