> > Sure. I meant that control transaction has not completed.
> > It doesn't make sense to start new transfer before acknowledging current
> > one. Or does it ?
>
>Somebody in the device firmware has exchanged two lines.
>You have to deal with it. The world is unfair :-)
Yeah. I found a work around for that.

> > >I may point out that it is very hard to write a disconnect() handler
> > >if urbs can be freed in the completion handler, as you need
> > >complicated locking.
> >
> > Not really. I have an skb queue of outstanding transfers. Each skb has 
> a pointer to
> > appropriate urb. On disconnect I just traverse the queue and 
> synchronously unlink
> > urbs and let the completion handler free recourses. So, simple skb 
> queue locking
> > is enough in my case.
>
>Could you point me to the code ?
>I can see no way you could unlink synchronously.
>You need to hold an irqsafe spinlock on that queue while you
>call usb_unlink_urb and that pretty much rules out doing
>a synchronous unlinking.
Take a look here
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/bluez/kernel/drivers/hci_usb.c?rev=1.1.1.1&content-type=text/vnd.viewcvs-markup
hci_usb_unlink_urbs does unlinking on disconnect.
hci_usb_tx_complete is a completion handler for bulk out transfers.
I don't have to hold queue lock when I call unlink_urb. Although I now 
think that this code is a bit racy :)
btw What will happen if unlink_urb is called while completion handler is 
running ?

Anyway I'm in the process of rewriting the driver based on our discussion. 
And I'm not gonna free urbs in the completion handler
any more.

Thanks
Max








> > It be nice if usb core or HCD could unlink all outstanding urbs for this
> > device on disconnect.
> > (drivers have to do that anyway). In that case USB driver would not have to
> > remember
> > submitted URBs because HCD has them in it's queues.
>
>There is an idea.
>
>         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