interrupt handling

Hi,
one basic question about interrupt handling. I know that single IRQ line
from APIC can be shared by more than one devices. In such a case, ISRs
of each such devices should read its status registers to find out
whether the interrupt is being generated from its own device or not. If
two devices are generating interrupts in the same line(IRQ) at the same
time, then both device’s ISRs will be executed one-by-one without
missing any interrupts, because those devices will be generating “level
trigger” interrupts.

If a edge-triggering device(s) shares the IRQ with other
level/edge-triggering device(s) then is it possible to miss any
interrupt(s) generated by edge-triggering device(s) ?

Thanks,
Raja

For shared edge triggered interrupts NT takes the approach of calling all
attached ISRs until NONE of them say ‘its mine’. This works, but essentially
edge triggered devices are best not shared.

=====================
Mark Roddy DDK MVP
Windows 2003/XP/2000 Consulting
Hollis Technology Solutions 603-321-1032
www.hollistech.com


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Kannan, Raja
Sent: Friday, December 02, 2005 5:12 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] interrupt handling

Hi,
one basic question about interrupt handling. I know that single IRQ line
from APIC can be shared by more than one devices. In such a case, ISRs of
each such devices should read its status registers to find out whether the
interrupt is being generated from its own device or not. If two devices are
generating interrupts in the same line(IRQ) at the same time, then both
device’s ISRs will be executed one-by-one without missing any interrupts,
because those devices will be generating “level trigger” interrupts.

If a edge-triggering device(s) shares the IRQ with other
level/edge-triggering device(s) then is it possible to miss any interrupt(s)
generated by edge-triggering device(s) ?

Thanks,
Raja


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

>If a edge-triggering device(s) shares the IRQ with other

level/edge-triggering device(s) then is it possible to miss any
interrupt(s) generated by edge-triggering device(s) ?

Yes. Interrupt sharing is prohibited for edge-triggered devices.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

You’ve got several questions buried in there.

  1. Does sharing of IRQs work?

Answer: Yes. If the protocol for that IRQ is level-triggered, then each
ISR in the chain is called until one claims the IRQ. Then the interrupt is
acknowledged. If another device in the chain is also asserting an
interrupt, the acknowlegement will cause another IRQ to be generated. If
the protocol for the IRQ is edge-triggered, then the OS will call every
driver in the chain, repeatedly, until all of them claim that they have no
interrupts pending. This is much less efficient, but it ensures that no
interrupts are lost.

  1. Can you share a single IRQ between two edge-triggered devices?

Answer: Only if they independently assert this IRQ through the chipset, as
with the SIRQ protocol for PCMCIA, or by integration, as with multiple
serial ports. Physical IRQ lines can’t be shared with edge-triggered
interrupts, as one device could mask the other’s attempt to assert.

  1. Can you share a single IRQ between an edge-triggered device and a
    level-triggered device?

Answer: No. This just won’t work, at both the hardware layer and the
software layer. The OS will attempt to enforce this and your driver won’t
get an IRQ that is in use by a device with the opposite protocol. This is
why Windows makes you specify your interrupt trigger mode before your driver
can be started.


Jake Oshins
Windows Kernel Group

The Virtual Machine Team at Microsoft is hiring. Contact
xxxxx@microsoft.com for more information.

This posting is provided “AS IS” with no warranties, and confers no rights.

“Kannan, Raja” wrote in message
news:xxxxx@ntdev…
Hi,
one basic question about interrupt handling. I know that single IRQ line
from APIC can be shared by more than one devices. In such a case, ISRs of
each such devices should read its status registers to find out whether the
interrupt is being generated from its own device or not. If two devices are
generating interrupts in the same line(IRQ) at the same time, then both
device’s ISRs will be executed one-by-one without missing any interrupts,
because those devices will be generating “level trigger” interrupts.

If a edge-triggering device(s) shares the IRQ with other
level/edge-triggering device(s) then is it possible to miss any interrupt(s)
generated by edge-triggering device(s) ?

Thanks,
Raja

Thanks for u’r clarification.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Jake Oshins
Sent: Saturday, December 03, 2005 7:41 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] interrupt handling

You’ve got several questions buried in there.

  1. Does sharing of IRQs work?

Answer: Yes. If the protocol for that IRQ is level-triggered, then
each ISR in the chain is called until one claims the IRQ. Then the
interrupt is acknowledged. If another device in the chain is also
asserting an interrupt, the acknowlegement will cause another IRQ to be
generated. If the protocol for the IRQ is edge-triggered, then the OS
will call every driver in the chain, repeatedly, until all of them claim
that they have no interrupts pending. This is much less efficient, but
it ensures that no interrupts are lost.

  1. Can you share a single IRQ between two edge-triggered devices?

Answer: Only if they independently assert this IRQ through the chipset,
as with the SIRQ protocol for PCMCIA, or by integration, as with
multiple serial ports. Physical IRQ lines can’t be shared with
edge-triggered interrupts, as one device could mask the other’s attempt
to assert.

  1. Can you share a single IRQ between an edge-triggered device and a
    level-triggered device?

Answer: No. This just won’t work, at both the hardware layer and the
software layer. The OS will attempt to enforce this and your driver
won’t get an IRQ that is in use by a device with the opposite protocol.
This is why Windows makes you specify your interrupt trigger mode before
your driver can be started.


Jake Oshins
Windows Kernel Group

The Virtual Machine Team at Microsoft is hiring. Contact
xxxxx@microsoft.com for more information.

This posting is provided “AS IS” with no warranties, and confers no
rights.

“Kannan, Raja” wrote in message
news:xxxxx@ntdev…
Hi,
one basic question about interrupt handling. I know that single IRQ line

from APIC can be shared by more than one devices. In such a case, ISRs
of
each such devices should read its status registers to find out whether
the
interrupt is being generated from its own device or not. If two devices
are
generating interrupts in the same line(IRQ) at the same time, then both
device’s ISRs will be executed one-by-one without missing any
interrupts,
because those devices will be generating “level trigger” interrupts.

If a edge-triggering device(s) shares the IRQ with other
level/edge-triggering device(s) then is it possible to miss any
interrupt(s)
generated by edge-triggering device(s) ?

Thanks,
Raja


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@networkgeneral.com
To unsubscribe send a blank email to xxxxx@lists.osr.com