simple synchronization questions (freeing on rmmod)
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,
Signature · 3 lines
David A. Madore
([email protected],
http://www.madore.org/~david/ )