public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Hood <thood@excite.com>
To: linux-kernel@vger.kernel.org
Subject: Forcible removal of modules
Date: Tue, 6 Mar 2001 14:17:28 -0800 (PST)	[thread overview]
Message-ID: <9038100.983917051702.JavaMail.imail@digger.excite.com> (raw)

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/



             reply	other threads:[~2001-03-06 22:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-06 22:17 Thomas Hood [this message]
2001-03-07  1:58 ` Forcible removal of modules 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9038100.983917051702.JavaMail.imail@digger.excite.com \
    --to=thood@excite.com \
    --cc=jdthoodREMOVETHIS@mail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox