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

Why can that not be done for misc modules - can they not have properties, or
what?

Seems like if there ever is a reason for a misc module that's not loaded on 
demand,
but only by explicit modload, that least surprise would be if it could request 
to
also only be _unloaded_ explicitly (leaving refusing to unload for narrower 
purposes,
like "busy", whatever that means for a module that seems to have few means of
interacting with anything else).
-- 
This message posted from opensolaris.org
_______________________________________________
opensolaris-code mailing list
opensolaris-code@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to