]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] genirq: add ->retrigger() irq op to consolidate hw_irq_resend()
authorIngo Molnar <mingo@elte.hu>
Thu, 29 Jun 2006 09:24:44 +0000 (02:24 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Thu, 29 Jun 2006 17:26:23 +0000 (10:26 -0700)
Add ->retrigger() irq op to consolidate hw_irq_resend() implementations.
(Most architectures had it defined to NOP anyway.)

NOTE: ia64 needs testing. i386 and x86_64 tested.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
21 files changed:
arch/i386/kernel/io_apic.c
arch/ia64/kernel/irq_lsapic.c
arch/ia64/kernel/perfmon.c
arch/parisc/kernel/irq.c
arch/x86_64/kernel/io_apic.c
include/asm-alpha/hw_irq.h
include/asm-cris/hw_irq.h
include/asm-i386/hw_irq.h
include/asm-ia64/hw_irq.h
include/asm-m32r/hw_irq.h
include/asm-mips/hw_irq.h
include/asm-parisc/hw_irq.h
include/asm-powerpc/hw_irq.h
include/asm-sh/hw_irq.h
include/asm-sh64/hw_irq.h
include/asm-um/hw_irq.h
include/asm-v850/hw_irq.h
include/asm-x86_64/hw_irq.h
include/asm-xtensa/hw_irq.h
include/linux/irq.h
kernel/irq/manage.c

index afe54f257cb80b65b977ba27546053feaa37c5c0..ec9ea0269d367fb8c346b883f809ba40d7621b0d 100644 (file)
@@ -2071,6 +2071,13 @@ static void set_ioapic_affinity_vector (unsigned int vector,
 #endif
 #endif
 
+static int ioapic_retrigger(unsigned int irq)
+{
+       send_IPI_self(IO_APIC_VECTOR(irq));
+
+       return 1;
+}
+
 /*
  * Level and edge triggered IO-APIC interrupts need different handling,
  * so we use two separate IRQ descriptors. Edge triggered IRQs can be
@@ -2090,6 +2097,7 @@ static struct hw_interrupt_type ioapic_edge_type __read_mostly = {
 #ifdef CONFIG_SMP
        .set_affinity   = set_ioapic_affinity,
 #endif
+       .retrigger      = ioapic_retrigger,
 };
 
 static struct hw_interrupt_type ioapic_level_type __read_mostly = {
@@ -2103,6 +2111,7 @@ static struct hw_interrupt_type ioapic_level_type __read_mostly = {
 #ifdef CONFIG_SMP
        .set_affinity   = set_ioapic_affinity,
 #endif
+       .retrigger      = ioapic_retrigger,
 };
 
 static inline void init_IO_APIC_traps(void)
index ea14e6a04409636c62813048504cf77e3ef57949..1ab58b09f3d7163df640f5765efd7d8d3a020c02 100644 (file)
@@ -26,6 +26,13 @@ lsapic_noop (unsigned int irq)
        /* nuthing to do... */
 }
 
+static int lsapic_retrigger(unsigned int irq)
+{
+       ia64_resend_irq(irq);
+
+       return 1;
+}
+
 struct hw_interrupt_type irq_type_ia64_lsapic = {
        .typename =     "LSAPIC",
        .startup =      lsapic_noop_startup,
@@ -33,5 +40,6 @@ struct hw_interrupt_type irq_type_ia64_lsapic = {
        .enable =       lsapic_noop,
        .disable =      lsapic_noop,
        .ack =          lsapic_noop,
-       .end =          lsapic_noop
+       .end =          lsapic_noop,
+       .retrigger =    lsapic_retrigger,
 };
index 6d7bc8ff7b3afff19b3781cdaa91a18d27268772..a0055d3d695c81d2ba042dcbe54d831ffd82a42b 100644 (file)
@@ -6165,7 +6165,7 @@ pfm_load_regs (struct task_struct *task)
                /*
                 * will replay the PMU interrupt
                 */
-               if (need_irq_resend) hw_resend_irq(NULL, IA64_PERFMON_VECTOR);
+               if (need_irq_resend) ia64_resend_irq(IA64_PERFMON_VECTOR);
 
                pfm_stats[smp_processor_id()].pfm_replay_ovfl_intr_count++;
        }
@@ -6305,7 +6305,7 @@ pfm_load_regs (struct task_struct *task)
                /*
                 * will replay the PMU interrupt
                 */
-               if (need_irq_resend) hw_resend_irq(NULL, IA64_PERFMON_VECTOR);
+               if (need_irq_resend) ia64_resend_irq(IA64_PERFMON_VECTOR);
 
                pfm_stats[smp_processor_id()].pfm_replay_ovfl_intr_count++;
        }
index ea6a55e1a0c5bb831dc7211632e19ca9aae5dffc..82fe6ba29727a6824bd4a83e5fef44322239f08f 100644 (file)
@@ -125,6 +125,10 @@ static struct hw_interrupt_type cpu_interrupt_type = {
 #ifdef CONFIG_SMP
        .set_affinity   = cpu_set_affinity_irq,
 #endif
+       /* XXX: Needs to be written.  We managed without it so far, but
+        * we really ought to write it.
+        */
+       .retrigger      = NULL,
 };
 
 int show_interrupts(struct seq_file *p, void *v)
@@ -404,13 +408,6 @@ void __init init_IRQ(void)
 
 }
 
-void hw_resend_irq(struct hw_interrupt_type *type, unsigned int irq)
-{
-       /* XXX: Needs to be written.  We managed without it so far, but
-        * we really ought to write it.
-        */
-}
-
 void ack_bad_irq(unsigned int irq)
 {
        printk("unexpected IRQ %d\n", irq);
index 88a8736eb8ce81f6fd7cf9cfad722231a1bff3f0..401b687fef21b2f4736c6a79d3f51b1fa1ac99b8 100644 (file)
@@ -1618,6 +1618,13 @@ static void set_ioapic_affinity_vector (unsigned int vector,
 #endif // CONFIG_SMP
 #endif // CONFIG_PCI_MSI
 
+static int ioapic_retrigger(unsigned int irq)
+{
+       send_IPI_self(IO_APIC_VECTOR(irq));
+
+       return 1;
+}
+
 /*
  * Level and edge triggered IO-APIC interrupts need different handling,
  * so we use two separate IRQ descriptors. Edge triggered IRQs can be
@@ -1638,6 +1645,7 @@ static struct hw_interrupt_type ioapic_edge_type __read_mostly = {
 #ifdef CONFIG_SMP
        .set_affinity = set_ioapic_affinity,
 #endif
+       .retrigger      = ioapic_retrigger,
 };
 
 static struct hw_interrupt_type ioapic_level_type __read_mostly = {
@@ -1651,6 +1659,7 @@ static struct hw_interrupt_type ioapic_level_type __read_mostly = {
 #ifdef CONFIG_SMP
        .set_affinity = set_ioapic_affinity,
 #endif
+       .retrigger      = ioapic_retrigger,
 };
 
 static inline void init_IO_APIC_traps(void)
index ca9d43b6350276b1bf07e675907033b52690a9e8..a37db0f95092f495a02819a7382631c34b686c37 100644 (file)
@@ -2,8 +2,6 @@
 #define _ALPHA_HW_IRQ_H
 
 
-static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) {}
-
 extern volatile unsigned long irq_err_count;
 
 #ifdef CONFIG_ALPHA_GENERIC
index 341536a234e9ccd4e62cd4de8174821c450f4b5c..298066020af212a98a26c15b82b65401832ac151 100644 (file)
@@ -1,7 +1,5 @@
 #ifndef _ASM_HW_IRQ_H
 #define _ASM_HW_IRQ_H
 
-static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) {}
-
 #endif
 
index a4c0a5a9ffd84cd4a5c18eab814dc89f08cb69f8..87e5a351d8812b369bf1fc88187214d947d87fa9 100644 (file)
@@ -69,14 +69,4 @@ extern atomic_t irq_mis_count;
 
 #define IO_APIC_IRQ(x) (((x) >= 16) || ((1<<(x)) & io_apic_irqs))
 
-#if defined(CONFIG_X86_IO_APIC)
-static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i)
-{
-       if (IO_APIC_IRQ(i))
-               send_IPI_self(IO_APIC_VECTOR(i));
-}
-#else
-static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) {}
-#endif
-
 #endif /* _ASM_HW_IRQ_H */
index ea8b8c407ab4a210f50b055c2030cb34222fdca0..27f9df6b914539401c26421ce0bb38d970ef0081 100644 (file)
@@ -97,8 +97,7 @@ extern int reserve_irq_vector (int vector);
 extern void ia64_send_ipi (int cpu, int vector, int delivery_mode, int redirect);
 extern void register_percpu_irq (ia64_vector vec, struct irqaction *action);
 
-static inline void
-hw_resend_irq (struct hw_interrupt_type *h, unsigned int vector)
+static inline void ia64_resend_irq(unsigned int vector)
 {
        platform_send_ipi(smp_processor_id(), vector, IA64_IPI_DM_INT, 0);
 }
index 8d7e9d0e09e876329089bc7401c662430dc78ae2..7138537cda03017c2bce4cb15f1a7a7380a82a2a 100644 (file)
@@ -1,9 +1,4 @@
 #ifndef _ASM_M32R_HW_IRQ_H
 #define _ASM_M32R_HW_IRQ_H
 
-static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i)
-{
-       /* Nothing to do */
-}
-
 #endif /* _ASM_M32R_HW_IRQ_H */
index c854d017c0e5b2090af5b3bdadc56751b839a504..458d9fdc76bf2eed4372a0993dd0ebb0f1b08baa 100644 (file)
@@ -19,9 +19,9 @@ extern void init_8259A(int aeoi);
 
 extern atomic_t irq_err_count;
 
-/* This may not be apropriate for all machines, we'll see ...  */
-static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i)
-{
-}
+/*
+ * interrupt-retrigger: NOP for now. This may not be apropriate for all
+ * machines, we'll see ...
+ */
 
 #endif /* __ASM_HW_IRQ_H */
index 151426e275213c23a6e1afa124fcb681a672e54e..6707f7df3921f566e044bb39ea0c31b95154f290 100644 (file)
@@ -3,15 +3,6 @@
 
 /*
  *     linux/include/asm/hw_irq.h
- *
- *     (C) 1992, 1993 Linus Torvalds, (C) 1997 Ingo Molnar
- *
- *     moved some of the old arch/i386/kernel/irq.h to here. VY
- *
- *     IRQ/IPI changes taken from work by Thomas Radke
- *     <tomsoft@informatik.tu-chemnitz.de>
  */
 
-extern void hw_resend_irq(struct hw_interrupt_type *, unsigned int);
-
 #endif
index a27ed3feb315fa9476669a5e2188031e6046a147..d40359204abaa1ff38743c718a72e40ba22d3f96 100644 (file)
@@ -102,11 +102,11 @@ static inline void local_irq_save_ptr(unsigned long *flags)
                        desc->chip->ack(irq);           \
        })
 
-/* Should we handle this via lost interrupts and IPIs or should we don't care like
- * we do now ? --BenH.
+/*
+ * interrupt-retrigger: should we handle this via lost interrupts and IPIs
+ * or should we not care like we do now ? --BenH.
  */
 struct hw_interrupt_type;
-static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) {}
 
 #endif /* __KERNEL__ */
 #endif /* _ASM_POWERPC_HW_IRQ_H */
index 1d934fb2c581c69ac6b6fe7906af5adc010a2f01..fed26616967a03979d0d6ea6e7c14d1d6a446f97 100644 (file)
@@ -1,9 +1,4 @@
 #ifndef __ASM_SH_HW_IRQ_H
 #define __ASM_SH_HW_IRQ_H
 
-static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i)
-{
-       /* Nothing to do */
-}
-
 #endif /* __ASM_SH_HW_IRQ_H */
index ae718d1f2d6cc90d416284453c5c01cdbfb652dd..ebb39089b0acf3be7f39841243447e3b94427a07 100644 (file)
@@ -11,6 +11,5 @@
  * Copyright (C) 2000, 2001  Paolo Alberelli
  *
  */
-static __inline__ void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) { /* Nothing to do */ }
 
 #endif /* __ASM_SH64_HW_IRQ_H */
index 4ee38c0b6a64c0378c110cf7beb9d2aeeebfeae6..1cf84cf5f21af301596b5439289e1183071e2661 100644 (file)
@@ -4,7 +4,4 @@
 #include "asm/irq.h"
 #include "asm/archparam.h"
 
-static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i)
-{}
-
 #endif
index a8aab4342712a77a7e1f2ac49ae8b536fb270d40..043e94bb6bd8e51f0c94dd6473c92d00e4f86a99 100644 (file)
@@ -1,8 +1,4 @@
 #ifndef __V850_HW_IRQ_H__
 #define __V850_HW_IRQ_H__
 
-static inline void hw_resend_irq (struct hw_interrupt_type *h, unsigned int i)
-{
-}
-
 #endif /* __V850_HW_IRQ_H__ */
index 931877462788473f71d39b04198dfa56986d79eb..48a4a5364e85ddfc651c6716e0cf54deeac21df2 100644 (file)
@@ -127,15 +127,6 @@ __asm__( \
        "push $~(" #nr ") ; " \
        "jmp common_interrupt");
 
-#if defined(CONFIG_X86_IO_APIC)
-static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) {
-       if (IO_APIC_IRQ(i))
-               send_IPI_self(IO_APIC_VECTOR(i));
-}
-#else
-static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) {}
-#endif
-
 #define platform_legacy_irq(irq)       ((irq) < 16)
 
 #endif
index ccf436249eaaa90f66c6d746701bcce74f1f01ad..3ddbea759b2bc32be0839976e1d582b23f90fdfe 100644 (file)
@@ -11,8 +11,4 @@
 #ifndef _XTENSA_HW_IRQ_H
 #define _XTENSA_HW_IRQ_H
 
-static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i)
-{
-}
-
 #endif
index 519a1cb7c33100af73aa914825400115e76e0eb8..e58cfb9c66a3f630a27089e989838adc96c9e097 100644 (file)
@@ -53,6 +53,8 @@ struct hw_interrupt_type {
        void            (*ack)(unsigned int irq);
        void            (*end)(unsigned int irq);
        void            (*set_affinity)(unsigned int irq, cpumask_t dest);
+       int             (*retrigger)(unsigned int irq);
+
        /* Currently used only by UML, might disappear one day.*/
 #ifdef CONFIG_IRQ_RELEASE_METHOD
        void            (*release)(unsigned int irq, void *dev_id);
index 76c8eda67295ceaafec8a38cc398b53057495350..19b438e09f1243ee6693b175544ba96d1b8a129d 100644 (file)
@@ -123,7 +123,8 @@ void enable_irq(unsigned int irq)
                desc->status = status;
                if ((status & (IRQ_PENDING | IRQ_REPLAY)) == IRQ_PENDING) {
                        desc->status = status | IRQ_REPLAY;
-                       hw_resend_irq(desc->chip,irq);
+                       if (desc->chip && desc->chip->retrigger)
+                               desc->chip->retrigger(irq);
                }
                desc->chip->enable(irq);
                /* fall-through */