Commit:     4f27c00bf80f122513d3a5be16ed851573164534
Parent:     f3dc8c189a20dc5d115b8f0d07ac620e69eff05c
Author:     Alan Cox <[EMAIL PROTECTED]>
AuthorDate: Sun Jul 15 23:40:55 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Mon Jul 16 09:05:46 2007 -0700

    Improve behaviour of spurious IRQ detect
    Currently we handle spurious IRQ activity based upon seeing a lot of
    invalid interrupts, and we clear things back on the base of lots of valid
    Unfortunately in some cases you get legitimate invalid interrupts caused by
    timing asynchronicity between the PCI bus and the APIC bus when disabling
    interrupts and pulling other tricks.  In this case although the spurious
    IRQs are not a problem our unhandled counters didn't clear and they act as
    a slow running timebomb.  (This is effectively what the serial port/tty
    problem that was fixed by clearing counters when registering a handler
    showed up)
    It's easy enough to add a second parameter - time.  This means that if we
    see a regular stream of harmless spurious interrupts which are not harming
    processing we don't go off and do something stupid like disable the IRQ
    after a month of running.  OTOH lockups and performance killers show up a
    lot more than 10/second
    [EMAIL PROTECTED]: cleanup]
    Signed-off-by: Alan Cox <[EMAIL PROTECTED]>
    Cc: Ingo Molnar <[EMAIL PROTECTED]>
    Cc: Thomas Gleixner <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
 include/linux/irq.h   |    1 +
 kernel/irq/spurious.c |   12 +++++++++++-
 2 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/include/linux/irq.h b/include/linux/irq.h
index 1695054..4465719 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -161,6 +161,7 @@ struct irq_desc {
        unsigned int            wake_depth;     /* nested wake enables */
        unsigned int            irq_count;      /* For detecting broken IRQs */
        unsigned int            irqs_unhandled;
+       unsigned long           last_unhandled; /* Aging timer for unhandled 
count */
        spinlock_t              lock;
 #ifdef CONFIG_SMP
        cpumask_t               affinity;
diff --git a/kernel/irq/spurious.c b/kernel/irq/spurious.c
index bd9e272..32b1619 100644
--- a/kernel/irq/spurious.c
+++ b/kernel/irq/spurious.c
@@ -172,7 +172,17 @@ void note_interrupt(unsigned int irq, struct irq_desc 
                    irqreturn_t action_ret)
        if (unlikely(action_ret != IRQ_HANDLED)) {
-               desc->irqs_unhandled++;
+               /*
+                * If we are seeing only the odd spurious IRQ caused by
+                * bus asynchronicity then don't eventually trigger an error,
+                * otherwise the couter becomes a doomsday timer for otherwise
+                * working systems
+                */
+               if (jiffies - desc->last_unhandled > HZ/10)
+                       desc->irqs_unhandled = 1;
+               else
+                       desc->irqs_unhandled++;
+               desc->last_unhandled = jiffies;
                if (unlikely(action_ret != IRQ_NONE))
                        report_bad_irq(irq, desc, action_ret);
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to