2001-11-05 23:44:03

by Matthew Clark

[permalink] [raw]
Subject: PCI interrupts


Dear kernel list,

I am writing a dev driver for a pci device and I am having some
difficultly getting the interrupts line.

As far as I understood the BIOS / kernel would sort out a unique
interrupt line for me which I could then get by registering with
the system.

In my development system the PCI card I am developing the
driver for reports (from the PCI config region) that it is using
interrupt 5. I can't register this interrupt as it is already
in use by the USB controller.


(a) should my card have a unique number- if so what should I
do?

(b) if it shouldn't have a unique number do I have to share the
interrupt (with the usb controller) or can I change it to
another address (by writing to the config space?)?
If I have to share it how do I do this- (my card will generate a
lot of interrupt traffic)?.

I have free interrupts and would prefer not to share the
interrrupt for this device.

Any help / suggestions gratefully received-

apologies if this is in the wrong place--


Thanks matt


snippet from lspci -v
.....
00:1f.2 USB Controller: Intel Corporation 82801AA USB (rev 02)
(prog-if 00 [UHCI])
Subsystem: Intel Corporation 82801AA USB
Flags: bus master, medium devsel, latency 0, IRQ 5
......
01:05.0 DMA controller: PLX Technology, Inc. PCI <-> IOBus
Bridge (rev 02) (prog-if 00 [8237])
Subsystem: PLX Technology, Inc. PCI <-> IOBus Bridge
Flags: medium devsel, IRQ 5
......
Ignore the PLX PCI id- the card developers didn't get their own
number.....


cat /proc/interrupts

CPU0
0: 2099604 XT-PIC timer
1: 3541 XT-PIC keyboard
2: 0 XT-PIC cascade
3: 11 XT-PIC serial
4: 1537 XT-PIC serial
5: 0 XT-PIC usb-uhci
8: 1 XT-PIC rtc
11: 196886 XT-PIC eth0, i810@PCI:0:1:0
14: 13005 XT-PIC ide0
15: 0 XT-PIC ide1
NMI: 0
ERR: 0


2001-11-05 23:50:45

by Alan

[permalink] [raw]
Subject: Re: PCI interrupts

> In my development system the PCI card I am developing the
> driver for reports (from the PCI config region) that it is using
> interrupt 5. I can't register this interrupt as it is already
> in use by the USB controller.

PCI interrupts are shared, and must be sharable. Generally the bus wiring
determines what gets shared

2001-11-06 08:47:12

by Zwane Mwaikambo

[permalink] [raw]
Subject: RE: PCI interrupts

Matthew Clark said...
>(b) if it shouldn't have a unique number do I have to share the
>interrupt (with the usb controller) or can I change it to
>another address (by writing to the config space?)?
>If I have to share it how do I do this- (my card will generate a
>lot of interrupt traffic)?.
Assuming i386

>From my limited knowledge about the IRQ handling subsystems, you would
call arch/i386/irq.c:request_irq() with the appropriate flags, ie
SA_SHIRQ and any others you may require. I *think* you might also be able
to do dev->irq = irq_num and then do your request_irq() but you might
require a bit of voodoo inbetween.

Regards,
Zwane Mwaikambo

2001-11-06 14:38:25

by Tommy Reynolds

[permalink] [raw]
Subject: Re: PCI interrupts

It was a dark and stormy night. Suddenly "Matthew Clark" <[email protected]> wrote:

> In my development system the PCI card I am developing the
> driver for reports (from the PCI config region) that it is using
> interrupt 5. I can't register this interrupt as it is already
> in use by the USB controller.

PCI interrupts can be shared, but every handler must be registered with the
SA_SHIRQ flag on the request_irq() call. Both the request_irq() and free_irq()
routines need a "dev_id" cookie to uniquely identify your instance of the
interrurpt handler.

You can see shared interrupts in "/proc/interrupts" because there will be a
comma-separated list of handler names for each IRQ level.

---------------------------------------------+-----------------------------
Tommy Reynolds | mailto: <[email protected]>
Red Hat, Inc., Embedded Development Services | Phone: +1.256.704.9286
307 Wynn Drive NW, Huntsville, AL 35805 USA | FAX: +1.256.837.3839
Senior Software Developer | Mobile: +1.919.641.2923


Attachments:
(No filename) (197.00 B)