On Sat, 17 Apr 2004, Oliver Neukum wrote: > Am Samstag, 17. April 2004 22:13 schrieb Alan Stern: > > This sounds familiar... How long has it been that people have been busy > > replacing coarse locks like BKL with finer-grained locks? > > A spinlock could replace it. But that is a small detail.
Yes it could. Then the driver would start to resemble its original form again, defeating Greg's point. > > Also, I notice that this code does indeed continue to communicate with the > > device after disconnect() returns. > > I see no way fixing that preserving the elegance of the design. Are you the same Oliver who always claims that correctness is more important than style? If not, what have you done with him? :-) > > > The key to make reference counting work, seems to be reallocating > > > the data structure operations are based on. > > > > Another key aspect is performing disconnect-type operations in two steps: > > receive the disconnect notification and sometime afterwards acknowledge > > completion of the disconnect by reducing a reference count. > > Yes, and not reusing the data structure in between. No, no! That's the whole point. The reference counting in the driver model is based on the idea that you send a notification to a driver telling it to stop using something, but it's allowed to continue using (or trying to use) it until it notifies you back. That's why we have both device_del() and a release() callback, for example. > > The problem is that physical USB devices aren't data structures -- you > > can't deallocate one and then allocate a new copy when you need it! Some > > form of synchronization is needed if we want to prevent multiple drivers > > from talking to the same interface at the same time. > > Nothing prevents giving out 'struct usb_endpoint_binding's which URBs > could be addressed to. They could have proper reference counting. > You could have them on lists which you walk in case of disconnect(), > config change, etc ... That is just what David has proposed for 2.7. We should give some extra thought to the problem of dealing with ep 0, however. Alan Stern ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel