David Brownell wrote:
>
> > 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()?
>
> My vote is for the open() ... it makes fewest restrictions on
> driver updates.
In the Speedtouch driver, I have an INC at the probe() and one with every
open() with matching DEC's in close() and disconnect().
I know this is redundant but I block in probe(), and i wanted to take no
risks.
I can relax this, with a DEC at the end of probe(), without introducing
insmod/rmmod races. (I think.)
my 2 cents about this:
It is not difficult to plug out a *USB* device to be able to replace the
module... For development, this is annoying. For users, it doesn't really
matter, they won't be doing a lot of that anyway...
One thing I am sure of is that having an _INC when you have recognised a
device will prevent insmod/rmmod races.
It just seems safer...
J.
--
________
/---------------------------------\ /--------------------\
| Johan Verrept \ / Alcatel |
| Software Development Engineer \ / De Villermontstr 38|
| xDSL Customer Premises Equipment \/ B-2550 Kontich |
| http://www.alcateldsl.com/ ALC/\TEL Belgium |
| mailto:[EMAIL PROTECTED] Phone: +32 3 450 3506 |
\-------------------------------------------------------------/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]