Re: linux interrupt handling problem

Roman Zippel (zippel@fh-brandenburg.de)
Tue, 9 Nov 1999 11:52:17 +0100 (MET)


Hi,

On Mon, 8 Nov 1999, Richard B. Johnson wrote:

> This should work if you must enable interrupts in the interrupt handler.
>
> static void device_isr (int irq, void *p, struct pt_regs *regs)
> {
> INFO *inf = (INFO *) p;
> if(inf->busy++)
> return;
> while(inf->busy--) /* Check this with interrupts off */
> do_stuff(); /* If necessary with interrupts enabled */
> return;
> }

This doesn't work without an interrupt controller.
You forget that the interrupt has to be acknowledged, so you have to
disable interrupts before this and enable them within do_stuff()
explicitly again, that makes writing interrupt handler more complex and
destroys interrupt perfomance again.

bye, Roman

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/