Page 1 of 1
pci irq problem
Posted: Sun Apr 27, 2008 5:53 am
by octavio
Hello My OS freezes when i enable irq6 , i think the cause is a pci sound card that produces a irq ,the problem only happens when the sound card
is pluged in a given pci slot.
My irq handler sends the ack to the pic but the system freezes,because irqs stops working.I don´t have a driver for this sound card so i don´t know how to solve this problem.
and don´t know how to dissable irq on all pci devices.
some other ideas?
why are pci interrupts special ?
Posted: Sun Apr 27, 2008 11:49 am
by 01000101
it's not that you need to disable all PCI irq's, but rather enable the irq's that you need and leave the rest disabled. this is done through the PIC. Also, do you have a generic handler for all IRQ's that don't have an associative handler? if so, are you acknowledging both the master & slave PIC's whic appropriate?
Posted: Sun Apr 27, 2008 12:24 pm
by octavio
01000101 wrote:it's not that you need to disable all PCI irq's, but rather enable the irq's that you need and leave the rest disabled. this is done through the PIC. Also, do you have a generic handler for all IRQ's that don't have an associative handler? if so, are you acknowledging both the master & slave PIC's whic appropriate?
Yes i ack the master pic but the computer freezes.
Posted: Sun Apr 27, 2008 1:08 pm
by Korona
That sounds like a bug in your code. The machine should never freeze if you acknowledge the PIC. There is nothing special about PCI interrupts.
Posted: Sun Apr 27, 2008 1:37 pm
by bluecode
Korona wrote:There is nothing special about PCI interrupts.
There actually is, they are level-triggered, which means that the IRQ keeps firing until the source of the interrupt is handled. So if you don't have a driver for the soundcard ('handle the interrupt') the irq keeps firing. I guess that could look like the computer freezed.
Posted: Sun Apr 27, 2008 2:10 pm
by bewing
Hmmmm. I have not had to deal with that problem yet. That sounds very annoying during boot, when the drivers are not loaded yet. It seems like the only way to handle that during boot (as said above) is to keep the PICs masked to only the IRQs that you really want to see? (Which could be none of them, while you are in singletasking mode, and doing polling instead?)
-- But what if an "unhandled" PCI board is sharing an interrupt with a PCI card that you need to use during boot?
Posted: Sun Apr 27, 2008 2:53 pm
by octavio
bluecode wrote:Korona wrote:There is nothing special about PCI interrupts.
There actually is, they are level-triggered, which means that the IRQ keeps firing until the source of the interrupt is handled. So if you don't have a driver for the soundcard ('handle the interrupt') the irq keeps firing. I guess that could look like the computer freezed.
Yes ,i think this is the problem,but what is the solution?
Since the irq is used by many devices (floppy and sound card in this case)
i need to enable the interrupt for my floppy driver.
By now i placed the sound card in another pci slot ,but i can not expect from people that test my Os from doing the same.
On another computer i had a similar problem with a ethernet card,in this case the computer hangs before the OS is loaded.I think is a hardware bug but windows has some patch for this.
it is posible to disable a pci device for wich there is no driver?
Posted: Sun Apr 27, 2008 8:01 pm
by bewing
If there is a generic way to disable an arbitrary PCI card, it's going to be some universal setting in the PCI configuration space. But I haven't looked into that yet.
Posted: Sun Apr 27, 2008 9:16 pm
by iammisc
uhmm... just use an interrupt mask so you never get the interrupts you don't want.
Posted: Mon Apr 28, 2008 12:29 am
by 01000101
ya, said that a long time ago. =)
Posted: Mon Apr 28, 2008 1:29 am
by pcmattman
I think the problem is that the IRQ is shared with other devices, meaning you can't mask it off. There should be some way to stop the PCI device firing IRQs though...
Posted: Mon Apr 28, 2008 3:17 am
by bluecode
Yea, it is in the PCI Configuration Space of that particular device. That was already said before.