Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=89d694b9dbe769ca1004e01db0ca43964806a611
Commit:     89d694b9dbe769ca1004e01db0ca43964806a611
Parent:     188fd89d539d899bfca2bc83534e5508e0161139
Author:     Thomas Gleixner <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 18 18:25:17 2008 +0100
Committer:  Thomas Gleixner <[EMAIL PROTECTED]>
CommitDate: Tue Feb 19 10:43:58 2008 +0100

    genirq: do not leave interupts enabled on free_irq
    
    The default_disable() function was changed in commit:
    
     76d2160147f43f982dfe881404cfde9fd0a9da21
     genirq: do not mask interrupts by default
    
    It removed the mask function in favour of the default delayed
    interrupt disabling. Unfortunately this also broke the shutdown in
    free_irq() when the last handler is removed from the interrupt for
    those architectures which rely on the default implementations. Now we
    can end up with a enabled interrupt line after the last handler was
    removed, which can result in spurious interrupts.
    
    Fix this by adding a default_shutdown function, which is only
    installed, when the irqchip implementation does provide neither a
    shutdown nor a disable function.
    
    [EMAIL PROTECTED]: affected versions: .21 - .24 ]
    
    Pointed-out-by: Michael Hennerich <[EMAIL PROTECTED]>
    Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]>
    Acked-by: Ingo Molnar <[EMAIL PROTECTED]>
    Cc: [EMAIL PROTECTED]
    Tested-by: Michael Hennerich <[EMAIL PROTECTED]>
---
 kernel/irq/chip.c |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index cc54c62..fdb3fbe 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -246,6 +246,17 @@ static unsigned int default_startup(unsigned int irq)
 }
 
 /*
+ * default shutdown function
+ */
+static void default_shutdown(unsigned int irq)
+{
+       struct irq_desc *desc = irq_desc + irq;
+
+       desc->chip->mask(irq);
+       desc->status |= IRQ_MASKED;
+}
+
+/*
  * Fixup enable/disable function pointers
  */
 void irq_chip_set_defaults(struct irq_chip *chip)
@@ -256,8 +267,15 @@ void irq_chip_set_defaults(struct irq_chip *chip)
                chip->disable = default_disable;
        if (!chip->startup)
                chip->startup = default_startup;
+       /*
+        * We use chip->disable, when the user provided its own. When
+        * we have default_disable set for chip->disable, then we need
+        * to use default_shutdown, otherwise the irq line is not
+        * disabled on free_irq():
+        */
        if (!chip->shutdown)
-               chip->shutdown = chip->disable;
+               chip->shutdown = chip->disable != default_disable ?
+                       chip->disable : default_shutdown;
        if (!chip->name)
                chip->name = chip->typename;
        if (!chip->end)
-
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  http://vger.kernel.org/majordomo-info.html

Reply via email to