2003-09-09 16:10:35

by Adam Litke

[permalink] [raw]
Subject: Determining pci bus from irq

Is there a nice way to determine, given an irq number, the pci bus
number that raised the interrupt?




2003-09-09 17:11:19

by Alan

[permalink] [raw]
Subject: Re: Determining pci bus from irq

On Maw, 2003-09-09 at 17:10, Adam Litke wrote:
> Is there a nice way to determine, given an irq number, the pci bus
> number that raised the interrupt?

In general the answer is you can't find out. PCI IRQ lines are shared.
You can certainly lock and walk the pci device list looking for matches
but you may get a lot of devices on different busses

2003-09-09 17:34:08

by Richard B. Johnson

[permalink] [raw]
Subject: Re: Determining pci bus from irq

On Tue, 9 Sep 2003, Alan Cox wrote:

> On Maw, 2003-09-09 at 17:10, Adam Litke wrote:
> > Is there a nice way to determine, given an irq number, the pci bus
> > number that raised the interrupt?
>
> In general the answer is you can't find out. PCI IRQ lines are shared.
> You can certainly lock and walk the pci device list looking for matches
> but you may get a lot of devices on different busses
>

Unless you've got a 'scope. If a device is interrupting often
or if it can be made to interrupt. you can look at the pin on
the PCI card. For some reason, on ix86, the logical "pin" is
always "A", regardless of the device, so you only have one
interrupt line connected to each slot. On lap-tops, there is
often only one IRQ shared for everything IRQ9 for Compaq.

These interrupt lines are usually not physically connected
together. They are ORed in some glue chip so you can see
what card is actually operating the line. On PCI, the IRQ
pin is (+) for TRUE, normally pulled down, and never floating.

Cheers,
Dick Johnson
Penguin : Linux version 2.4.22 on an i686 machine (794.73 BogoMips).
Note 96.31% of all statistics are fiction.


2003-09-09 21:26:42

by Alan

[permalink] [raw]
Subject: Re: Determining pci bus from irq

On Maw, 2003-09-09 at 18:36, Richard B. Johnson wrote:
> Unless you've got a 'scope. If a device is interrupting often
> or if it can be made to interrupt. you can look at the pin on
> the PCI card. For some reason, on ix86, the logical "pin" is
> always "A", regardless of the device, so you only have one
> interrupt line connected to each slot. On lap-tops, there is
> often only one IRQ shared for everything IRQ9 for Compaq.

Multifunction devices may well use more than INTA. A PC does
normally use INTA for each device and barberpole the ABCD lines
between slots

Quad ethernet cards using ABCD seem common