I have a CAN PCI card installed on my Ubuntu box.
I understand that PCI interrupts should be level rather than edge
triggered.
The output of cat /proc/interrupts is :-
CPU0
0: 1614601 IO-APIC-edge timer
1: 164 IO-APIC-edge i8042
8: 3 IO-APIC-edge rtc
9: 1 IO-APIC-level acpi
12: 0 IO-APIC-edge CAN-ACx-PCI_01
14: 65786 IO-APIC-edge ide0
169: 3220 IO-APIC-level eth0, i915@pci:0000:00:02.0
177: 46459 IO-APIC-level eth1
209: 0 IO-APIC-level uhci_hcd:usb3, eth2
217: 2 IO-APIC-level uhci_hcd:usb1, ehci_hcd:usb4
225: 697 IO-APIC-level uhci_hcd:usb2
NMI: 0
LOC: 1614399
ERR: 0
MIS: 0
You see that irq 12 CAN-ACx-PCI_01 is edge triggered.
Is there any way of forcing the BIOS to see the interrupt as a
level-triggered one?
*******************Internet Email Confidentiality Footer*******************
The contents of this e-mail message (including any attachments hereto) are
confidential to and are intended to be conveyed for the use of the
recipient to whom it is addressed only. If you receive this transmission in
error, please notify the sender of this immediately and delete the message
from your system. Any distribution, reproduction or use of this message by
someone other than recipient is not authorized and may be unlawful.
Elekta Limited is a company registered in England and Wales whose
registered number is 3244454 and whose registered address is Linac House,
Fleming Way, Crawley, West Sussex, RH10 9RR
-
It's done in the driver. IRQ12 can be shared, so the driver needs to request the IRQ as a shared interrupt. Cheers, Dick Johnson Penguin : Linux version 2.6.22.1 on an i686 machine (5588.30 BogoMips). My book : http://www.AbominableFirebug.com/ _ **************************************************************** The information transmitted in this message is confidential and may be privileged. Any review, retransmission, dissemination, or other use of this information by persons or entities other than the intended recipient is prohibited. If you are not the intended recipient, please notify Analogic Corporation immediately - by replying to this message or by sending an email to DeliveryErrors@analogic.com - and destroy all copies of this information, including any attachments, without reading or disclosing them. Thank you. -
The driver already does that ...
result =
request_irq(irq, can_pci_interrupt, SA_INTERRUPT | SA_SHIRQ,
pDevice->au8IrqName, pDevice);
Any other ideas?
Duncan
"linux-os \(Dick
Johnson\)"
<linux-os@analogi To
c.com> <Duncan.Perrett@elekta.com>
cc
18/09/2007 14:57 "Linux kernel"
<linux-kernel@vger.kernel.org>
Subject
Please respond to Re: PCI Interrupt
"linux-os \(Dick
Johnson\)"
<linux-os@analogi
c.com>
It's done in the driver. IRQ12 can be shared, so the driver
needs to request the IRQ as a shared interrupt.
Cheers,
Dick Johnson
Penguin : Linux version 2.6.22.1 on an i686 machine (5588.30 BogoMips).
My book : http://www.AbominableFirebug.com/
_
****************************************************************
The information transmitted in this message is confidential and may be
privileged. Any review, retransmission, dissemination, or other use of
this information by persons or entities other than the intended recipient
is prohibited. If you are not the intended ...Maybe the system thinks a ps2 mouse port owns irq 12 and messes it up as a result. -- Len Sorensen -
Okay, then in the BIOS, make sure that IRQ12 is not assigned to a specific device. In other words, set it to PnP (if available). As you well know, PCI requires sharable interrupts and edges are not sharable so something is broken. As a last resort, move your PCI board to abother slot which should pick up another interrupt, which may not be broken. If that doesn't work, see if a new BIOS is available for download. Cheers, Dick Johnson Penguin : Linux version 2.6.22.1 on an i686 machine (5588.30 BogoMips). My book : http://www.AbominableFirebug.com/ _ **************************************************************** The information transmitted in this message is confidential and may be privileged. Any review, retransmission, dissemination, or other use of this information by persons or entities other than the intended recipient is prohibited. If you are not the intended recipient, please notify Analogic Corporation immediately - by replying to this message or by sending an email to DeliveryErrors@analogic.com - and destroy all copies of this information, including any attachments, without reading or disclosing them. Thank you. -
Sorted.
A setting in the BIOS meant it was storing old configuration data.
After disabling this option, it became a level triggered interrupt and
everything now works!
Thanks.
"linux-os \(Dick
Johnson\)"
<linux-os@analogi To
c.com> <Duncan.Perrett@elekta.com>
cc
18/09/2007 15:34 "Linux kernel"
<linux-kernel@vger.kernel.org>
Subject
Please respond to Re: PCI Interrupt
"linux-os \(Dick
Johnson\)"
<linux-os@analogi
c.com>
Okay, then in the BIOS, make sure that IRQ12 is not assigned to
a specific device. In other words, set it to PnP (if available).
As you well know, PCI requires sharable interrupts and edges
are not sharable so something is broken. As a last resort,
move your PCI board to abother slot which should pick up another
interrupt, which may not be broken. If that doesn't work, see
if a new BIOS is available for download.
Cheers,
Dick Johnson
Penguin : Linux version 2.6.22.1 on an i686 machine (5588.30 BogoMips).
My book : ...Good! Cheers, Dick Johnson Penguin : Linux version 2.6.22.1 on an i686 machine (5588.30 BogoMips). My book : http://www.AbominableFirebug.com/ _ **************************************************************** The information transmitted in this message is confidential and may be privileged. Any review, retransmission, dissemination, or other use of this information by persons or entities other than the intended recipient is prohibited. If you are not the intended recipient, please notify Analogic Corporation immediately - by replying to this message or by sending an email to DeliveryErrors@analogic.com - and destroy all copies of this information, including any attachments, without reading or disclosing them. Thank you. -
On 18-09-2007 16:42, Rafael J. Wysocki wrote: Let's agree it's only a superstition... http://en.wikipedia.org/wiki/Edge_triggered_interrupt Regards, Jarek P. -
Well, if this is an MSI (which is edge-triggered), for example, it cannot be shared. Also, you must use a level-triggered interrupt for SCI, because that has to be shareable. Greetings, Rafael -
Superstition? Depends on how stringent your requirements are. On IBM PC compatible hardware, there's always a risky "window of opportunity" that a shared edge-triggered interrupt line gets electrically re-triggered before your ISR manages to service all the devices and ACK the interrupt (I believe RTAI does that in reverse order). In that case, you get a missed interrupt, and your peripherial device may wait for service indefinitely. I don't recall if the i8259 AT-pic has some useable "retrigger while in service" register, maybe the APIC does. (I do recall that the 8259's two-register IO footprint is rather convoluted.) I seriously doubt that the presence of such a register would completely eliminate the critical window of time. On PC hardware or in general, sharing edge-triggered interrupts can be perfectly allright under very specific conditions, if you know exactly what you're doing, e.g. you know that the collision of interrupt sources simply cannot occur (due to some characteristic sequencing of interrupt-generating events in the specific peripherial hardware), or you don't quite bother (in that case, why use an interrupt at all?). You can certainly try to re-check your string of devices before finally ACKing, or set up supplemental timer-based periodic polling, but those are all kludgey workarounds that converge towards not using interrupts at all. I believe this is one of the reasons why e.g. ISA multi-port serial boards with a shared interrupt have been dropped from Linux 2.6 (vs. 2.4). The fact that some ISA peripherials do respect the open-collector convention, so that electrical sharing of the IRQ line is possible, doesn't help the ISR do the job in time. Even at the electric level, this rule is far from notorious. I've had the opportunity to write a driver for a special-purpose ISA board, where two different generations of the hardware treated the IRQ line very differently. If you use OC+pullup combined with active-low pulses of ...
My requirements aren't stringent at all. They are general like the sentence: "edge-triggered interrupts cannot be shared", which, IMHO, could mislead somebody. So, it's only about "cannot" vs. "cannot (or is not recommended/implemented) with some kind of hardware (like PC)". Regards, Jarek P. -
That's because the 8259A does not support truly edge-triggered interrupts -- what it supports is a signalling model where the rising edge asserts the interrupt and the falling edge negates it if unhandled. So in some sense it is a level-triggered interrupt with no retrigger before the The APIC can support truly edge-triggered interrupts as it only records one of the edges (which one of the two it is, depends on the polarity setting). It also records another edge happening between an ACK and an EOI and signals another interrupt immediately after the EOI, so nothing is lost if pulses are short (assuming there is a reasonably small number of sources so that overlapping pulses do not continue for too long). There are subtle differences, as usually with Intel, between APIC implementations that may have to be taken into account here. Also sharing at the vector level poses interesting issues, but that's different matter. Maciej -
