public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Forcible removal of modules
@ 2001-03-06 22:17 Thomas Hood
  2001-03-07  1:58 ` Keith Owens
  2001-03-07 19:57 ` John Fremlin
  0 siblings, 2 replies; 6+ messages in thread
From: Thomas Hood @ 2001-03-06 22:17 UTC (permalink / raw)
  To: linux-kernel

Hi.  Here's my question, with a little introduction.

Sometimes modules need to be reloaded in order
to cause some sort of reinitialization (of the
driver or of the hardware) to occur.
Sometimes this has to be done every time a machine
is suspended.  E.g., some sound driver modules
need to be reloaded after an APM suspend because
the sound chip forgets its configuration during the
suspend.  Obviously, one would like to be able to
automate the process of unloading and reloading the
modules by putting some commands in the apmd_proxy
script. Sometimes, though, "rmmod themodulename" fails
because some process is holding open a device handled
by the device driver module in question.

The solution to this is to do a "fuser" on the device
nodes associated with the device driver and kill all
the processes reported to be using those nodes.  
However, this is easier said than done because of one
problem: while you are killing a batch of processes
that are using the device node, other processes may
be opening that device node!  What is needed is a way
of preventing processes from opening a given device node.  

Now, one way of doing this is to change the device
permissions on the node to 000.  Unfortunately this does
not work well with devfs under the circumstances we have
in mind here: because once the permissions are changed
the device driver is removed; then devfs stores "000"
as the permissions that are to be used for that device
node when it is created again.

My question is: Is there some better way of blocking 
all open() calls to a particular device driver while
processes using it are being killed off?

Thomas Hood





_______________________________________________________
Send a cool gift with your E-Card
http://www.bluemountain.com/giftcenter/



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2001-03-07 22:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-03-06 22:17 Forcible removal of modules Thomas Hood
2001-03-07  1:58 ` Keith Owens
2001-03-07 19:57 ` John Fremlin
2001-03-07 20:07   ` Jeff Garzik
2001-03-07 21:13     ` Racing power management John Fremlin
2001-03-07 22:42     ` Forcible removal of modules Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox