Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=46f4f8f665080900e865392f4b3593be463bf0d8
Commit:     46f4f8f665080900e865392f4b3593be463bf0d8
Parent:     922f9cfa79b52c85b6002d96cb0eefd13437c58c
Author:     Ralf Baechle <[EMAIL PROTECTED]>
AuthorDate: Fri Feb 8 04:22:01 2008 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Fri Feb 8 09:22:42 2008 -0800

    IRQ_NOPROBE helper functions
    
    Probing non-ISA interrupts using the handle_percpu_irq as their handle_irq
    method may crash the system because handle_percpu_irq does not check
    IRQ_WAITING.  This for example hits the MIPS Qemu configuration.
    
    This patch provides two helper functions set_irq_noprobe and set_irq_probe 
to
    set rsp.  clear the IRQ_NOPROBE flag.  The only current caller is MIPS code
    but this really belongs into generic code.
    
    As an aside, interrupt probing these days has become a mostly obsolete if 
not
    dangerous art.  I think Linux interrupts should be changed to default to
    non-probing but that's subject of this patch.
    
    Signed-off-by: Ralf Baechle <[EMAIL PROTECTED]>
    Acked-and-tested-by: Rob Landley <[EMAIL PROTECTED]>
    Cc: Alan Cox <[EMAIL PROTECTED]>
    Cc: Ingo Molnar <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 include/linux/irq.h |    3 +++
 kernel/irq/chip.c   |   36 ++++++++++++++++++++++++++++++++++++
 2 files changed, 39 insertions(+), 0 deletions(-)

diff --git a/include/linux/irq.h b/include/linux/irq.h
index a19b381..bfd9efb 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -367,6 +367,9 @@ set_irq_chained_handler(unsigned int irq,
        __set_irq_handler(irq, handle, 1, NULL);
 }
 
+extern void set_irq_noprobe(unsigned int irq);
+extern void set_irq_probe(unsigned int irq);
+
 /* Handle dynamic irq creation and destruction */
 extern int create_irq(void);
 extern void destroy_irq(unsigned int irq);
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index 10e0066..cc54c62 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -589,3 +589,39 @@ set_irq_chip_and_handler_name(unsigned int irq, struct 
irq_chip *chip,
        set_irq_chip(irq, chip);
        __set_irq_handler(irq, handle, 0, name);
 }
+
+void __init set_irq_noprobe(unsigned int irq)
+{
+       struct irq_desc *desc;
+       unsigned long flags;
+
+       if (irq >= NR_IRQS) {
+               printk(KERN_ERR "Trying to mark IRQ%d non-probeable\n", irq);
+
+               return;
+       }
+
+       desc = irq_desc + irq;
+
+       spin_lock_irqsave(&desc->lock, flags);
+       desc->status |= IRQ_NOPROBE;
+       spin_unlock_irqrestore(&desc->lock, flags);
+}
+
+void __init set_irq_probe(unsigned int irq)
+{
+       struct irq_desc *desc;
+       unsigned long flags;
+
+       if (irq >= NR_IRQS) {
+               printk(KERN_ERR "Trying to mark IRQ%d probeable\n", irq);
+
+               return;
+       }
+
+       desc = irq_desc + irq;
+
+       spin_lock_irqsave(&desc->lock, flags);
+       desc->status &= ~IRQ_NOPROBE;
+       spin_unlock_irqrestore(&desc->lock, flags);
+}
-
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