Re: SMP interrupt patches..

Linus Torvalds (
Thu, 22 Jan 1998 09:59:34 -0800 (PST)

On Thu, 22 Jan 1998, Doug Ledford wrote:
> It would seem to me that a person can utilize this very same PCI IRQ info to
> help with the mapping. For instance, assume we have both and aic7xxx and a
> tulip device using IRQ 11 according to the PCI BIOS setup at machine boot
> time, that should at least give us a clue as to the fact that the tulip
> device and the aic7xxx device are either sharing the same PIRQ or something.
> I would almost tend to think that this ability to map the APIC out is going
> to end up entertwining with pci.c in certain ways if you want it to be
> reliable.....

You can't even depend on that, I think.

There's a further mapping from PCI interrupt to "traditional interrupt"
done by the southbridge, as far as I know. And it is _that_ mapping that
changes PIRQx into int11 - this mapping has to be done even when the
IO-APIC isn't actually in use (virtual wire or whatever its called).

And it is entirely possible that you have two different PIRQ lines mapping
to the same traditional irq line. Admittedly that is stupid from a
performance standpoint, but this may have been set up in the BIOS setups
because the machine may be very scarce on traditional interrupts (and if
you have to share an interrupt, you'd better share a PCI interrupt rather
than anything else).

The only reliable way to detect the PCI interrupt routing that I can think
of is:
- map the PCI interrupts 1:1 by the APIC to irq16-19
- autodetect the interrupt

And even the above is reliable only when the machine happens to have one
particular setup (ie just four PCI interrupts and they really are
connected to the APIC in the standard way) which is by no means guaranteed
to always be true - as we've seen from double-PCI machines the mapping may
be less straightforward.

Plus it is actually hard to autodetect the interrupt: we have to make the
card generate the interrupt in the first place, which implies that the
auto-detection has to be done by the driver rather than by the initial
interrupt setup..