* Interrupts in modules
@ 2001-07-21 22:02 Steve Papacharalambous
2001-07-22 1:17 ` Keith Owens
2001-07-22 18:28 ` H . J . Lu
0 siblings, 2 replies; 3+ messages in thread
From: Steve Papacharalambous @ 2001-07-21 22:02 UTC (permalink / raw)
To: linux-mips
Hi All,
Are there any limitations or precautions needed with interrupt handlers
in loadable modules?
The reason for asking is that I have an interrupt handler which works
fine when compiled into the kernel, but causes the kernel to crash when
it is a loadable module,
Thanks,
Steve
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Interrupts in modules
2001-07-21 22:02 Interrupts in modules Steve Papacharalambous
@ 2001-07-22 1:17 ` Keith Owens
2001-07-22 18:28 ` H . J . Lu
1 sibling, 0 replies; 3+ messages in thread
From: Keith Owens @ 2001-07-22 1:17 UTC (permalink / raw)
To: Steve Papacharalambous; +Cc: linux-mips
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.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Interrupts in modules
2001-07-21 22:02 Interrupts in modules Steve Papacharalambous
2001-07-22 1:17 ` Keith Owens
@ 2001-07-22 18:28 ` H . J . Lu
1 sibling, 0 replies; 3+ messages in thread
From: H . J . Lu @ 2001-07-22 18:28 UTC (permalink / raw)
To: Steve Papacharalambous; +Cc: linux-mips
On Sat, Jul 21, 2001 at 11:02:53PM +0100, Steve Papacharalambous wrote:
> Hi All,
>
> Are there any limitations or precautions needed with interrupt handlers
> in loadable modules?
>
> The reason for asking is that I have an interrupt handler which works
> fine when compiled into the kernel, but causes the kernel to crash when
> it is a loadable module,
There are some gas bugs which may generate the bad binary code. It
happened to me with the tulip driver. The current Linux binutils
should be ok.
H.J.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2001-07-22 18:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-07-21 22:02 Interrupts in modules Steve Papacharalambous
2001-07-22 1:17 ` Keith Owens
2001-07-22 18:28 ` H . J . Lu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox