On Wed, May 24, 2000 at 09:43:42AM -0700, Greg KH wrote:
> Hi all,
> 
> The latest patch from Dmitri for the ibmcam reminded me that we have two
> different ways the usb drivers call MOD_INC_USE_COUNT. One group of
> drivers (ibmcam, keyboard, mice, printer, acm, and other input devices)
> only increment the module use when the device is opened (if at all, like
> the mouse driver).  
> 
> The other drivers increment it when the device is recognized
> (usb-serial, dabusb, uss720, and others).
> 
> Which way should it be? On successful probe() or on open()?
> 
> I would like to see them all work the same, be it one way or the other
> and I really don't have a preference.

I believe it should be done only when it's needed - when the module must
be prevented from being unloaded. This is certainly in open(), because
it would cause oopses - a chardevice can't just disappear when it's in
use.

A separate problem is the problem of auto-unloaders found on many
systems that automatically unload module with zero usecount. In my
optinon a separate counter should be create that would inform the
userland utilities that while the module is possible to unload, it's
still being used and thus it wouldn't be wise to do so.

-- 
Vojtech Pavlik
SuSE Labs

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to