Subject: Re: Sharing Interrupts under NetBSD
To: None <brucem@cat.co.za>
From: Lennart Augustsson <lennart@augustsson.net>
List: netbsd-help
Date: 01/25/2000 18:23:23
Bruce Martin wrote:

> Hi All
>
> We have a NetBSD system, in which two devices share an interrut line
> (IRQ12). The one device (a serial chip), takes approximately 1us to check if
> the interrupt was caused by itself, and the other device (an i2c device),
> takes approximately 30ms to check if it caused the interrupt. It is not
> ideal that everytime the serial chip interrupts, 30ms is spent seeing if it
> was the i2c device! We would thus like to first check the serial chip, and
> only pass the interrupt on to the i2c device if it was not caused by the
> serial device. It is also not a problem if both devices interrupt
> simultaneously, but only the cirrus services the interrupt, as this will
> cause a re-interrupt for the i2c device in hardware.

Well, no interrupt routine should spend 30ms anywhere!  So you need to
restructure your code.  Why not have one (kernel) thread for the i2c device?
The (shared) interrupt will then just wake the thread and it will continue
the processingto find out if there really was an interrupt.

--

        -- Lennart