Page 1 of 1

PCI device irq conflict

Posted: Sun Jan 06, 2013 3:08 pm
by razer
During PCI enumeration I found out an IRQ conflict between my pci network card and my soundcard.
I'm using qemu for emulation. Qemu monitor also proves this. Both devices get irq 11.

I'm using a 8259 PIC for controlling interrupts. Is it possible to remap one interrupt from 10 to 11?

Re: PCI device irq conflict

Posted: Sun Jan 06, 2013 3:25 pm
by sortie
I recall that you can change interrupts easily by writing to PCI registers. Have a look at the wiki entries, I got it from there. There is some problems with rogue BIOSes if you use APIC (or what it is called), IIRC.

Re: PCI device irq conflict

Posted: Sun Jan 06, 2013 3:29 pm
by Combuster
Actually PCI interrupts don't conflict. If several devices share an interrupt line you can simply ask each device if it was responsible. Level triggered interrupts are the electronic solution to make sure concurrent interrupts do not get lost.

Re: PCI device irq conflict

Posted: Sun Jan 06, 2013 3:31 pm
by razer
I wrote the interrupt line register but the result was I didn't get an interrupt from the device:

The flow was:
Read out irq line --> IRQ11
Configure device for IRQ10
Write irq line to IRQ10

The result was, I didn't get any IRQ on 10. If I do the flow above with 11 (read 11 and overwrite with 11) it works.
Are there any steps additionally needed?

Re: PCI device irq conflict

Posted: Sun Jan 06, 2013 3:38 pm
by Combuster
PCI only does line A through D. What are you basing those numbers off?

Re: PCI device irq conflict

Posted: Sun Jan 06, 2013 3:48 pm
by razer
I readout the pci device structure: PCI and readout the IRQ line register (Offset 0x3C).

Re: PCI device irq conflict

Posted: Sun Jan 06, 2013 4:18 pm
by Combuster
That field is just a message the BIOS left for you - you might be able to change it but it does nothing meaningful. After all, it's an electrical limit that you can't connect arbitrary PCI devices to arbitrary IRQ lines.

ACPI tells you everything you need to know about the IRQ circuitry, but you might not be able to get rid of all the IRQ sharing depending on the lack of wires on the motherboard or chipset. But since IRQ sharing is not a bug at all you should just use the moment to make sure your kernel is able to deal with it instead of merely fighting symptoms in vain.