> This brings up a further question. Do you decrement the driver use
> counter upon disconnect or upon a release? If one chooses to decrement
> it when the last program gives up the last open file descriptor, the
> problem of unloading after a disconnect is no more. Is this right?
Nope. Regretably this statement cannot be made to match reality
without irreconcilable inconsitencies ;-)
The module must be protected against unload while an fd is open,
during probe and during disconnect.
This is due to a design decision that drivers should be unloadable
even if they are driving currently unused devices. Very nice a feature,
but hard to implement.
Doing increment on open and decrement on release is _wrong_
release does NOT correspond to close()
The character device layer will protect your module against anything
but unload during probe and disconnect. During probe and disconnect
the usb core will protect you in 2.5. For 2.4 you must increment the count
upon entering probe and disconnect and decrement the count upon leaving
them.
Unloading a USB driver is not smp-safe in 2.4. There's nothing you can do about it.
Regards
Oliver
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel