On Sat, 17 Apr 2004, David Brownell wrote:

> > Oh, I've rewritten the usb-skeleton driver so that it contains no locks
> > now (with the exception of the BKL to protect on disconnect.)  It's a
> > world simpler, but I've probably forgotten something here.  I've
> > attached it below if anyone wants to look at it.
> 
> Looks much cleaner!  2.6 starts to show its true colors.  :)
> 
> I'd encourage use of dev_dbg(&dev->interface->dev) and so on.  Wouldn't
> down_read(&usb_bus_type.subsys.rwsem) in open() let you remove BKL?

This sounds familiar...  How long has it been that people have been busy
replacing coarse locks like BKL with finer-grained locks?

Also, I notice that this code does indeed continue to communicate with the 
device after disconnect() returns.


On Sat, 17 Apr 2004, Oliver Neukum wrote:

> 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.

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.

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

Reply via email to