Darren J Moffat wrote:
Richard L. Hamilton wrote:
Unfortunately, I'm not sure how well it works: an
DEBUG kernel can try
to unload the module at any time.


But a loadable module can refuse to be unloaded based on the return from _fini(),
right?

Yes but that is considered pretty rude, especially if this module would otherwise be able to be unloaded and the only reason for doing that is to avoid the modload vs 'modunload -i 0' race condition.

For drivers (you can't do this for misc modules) you can use a special property: ddi-no-autodetach. This property, if non-zero, indicates that modunload -i 0 will not try to detach instances of your device in response to modunload -i 0. I know of particular devices where this is important -- the audio drivers do it so that they won't lose settings just because nobody is using the device at the precise time that modunload -i 0 is called.

Note that this properly still allows the device to be properly unloaded by a targetted modunload.

   - Garrett

--
Darren J Moffat
_______________________________________________
opensolaris-code mailing list
opensolaris-code@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

_______________________________________________
opensolaris-code mailing list
opensolaris-code@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to