On Sunday 03 February 2002 20:46, David Brownell wrote:
> > >> int usb_revoke_urb_sync(struct urb *urb);
> > >> int usb_revoke_urb_async(struct urb *urb);
> > >
> > >Are you trying to split up the current usb_unlink_urb() case?  Do you
> > >think this is really necessary?
>
> I'm not sure why it'd be necessary.  The API might be a
> smidgeon cleaner (I prefer to avoid flags that create API
> modes, or changing them after requests are under way)
> but I don't think "necessary" applies here ... those calls
> would just be wrappers around existing functionality.

It avoids a lot of effort in the disconnect methods of the network drivers
which would have to check and wait for an ongoing asynchronous
unlinking.

> > Much better. The networking drivers have a need to unlink
> > the same urb both asynchronously and synchronously.
> > Furthermore it allows functionality to be shifted from the HCDs
> > to usbcore.
>
> That's already done -- the "hcd" framework (part of usbcore that
> exists only for the HC drivers) handles all the synchronization.

Could you elaborate ?

> > As a completion handler may be running even after a synchronous
> > unlink has returned, almost all drivers have a race on disconnect.
>
> The "hcd" framework also ensures that the completion handler has
> been called by the time a synchronous unlink returns, so that race
> (which I'd call a HC driver bug) doesn't exist.
>
> > >> void usb_wait_completion(struct urb *urb);
>
> I still haven't seen a description of what this is supposed to do,
> and would want to see one before a discussion about whether
> the API should be included ...

if (urb->status != -EINPROGRESS) {
                        retval = 0;
                        goto done;

Correct me if I am wrong, but it seems to me that a completion handler
may be running after a synchronous unlink returns.

In most disconnect methods we want to free memory completion handlers
may want to access. Thus a method to wait for them to finish would be handy.

        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