pci irq problem

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
octavio
Member
Member
Posts: 94
Joined: Wed Oct 25, 2006 5:12 am
Location: Barcelona España
Contact:

pci irq problem

Post 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 ?
User avatar
01000101
Member
Member
Posts: 1599
Joined: Fri Jun 22, 2007 12:47 pm
Contact:

Post 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?
octavio
Member
Member
Posts: 94
Joined: Wed Oct 25, 2006 5:12 am
Location: Barcelona España
Contact:

Post 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.
Korona
Member
Member
Posts: 1000
Joined: Thu May 17, 2007 1:27 pm
Contact:

Post 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.
User avatar
bluecode
Member
Member
Posts: 202
Joined: Wed Nov 17, 2004 12:00 am
Location: Germany
Contact:

Post 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.
User avatar
bewing
Member
Member
Posts: 1401
Joined: Wed Feb 07, 2007 1:45 pm
Location: Eugene, OR, US

Post 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?
octavio
Member
Member
Posts: 94
Joined: Wed Oct 25, 2006 5:12 am
Location: Barcelona España
Contact:

Post 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?
User avatar
bewing
Member
Member
Posts: 1401
Joined: Wed Feb 07, 2007 1:45 pm
Location: Eugene, OR, US

Post 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.
iammisc
Member
Member
Posts: 269
Joined: Thu Nov 09, 2006 6:23 pm

Post by iammisc »

uhmm... just use an interrupt mask so you never get the interrupts you don't want. :roll:
User avatar
01000101
Member
Member
Posts: 1599
Joined: Fri Jun 22, 2007 12:47 pm
Contact:

Post by 01000101 »

ya, said that a long time ago. =)
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Post 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...
User avatar
bluecode
Member
Member
Posts: 202
Joined: Wed Nov 17, 2004 12:00 am
Location: Germany
Contact:

Post by bluecode »

Yea, it is in the PCI Configuration Space of that particular device. That was already said before.
Post Reply