irq: update all arches for new irq_desc
[linux-2.6.git] / arch / blackfin / kernel / irqchip.c
index 462ae41..5780d6d 100644 (file)
@@ -36,7 +36,7 @@
 #include <linux/irq.h>
 #include <asm/trace.h>
 
-static unsigned long irq_err_count;
+static atomic_t irq_err_count;
 static spinlock_t irq_controller_lock;
 
 /*
@@ -48,10 +48,9 @@ void dummy_mask_unmask_irq(unsigned int irq)
 
 void ack_bad_irq(unsigned int irq)
 {
-       irq_err_count += 1;
+       atomic_inc(&irq_err_count);
        printk(KERN_ERR "IRQ: spurious interrupt %d\n", irq);
 }
-EXPORT_SYMBOL(ack_bad_irq);
 
 static struct irq_chip bad_chip = {
        .ack = dummy_mask_unmask_irq,
@@ -60,14 +59,24 @@ static struct irq_chip bad_chip = {
 };
 
 static struct irq_desc bad_irq_desc = {
+       .status = IRQ_DISABLED,
        .chip = &bad_chip,
        .handle_irq = handle_bad_irq,
        .depth = 1,
+       .lock = __SPIN_LOCK_UNLOCKED(irq_desc->lock),
+#ifdef CONFIG_SMP
+       .affinity = CPU_MASK_ALL
+#endif
 };
 
+#ifdef CONFIG_CPUMASK_OFFSTACK
+/* We are not allocating a variable-sized bad_irq_desc.affinity */
+#error "Blackfin architecture does not support CONFIG_CPUMASK_OFFSTACK."
+#endif
+
 int show_interrupts(struct seq_file *p, void *v)
 {
-       int i = *(loff_t *) v;
+       int i = *(loff_t *) v, j;
        struct irqaction *action;
        unsigned long flags;
 
@@ -75,19 +84,20 @@ int show_interrupts(struct seq_file *p, void *v)
                spin_lock_irqsave(&irq_desc[i].lock, flags);
                action = irq_desc[i].action;
                if (!action)
-                       goto unlock;
-
-               seq_printf(p, "%3d: %10u ", i, kstat_irqs(i));
+                       goto skip;
+               seq_printf(p, "%3d: ", i);
+               for_each_online_cpu(j)
+                       seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
+               seq_printf(p, " %8s", irq_desc[i].chip->name);
                seq_printf(p, "  %s", action->name);
                for (action = action->next; action; action = action->next)
-                       seq_printf(p, ", %s", action->name);
+                       seq_printf(p, "  %s", action->name);
 
                seq_putc(p, '\n');
- unlock:
+ skip:
                spin_unlock_irqrestore(&irq_desc[i].lock, flags);
-       } else if (i == NR_IRQS) {
-               seq_printf(p, "Err: %10lu\n", irq_err_count);
-       }
+       } else if (i == NR_IRQS)
+               seq_printf(p, "Err: %10u\n",  atomic_read(&irq_err_count));
        return 0;
 }
 
@@ -96,17 +106,16 @@ int show_interrupts(struct seq_file *p, void *v)
  * come via this function.  Instead, they should provide their
  * own 'handler'
  */
-
 #ifdef CONFIG_DO_IRQ_L1
-asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs)__attribute__((l1_text));
+__attribute__((l1_text))
 #endif
-
 asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs)
 {
        struct pt_regs *old_regs;
        struct irq_desc *desc = irq_desc + irq;
+#ifndef CONFIG_IPIPE
        unsigned short pending, other_ints;
-
+#endif
        old_regs = set_irq_regs(regs);
 
        /*
@@ -117,9 +126,24 @@ asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs)
                desc = &bad_irq_desc;
 
        irq_enter();
-
+#ifdef CONFIG_DEBUG_STACKOVERFLOW
+       /* Debugging check for stack overflow: is there less than STACK_WARN free? */
+       {
+               long sp;
+
+               sp = __get_SP() & (THREAD_SIZE-1);
+
+               if (unlikely(sp < (sizeof(struct thread_info) + STACK_WARN))) {
+                       dump_stack();
+                       printk(KERN_EMERG "%s: possible stack overflow while handling irq %i "
+                                       " only %ld bytes free\n",
+                               __func__, irq, sp - sizeof(struct thread_info));
+               }
+       }
+#endif
        generic_handle_irq(irq);
 
+#ifndef CONFIG_IPIPE   /* Useless and bugous over the I-pipe: IRQs are threaded. */
        /* If we're the only interrupt running (ignoring IRQ15 which is for
           syscalls), lower our priority to IRQ14 so that softirqs run at
           that level.  If there's another, lower-level interrupt, irq_exit
@@ -129,6 +153,7 @@ asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs)
        other_ints = pending & (pending - 1);
        if (other_ints == 0)
                lower_to_irq14();
+#endif /* !CONFIG_IPIPE */
        irq_exit();
 
        set_irq_regs(old_regs);