Skip to contentSkip to conversation

APIC, changing level/edge interrupt

DISCUSSION Pierre Ossman 2 participants 5 messages Dec 28, 2004 – Jan 1, 2005

lore
Share & tools
lore
#0 lore raw

How do you tell the APIC that a device uses level triggered interrupts, not edge triggered? I have a flash reader on the LPC bus which uses level triggered interrupts and /proc/interrupts show edge triggered. Some interrupts are missed by the APIC so I figured this might be why.

Rgds
Pierre

#1 lore raw
Quoted 4 lines · Pierre Ossman

How do you tell the APIC that a device uses level triggered interrupts, not edge triggered? I have a flash reader on the LPC bus which uses level triggered interrupts and /proc/interrupts show edge triggered. Some interrupts are missed by the APIC so I figured this might be why.

BIOS should set this up. Maybe ACPI has a way to do this?

#2 lore raw
Quoted 10 lines · Tim Hockin
Quoted 3 lines · Pierre Ossman

How do you tell the APIC that a device uses level triggered interrupts, not edge triggered? I have a flash reader on the LPC bus which uses level triggered interrupts and /proc/interrupts show edge triggered. Some interrupts are missed by the APIC so I figured this might be why.

BIOS should set this up. Maybe ACPI has a way to do this?

Should doesn't always mean that it actually does ;)
But since BIOS can configure the APIC then the kernel should be able to also. A quick and dirty hack will suffice ATM since I just want to pinpoint where the problem is. What is the default mode and what does the XT-PIC expect? (it works fine with the apic disabled).

ACPI might have some functions to configure the APIC correctly but right now the connection between ACPI and drivers is rather weak (non-existant for this driver) so that's not really a viable solution when testing. Might be a good long term solution though.

Rgds
Pierre

#3 lore raw
Quoted 3 lines · Pierre Ossman
Quoted 1 line

BIOS should set this up. Maybe ACPI has a way to do this?

Should doesn't always mean that it actually does ;)

Of course. My point was that if it does not, it's a bug in the BIOS.

Quoted 1 line

But since BIOS can configure the APIC then the kernel should be able to

Of course, but the kernel has no way to know whether a device should be edge or level triggered unless you have a driver for that device. And even if you do, I don't know that there is an API in kernel to say set_irq_mode(IRQ_EDGE) (though there could be).

Quoted 2 lines

What is the default mode and what does the XT-PIC expect? (it works fine with the apic disabled).

I think default is PIC-compatible which is edge by default. I think. I don;t have the book here.

Quoted 4 lines

ACPI might have some functions to configure the APIC correctly but right now the connection between ACPI and drivers is rather weak (non-existant for this driver) so that's not really a viable solution when testing. Might be a good long term solution though.

I know ACPI can get the information with the _PRS and _CRS methods. The OSPM core should probably be re-programming the (A)PIC appropriately. Of course, that depends on the BIOS vendor getting the ACPI correct, too.

#4 lore raw
Quoted 4 lines · Tim Hockin

Of course. My point was that if it does not, it's a bug in the BIOS.

Something Windows doesn't seem to be affected by so I don't think we'll get much help fixing the bios.

Quoted 11 lines
Quoted 3 lines

But since BIOS can configure the APIC then the kernel should be able to

Of course, but the kernel has no way to know whether a device should be edge or level triggered unless you have a driver for that device. And even if you do, I don't know that there is an API in kernel to say set_irq_mode(IRQ_EDGE) (though there could be).

There are some calls in the ACPI layer which plays with the level/edge stuff but they don't seem very generic. Besides, what I want right now is just some possibility of confirming that this level/edge business is the cause of all these problems.

Quoted 9 lines
Quoted 3 lines

What is the default mode and what does the XT-PIC expect? (it works fine with the apic disabled).

I think default is PIC-compatible which is edge by default. I think. I don;t have the book here.

Ok. The default from the device is level mode which works fine on PIC systems. I'm not sure that the hardware actually respects this bit because level/pulse mode doesn't make any difference on either PIC or APIC systems.

Rgds
Pierre