irq: update all arches for new irq_desc, fix
authorMike Travis <travis@sgi.com>
Wed, 14 Jan 2009 23:43:54 +0000 (15:43 -0800)
committerIngo Molnar <mingo@elte.hu>
Thu, 15 Jan 2009 10:15:36 +0000 (11:15 +0100)
Impact: fix build errors

Since the SPARSE IRQS changes redefined how the kstat irqs are
organized, arch's must use the new accessor function:

kstat_incr_irqs_this_cpu(irq, DESC);

If CONFIG_SPARSE_IRQS is set, then DESC is a pointer to the
irq_desc which has a pointer to the kstat_irqs.  If not, then
the .irqs field of struct kernel_stat is used instead.

Signed-off-by: Mike Travis <travis@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/ia64/kernel/irq_ia64.c
arch/mips/kernel/smtc.c
arch/mips/sgi-ip22/ip22-int.c
arch/mips/sgi-ip22/ip22-time.c
arch/mips/sibyte/bcm1480/smp.c
arch/mips/sibyte/sb1250/smp.c
arch/mn10300/kernel/mn10300-watchdog.c
arch/sparc/kernel/time_64.c

index 28d3d483db9203e32ce3e642130c966194660403..927ad027820c5476ac9403477251e06107054696 100644 (file)
@@ -493,11 +493,13 @@ ia64_handle_irq (ia64_vector vector, struct pt_regs *regs)
        saved_tpr = ia64_getreg(_IA64_REG_CR_TPR);
        ia64_srlz_d();
        while (vector != IA64_SPURIOUS_INT_VECTOR) {
+               struct irq_desc *desc = irq_to_desc(vector);
+
                if (unlikely(IS_LOCAL_TLB_FLUSH(vector))) {
                        smp_local_flush_tlb();
-                       kstat_this_cpu.irqs[vector]++;
+                       kstat_incr_irqs_this_cpu(vector, desc);
                } else if (unlikely(IS_RESCHEDULE(vector)))
-                       kstat_this_cpu.irqs[vector]++;
+                       kstat_incr_irqs_this_cpu(vector, desc);
                else {
                        int irq = local_vector_to_irq(vector);
 
@@ -551,11 +553,13 @@ void ia64_process_pending_intr(void)
          * Perform normal interrupt style processing
          */
        while (vector != IA64_SPURIOUS_INT_VECTOR) {
+               struct irq_desc *desc = irq_to_desc(vector);
+
                if (unlikely(IS_LOCAL_TLB_FLUSH(vector))) {
                        smp_local_flush_tlb();
-                       kstat_this_cpu.irqs[vector]++;
+                       kstat_incr_irqs_this_cpu(vector, desc);
                } else if (unlikely(IS_RESCHEDULE(vector)))
-                       kstat_this_cpu.irqs[vector]++;
+                       kstat_incr_irqs_this_cpu(vector, desc);
                else {
                        struct pt_regs *old_regs = set_irq_regs(NULL);
                        int irq = local_vector_to_irq(vector);
index d2c1ab12425ad0b8e55ade490a7813319081071c..5f5af7d4c890791929291b35c2f0371484d34657 100644 (file)
@@ -921,11 +921,13 @@ void ipi_decode(struct smtc_ipi *pipi)
        struct clock_event_device *cd;
        void *arg_copy = pipi->arg;
        int type_copy = pipi->type;
+       int irq = MIPS_CPU_IRQ_BASE + 1;
+
        smtc_ipi_nq(&freeIPIq, pipi);
        switch (type_copy) {
        case SMTC_CLOCK_TICK:
                irq_enter();
-               kstat_this_cpu.irqs[MIPS_CPU_IRQ_BASE + 1]++;
+               kstat_incr_irqs_this_cpu(irq, irq_to_desc(irq));
                cd = &per_cpu(mips_clockevent_device, cpu);
                cd->event_handler(cd);
                irq_exit();
index f8b18af141a19c5e82ee6c4c543f533dec0bea9a..0ecd5fe9486ee183e750c014f6d2cfb3283bff9a 100644 (file)
@@ -155,7 +155,7 @@ static void indy_buserror_irq(void)
        int irq = SGI_BUSERR_IRQ;
 
        irq_enter();
-       kstat_this_cpu.irqs[irq]++;
+       kstat_incr_irqs_this_cpu(irq, irq_to_desc(irq));
        ip22_be_interrupt(irq);
        irq_exit();
 }
index 3dcb27ec0c530b7aa4238bc4eb2cd568cd9fc794..c8f7d2328b2425daf81a06cd07670be594e7affa 100644 (file)
@@ -122,7 +122,7 @@ void indy_8254timer_irq(void)
        char c;
 
        irq_enter();
-       kstat_this_cpu.irqs[irq]++;
+       kstat_incr_irqs_this_cpu(irq, irq_to_desc(irq));
        printk(KERN_ALERT "Oops, got 8254 interrupt.\n");
        ArcRead(0, &c, 1, &cnt);
        ArcEnterInteractiveMode();
index dddfda8e829461e8297ab44cfad6501e34641ca3..314691648c97b5fe4ff0122ed1f46f3239809d29 100644 (file)
@@ -178,9 +178,10 @@ struct plat_smp_ops bcm1480_smp_ops = {
 void bcm1480_mailbox_interrupt(void)
 {
        int cpu = smp_processor_id();
+       int irq = K_BCM1480_INT_MBOX_0_0;
        unsigned int action;
 
-       kstat_this_cpu.irqs[K_BCM1480_INT_MBOX_0_0]++;
+       kstat_incr_irqs_this_cpu(irq, irq_to_desc(irq));
        /* Load the mailbox register to figure out what we're supposed to do */
        action = (__raw_readq(mailbox_0_regs[cpu]) >> 48) & 0xffff;
 
index 5950a288a7daab17939664417fadacd68ca28d7b..cad14003b84f2efc4a0fb746df799597af7e6f90 100644 (file)
@@ -166,9 +166,10 @@ struct plat_smp_ops sb_smp_ops = {
 void sb1250_mailbox_interrupt(void)
 {
        int cpu = smp_processor_id();
+       int irq = K_INT_MBOX_0;
        unsigned int action;
 
-       kstat_this_cpu.irqs[K_INT_MBOX_0]++;
+       kstat_incr_irqs_this_cpu(irq, irq_to_desc(irq));
        /* Load the mailbox register to figure out what we're supposed to do */
        action = (____raw_readq(mailbox_regs[cpu]) >> 48) & 0xffff;
 
index 10811e981d20fd397792151bc3c7693471368da4..2e370d88a87a22d7302f6dd386bf85a7dbe2ae97 100644 (file)
@@ -130,6 +130,7 @@ void watchdog_interrupt(struct pt_regs *regs, enum exception_code excep)
         * the stack NMI-atomically, it's safe to use smp_processor_id().
         */
        int sum, cpu = smp_processor_id();
+       int irq = NMIIRQ;
        u8 wdt, tmp;
 
        wdt = WDCTR & ~WDCTR_WDCNE;
@@ -138,7 +139,7 @@ void watchdog_interrupt(struct pt_regs *regs, enum exception_code excep)
        NMICR = NMICR_WDIF;
 
        nmi_count(cpu)++;
-       kstat_this_cpu.irqs[NMIIRQ]++;
+       kstat_incr_irqs_this_cpu(irq, irq_to_desc(irq));
        sum = irq_stat[cpu].__irq_count;
 
        if (last_irq_sums[cpu] == sum) {
index 54405d3621484c1c7035efe572bf0b0c902fb3f2..28b48f3eb256cca2548ce547f13304f9d966384b 100644 (file)
@@ -727,7 +727,7 @@ void timer_interrupt(int irq, struct pt_regs *regs)
 
        irq_enter();
 
-       kstat_this_cpu.irqs[0]++;
+       kstat_incr_irqs_this_cpu(0, irq_to_desc(0));
 
        if (unlikely(!evt->event_handler)) {
                printk(KERN_WARNING