PCI device irq conflict

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
razer
Posts: 6
Joined: Sat Dec 15, 2012 9:46 am

PCI device irq conflict

Post 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?
User avatar
sortie
Member
Member
Posts: 931
Joined: Wed Mar 21, 2012 3:01 pm
Libera.chat IRC: sortie

Re: PCI device irq conflict

Post 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.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: PCI device irq conflict

Post 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.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
razer
Posts: 6
Joined: Sat Dec 15, 2012 9:46 am

Re: PCI device irq conflict

Post 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?
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: PCI device irq conflict

Post by Combuster »

PCI only does line A through D. What are you basing those numbers off?
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
razer
Posts: 6
Joined: Sat Dec 15, 2012 9:46 am

Re: PCI device irq conflict

Post by razer »

I readout the pci device structure: PCI and readout the IRQ line register (Offset 0x3C).
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: PCI device irq conflict

Post 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.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Post Reply