* Irq handler reentrancy ?
@ 2002-09-04 22:18 Jean Tourrilhes
2002-09-04 22:29 ` Robert Love
0 siblings, 1 reply; 4+ messages in thread
From: Jean Tourrilhes @ 2002-09-04 22:18 UTC (permalink / raw)
To: Linux kernel mailing list, Jeff Garzik, Alan Cox
Hi,
Just a quick question : can an interrupt handler be preempted
or reenter itself ?
I know that it can execute in parallel on the various CPUs, so
require spin_lock protection. However, on 2.5.32 I see weird bugs that
lead me to believe that the irq handler is interrupted at the point
where a new hardware interrupt is generated (for example, after
clearing the previous irq or after setting the new irq mask). The box
just freezes, without giving any Opps or anything on the serial
console. Of course, any attempt to add relevant printks make the bug
goes away, so it's impossible to debug.
2.4.20 runs fine.
Thanks...
Jean
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Irq handler reentrancy ?
2002-09-04 22:18 Irq handler reentrancy ? Jean Tourrilhes
@ 2002-09-04 22:29 ` Robert Love
2002-09-04 22:32 ` Jean Tourrilhes
2002-09-04 23:55 ` Jean Tourrilhes
0 siblings, 2 replies; 4+ messages in thread
From: Robert Love @ 2002-09-04 22:29 UTC (permalink / raw)
To: jt; +Cc: Linux kernel mailing list, Jeff Garzik, Alan Cox
[-- Attachment #1: Type: text/plain, Size: 276 bytes --]
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
[-- Attachment #2: cset-1.611.txt --]
[-- Type: text/plain, Size: 1576 bytes --]
# 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);
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Irq handler reentrancy ?
2002-09-04 22:29 ` Robert Love
@ 2002-09-04 22:32 ` Jean Tourrilhes
2002-09-04 23:55 ` Jean Tourrilhes
1 sibling, 0 replies; 4+ messages in thread
From: Jean Tourrilhes @ 2002-09-04 22:32 UTC (permalink / raw)
To: Robert Love; +Cc: Linux kernel mailing list, Jeff Garzik, Alan Cox
On Wed, Sep 04, 2002 at 06:29:28PM -0400, Robert Love wrote:
> 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
You saved my life ! I was beggining to get crazy.
I just need to check the patch ;-)
Jean
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Irq handler reentrancy ?
2002-09-04 22:29 ` Robert Love
2002-09-04 22:32 ` Jean Tourrilhes
@ 2002-09-04 23:55 ` Jean Tourrilhes
1 sibling, 0 replies; 4+ messages in thread
From: Jean Tourrilhes @ 2002-09-04 23:55 UTC (permalink / raw)
To: Robert Love; +Cc: Linux kernel mailing list
On Wed, Sep 04, 2002 at 06:29:28PM -0400, Robert Love wrote:
> 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
Definitely cured my problems. Thanks !
Jean
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2002-09-04 23:51 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-04 22:18 Irq handler reentrancy ? Jean Tourrilhes
2002-09-04 22:29 ` Robert Love
2002-09-04 22:32 ` Jean Tourrilhes
2002-09-04 23:55 ` Jean Tourrilhes
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®