From: David Madore <david.madore@ens.fr>
To: Linux Kernel Mailing-List <linux-kernel@vger.kernel.org>
Subject: simple synchronization questions (freeing on rmmod)
Date: Thu, 15 Sep 2005 19:04:26 +0200 [thread overview]
Message-ID: <20050915170426.GA28104@clipper.ens.fr> (raw)
Hi.
I'm trying to learn the rudiments of kernel programming by writing a
simple module (as it turns out, a driver for my motherboard's ECC RAM
controller). The module installs basically three things: an interrupt
handler, a timer (to make sure the controller is checked periodically,
even if it does not generate an interrupt) and a file entry in the
/proc filesystem.
My question is about synchronization when the module is being removed.
To remove the timer, I am told that I must use del_timer_sync()
(rather than just del_timer()) so as to make sure there is no instance
of the timer still running. Now what about the interrupt handler? Is
there a guarantee that after free_irq() there cannot be an instance of
the interrupt handler running on another process? If not, what is the
recommended way to make sure of that before exiting the module?
Lastly, what about the /proc entry? What is the recommended and
reliable way to make sure all open file descriptors pointing to it are
closed before exiting the module?
Thanks for your help,
--
David A. Madore
(david.madore@ens.fr,
http://www.madore.org/~david/ )
reply other threads:[~2005-09-15 17:04 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20050915170426.GA28104@clipper.ens.fr \
--to=david.madore@ens.fr \
--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
all inboxes | Powered by JetHome®