Subject: Re: ISA interrupt sharing for coms
To: <>
From: David Laight <david@l8s.co.uk>
List: port-i386
Date: 02/06/2002 11:47:06
> If you share two ISA com card on the same irq, NetBSD don't know
> from which card the interrupt is and call the two configured driver,
> while the 8-port ISA card irqs are holded by an on-board chip and
> the driver, then could use one irq.
> 
> In my case of ethernets irqs conflict, the 3c509 worked and the ne2000
> generated "i/o timeouts..." and won't work. ( kernel saying "last message
> repeated 123 times" sometimes... )
> I have found that one card is irq level sensitive while the other on edge
> transition, may be the why one worked...

The general problem is that no one 'designed' the PC architecture:-)

The ISA interrupts were orginially 'edge' triggered on the rising edge
of the interrupt line.  This requires a 'totem pole' driver of the IRQ
line so the interrupts cannot (usually [1]) be shared.

At some point (probably when the 2nd interrupt controller appeared)
'level' sensitive interrupts became supported.  These are 'active low'
and use an 'open collector' driver to pull down the IRQ line, so are
shareable.

Note that the inactive states are opposite, if you configure it wrong
you might smoke your hardware, or just get the kernel into an infinite
interrupt loop.

Most OS support sharable interrupts (ie they call all the isrs attached
to an irq).  Some (buggy) device drivers bitch about having their isr
entered when there is nothing to do - or worse assume the request they
are waiting for has completed when the isr is entered.

On some systems the BIOS does special setup - eg mapping IRQ to the ISA
or PCI bus, and maybe setting edge/level mode.  If it has the wrong
information nothing works.

[1] edge sensitive interrupts are sometimes shared using 'pulse mode'. 
The irq line is pulled high, and driver low for a short time to raise an
interrupt (on the trailing edge).  This is used by some boards only, and
typically requires a single driver (ie single board type) to avoid
missigng interrupts.

	David