From: Keith Owens <kaos@ocs.com.au>
To: Steve Papacharalambous <stevep@lineo.com>
Cc: linux-mips@oss.sgi.com
Subject: Re: Interrupts in modules
Date: Sun, 22 Jul 2001 11:17:29 +1000 [thread overview]
Message-ID: <1052.995764649@ocs3.ocs-net> (raw)
In-Reply-To: Your message of "Sat, 21 Jul 2001 23:02:53 +0100." <3B59FC0D.6CAD443C@lineo.com>
On Sat, 21 Jul 2001 23:02:53 +0100,
Steve Papacharalambous <stevep@lineo.com> wrote:
>Are there any limitations or precautions needed with interrupt handlers
>in loadable modules?
There is a potential race condition when removing the module. rmmod
will remove a module when its use count is zero. If the interrupt
handler is invoked after the use count is tested but before the module
cleanup routine is entered then the code can be removed while the
interrupt handler is running. The 2.5 module load/unload system will
remove this race.
In 2.4, your best option is to set a can_unload() function in the
module. Unregister the interrupt handler in can_unload(), wait until
the interrupt count goes to zero (might be running on another cpu) then
return 0. See drivers/char/ftape/compressor/zftape-compress.c for an
example.
Alternatively keep a use count for opens on the device. This assumes
that the device does not generate interrupts while it is not open, not
always true.
next prev parent reply other threads:[~2001-07-22 1:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-07-21 22:02 Interrupts in modules Steve Papacharalambous
2001-07-22 1:17 ` Keith Owens [this message]
2001-07-22 18:28 ` H . J . Lu
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=1052.995764649@ocs3.ocs-net \
--to=kaos@ocs.com.au \
--cc=linux-mips@oss.sgi.com \
--cc=stevep@lineo.com \
/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