ISA vs PCI interrupt handling
Hi,
A simple question: there are drivers for ISA and PCI devices. The IRQ handlers are registered with request_irq(flags = 0) or request_irq(SA_SHIRQ) for PCI.
In both cases, the device raises an IRQ line and the handler is called. Does the handler have to make sure the device has lowered the IRQ? I mean, in situation where the handler terminates with the IRQ line being still active, will the handler be called again, or will the driver deadlock? Does is behave differently on ISA and PCI?
Many network drivers use something like this:
static voidnet_rx(struct net_device *dev)
{
int boguscount = 10;
do {
do_something();
} while (--boguscount);
}Will such an IRQ handler work correctly after boguscount reaches 0? Or is it just a protection against runaway devices, and it's normal that they die from it (possibly recovering through a timer)?
My experiments with ISA devices show that after the handler terminates without i.e. handling all requests, the IRQ line is stuck at +5V (= logical "active" level) and the handler isn't called anymore.
Or does that mean the IRQ is edge-triggered, and the handler is being called just once a low-to-high edge is detected?
Signature · 2 lines
Krzysztof Halasa Network Administrator
Quoted 11 lines · Krzysztof Halasa
Hi,
A simple question: there are drivers for ISA and PCI devices. The IRQ handlers are registered with
request_irq(flags = 0)orrequest_irq(SA_SHIRQ)for PCI.In both cases, the device raises an IRQ line and the handler is called. Does the handler have to make sure the device has lowered the IRQ? I mean, in situation where the handler terminates with the IRQ line being still active, will the handler be called again, or will the driver deadlock? Does is behave differently on ISA and PCI?
For PCI at least you must mask the IRQ on your device in that situation. It must also be masked on the device not via disable_irq
Quoted 2 lines · Alan Cox
For PCI at least you must mask the IRQ on your device in that situation. It must also be masked on the device not via
disable_irq
Thanks.
Looks like it's even more important on ISA.
Signature · 2 lines
Krzysztof Halasa Network Administrator