PCI bus and shared interrupts, proposal.

Chel van Gennip, (chel@vangennip.nl)
Sat, 5 Apr 1997 11:03:56 +0100 (WETDST)

I have posted this message on comp.os.linux.development.system, but I think
maybe this is a better place for discussion.
The interrupt allocation scheme of new AMI bioses introduces some

Subject: PCI bus and shared interrupts
Date: Fri, 04 Apr 1997 13:31:22 +0200
From: Chel van Gennip <chel@vangennip.nl>
Newsgroups: comp.os.linux.development.system, comp.os.linux.hardware

After detecting some problems I found out there is a problem
with IRQ assignment on the PCI bus and the Linux
implementation of interrupt handling.

My problem:
The Intel Venus PPRO board (VS440FX) assigns the same IRQ to
both a network card and a SCSI card.
The SCSI drivers registers the IRQ with the SA_INTERRUPT flag,
the network driver without this flag, so the IRQ can not be

Discussion with my Intel distributer points out the following
PCI standard requirements:

- The PCIBIOS should assign interrupts for the different
- The PCI INTA and INTB line should not be assigned the
same IRQ
- The same IRQ can be assigned to different devices. This
should be handled by the driver.
- Assigned IRQ's can be read by the PCIBIOS call
- Assigned IRQ' can be changed by the PCIBIOS call

I should verify if this is correct, if so these rules are
stupid. At least the second rule is without any meaning if
both the assigned interrupt lines can be randomly shared with
interrupt lines of other cards, eg. cards of the same type and

If the rules are correct, I think we need handling of this in
the Linux kernel, otherwise a lot of problems will rise.

To deal with this I think IRQ should be assigned by the kernel
and not by the PCIBIOS.

The minimum requirement is to have separate IRQ's for the
interrupts with the normal interrupt handler and for the fast
interrupt handler (SA_INTERRUPT flag), of to find a way to
share normal and fast interrupts.

I can not fully oversee the consequences, but I think an
implementation could be done with the following routines:

Get a list of all available PCI IRQ's, assign the first one
for normal interrupts, the second one for fast interrupts.
Set the IRQ for all devices to one (the last free?) IRQ.

Assign one of the free interrupts to the device.

Assign the normal IRQ to the device.

Assign the fast IRQ to the device.

The pci_init_irq call should be called during PCI initiation.

The pci_set_*_irq call should be called in all drivers, just
before the call of pcibios_read_config_byte() for the irq.

Devices that need real fast IRQ handling can have a boot
option flag to require a free interrupt.

Please comment on this proposal.
Chel van Gennip | Spechtstraat 15 | 2623 GP Delft | The Netherlands
Tel: +31 15 2567783 | Fax: +31 15 2570315 | E-Mail: chel@vangennip.nl