Monday, December 18, 2006

Expounding on the kludge

My kludge seems to be turning out reasonably well for me, so I thought I'd give a more thorough explanation of what I did. To recap, when ACPI is enabled, the kernel sets basically all the devices to be edge-triggered. This is bad.

I've researched an obscene number of possible solutions, but I'll discuss those later as some of them may still prove to be better solutions overall than my current one. On with the show.

The kernel determines what kind of trigger to set an IRQ to by calling MPBIOS_trigger in arch/$ARCH/kernel/io_apic.c. Basically, it takes an integer and runs through some cases and returns the trigger at the bottom. Reading through it, you'll quickly notice that one of the cases is labeled the "edge" case. In my case, I pretty much wanted everything on IRQ 11 to be level-triggered. If you just groaned aloud, you guessed it.

In the "edge" case, I slapped my if statment in the middle of things so it reads:

case 1: /* edge */
{
trigger = 0
if (idx == 11) {
trigger = 1;
}
break;
}

Sure enough, when the computer starts up everything that used to be on IRQ 9 and/or 11 now has it's own interrupt and they are all level triggered. I'll admit that I was a little weirded out to see my sound card on IRQ 20. I don't know what the implications are for that sort of thing but I'm sure I'll find out.

My testing so far has revealed only the problem I mentioned in the previous post: boot freezes about 2/3 of the time when trying to set the system clock from hardware. This is almost certainly related to my change, but it's an acceptable trade for now.

1 Comments:

Blogger Chris said...

I'm running openSUSE 10.2 and was receiving the message about irq 7 mentioned here.

Adding the kernel parameter pci=biosirq to 2.6.18 let me use my thumb drive successfully.

10:36 PM  

Post a Comment

<< Home