lkml.org 
[lkml]   [1997]   [Apr]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectPCI bus and shared interrupts, proposal.
Date
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
problems.

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
shared.

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

- The PCIBIOS should assign interrupts for the different
devices.
- 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
pcibios_read_config_byte()
- Assigned IRQ' can be changed by the PCIBIOS call
pcibios_write_config_byte()

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
make.

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:

pci_init_irq()
Function:
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.

pci_set_free_irq(...)
Function:
Assign one of the free interrupts to the device.

pci_set_normal_irq(...)
Function:
Assign the normal IRQ to the device.

pci_set_fast_irq(...)
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
---------------------------------------------------------------------------
Chel van Gennip | Spechtstraat 15 | 2623 GP Delft | The Netherlands
Tel: +31 15 2567783 | Fax: +31 15 2570315 | E-Mail: chel@vangennip.nl
---------------------------------------------------------------------------

\
 
 \ /
  Last update: 2005-03-22 13:39    [W:0.024 / U:0.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site