lkml.org 
[lkml]   [2001]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectForcible removal of modules
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/


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:29    [W:0.057 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site