Messages in this thread Patch in this message |  | | Subject | Re: Irq handler reentrancy ? | From | Robert Love <> | Date | 04 Sep 2002 18:29:28 -0400 |
| |
On Wed, 2002-09-04 at 18:18, Jean Tourrilhes wrote:
> Just a quick question : can an interrupt handler be preempted > or reenter itself ?
It is not supposed to.
There is a bug in 2.5, with a fix from Linus currently in bitkeeper. I have attached the patch.
Robert Love # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.610 -> 1.611 # arch/i386/kernel/irq.c 1.17 -> 1.18 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 02/09/04 torvalds@home.transmeta.com 1.611 # Fix IO-APIC edge IRQ handling. IRQ_INPROGRESS was cleared spuriously # if a new edge happened while we were still processing the previous # one. # # Then, if a _third_ edge came in, it would actually cause a reentrant # irq handler invocation, because the original INPROGRESS bit was now # lost. # # This was actually seen on IDE in PIO mode. # -------------------------------------------- # diff -Nru a/arch/i386/kernel/irq.c b/arch/i386/kernel/irq.c --- a/arch/i386/kernel/irq.c Wed Sep 4 12:00:11 2002 +++ b/arch/i386/kernel/irq.c Wed Sep 4 12:00:11 2002 @@ -380,8 +380,9 @@ break; desc->status &= ~IRQ_PENDING; } -out: desc->status &= ~IRQ_INPROGRESS; + +out: /* * The ->end() handler has to deal with interrupts which got * disabled while the handler was running. @@ -768,7 +769,7 @@ if (!shared) { desc->depth = 0; - desc->status &= ~(IRQ_DISABLED | IRQ_AUTODETECT | IRQ_WAITING); + desc->status &= ~(IRQ_DISABLED | IRQ_AUTODETECT | IRQ_WAITING | IRQ_INPROGRESS); desc->handler->startup(irq); } spin_unlock_irqrestore(&desc->lock,flags); |  |