diff options
Diffstat (limited to 'arch/blackfin/kernel/irqchip.c')
-rw-r--r-- | arch/blackfin/kernel/irqchip.c | 46 |
1 files changed, 31 insertions, 15 deletions
diff --git a/arch/blackfin/kernel/irqchip.c b/arch/blackfin/kernel/irqchip.c index 07402f57c9de..ab8209cbbad0 100644 --- a/arch/blackfin/kernel/irqchip.c +++ b/arch/blackfin/kernel/irqchip.c | |||
@@ -36,7 +36,7 @@ | |||
36 | #include <linux/irq.h> | 36 | #include <linux/irq.h> |
37 | #include <asm/trace.h> | 37 | #include <asm/trace.h> |
38 | 38 | ||
39 | static unsigned long irq_err_count; | 39 | static atomic_t irq_err_count; |
40 | static spinlock_t irq_controller_lock; | 40 | static spinlock_t irq_controller_lock; |
41 | 41 | ||
42 | /* | 42 | /* |
@@ -48,10 +48,9 @@ void dummy_mask_unmask_irq(unsigned int irq) | |||
48 | 48 | ||
49 | void ack_bad_irq(unsigned int irq) | 49 | void ack_bad_irq(unsigned int irq) |
50 | { | 50 | { |
51 | irq_err_count += 1; | 51 | atomic_inc(&irq_err_count); |
52 | printk(KERN_ERR "IRQ: spurious interrupt %d\n", irq); | 52 | printk(KERN_ERR "IRQ: spurious interrupt %d\n", irq); |
53 | } | 53 | } |
54 | EXPORT_SYMBOL(ack_bad_irq); | ||
55 | 54 | ||
56 | static struct irq_chip bad_chip = { | 55 | static struct irq_chip bad_chip = { |
57 | .ack = dummy_mask_unmask_irq, | 56 | .ack = dummy_mask_unmask_irq, |
@@ -72,7 +71,7 @@ static struct irq_desc bad_irq_desc = { | |||
72 | 71 | ||
73 | int show_interrupts(struct seq_file *p, void *v) | 72 | int show_interrupts(struct seq_file *p, void *v) |
74 | { | 73 | { |
75 | int i = *(loff_t *) v; | 74 | int i = *(loff_t *) v, j; |
76 | struct irqaction *action; | 75 | struct irqaction *action; |
77 | unsigned long flags; | 76 | unsigned long flags; |
78 | 77 | ||
@@ -80,19 +79,20 @@ int show_interrupts(struct seq_file *p, void *v) | |||
80 | spin_lock_irqsave(&irq_desc[i].lock, flags); | 79 | spin_lock_irqsave(&irq_desc[i].lock, flags); |
81 | action = irq_desc[i].action; | 80 | action = irq_desc[i].action; |
82 | if (!action) | 81 | if (!action) |
83 | goto unlock; | 82 | goto skip; |
84 | 83 | seq_printf(p, "%3d: ", i); | |
85 | seq_printf(p, "%3d: %10u ", i, kstat_irqs(i)); | 84 | for_each_online_cpu(j) |
85 | seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]); | ||
86 | seq_printf(p, " %8s", irq_desc[i].chip->name); | ||
86 | seq_printf(p, " %s", action->name); | 87 | seq_printf(p, " %s", action->name); |
87 | for (action = action->next; action; action = action->next) | 88 | for (action = action->next; action; action = action->next) |
88 | seq_printf(p, ", %s", action->name); | 89 | seq_printf(p, " %s", action->name); |
89 | 90 | ||
90 | seq_putc(p, '\n'); | 91 | seq_putc(p, '\n'); |
91 | unlock: | 92 | skip: |
92 | spin_unlock_irqrestore(&irq_desc[i].lock, flags); | 93 | spin_unlock_irqrestore(&irq_desc[i].lock, flags); |
93 | } else if (i == NR_IRQS) { | 94 | } else if (i == NR_IRQS) |
94 | seq_printf(p, "Err: %10lu\n", irq_err_count); | 95 | seq_printf(p, "Err: %10u\n", atomic_read(&irq_err_count)); |
95 | } | ||
96 | return 0; | 96 | return 0; |
97 | } | 97 | } |
98 | 98 | ||
@@ -101,7 +101,6 @@ int show_interrupts(struct seq_file *p, void *v) | |||
101 | * come via this function. Instead, they should provide their | 101 | * come via this function. Instead, they should provide their |
102 | * own 'handler' | 102 | * own 'handler' |
103 | */ | 103 | */ |
104 | |||
105 | #ifdef CONFIG_DO_IRQ_L1 | 104 | #ifdef CONFIG_DO_IRQ_L1 |
106 | __attribute__((l1_text)) | 105 | __attribute__((l1_text)) |
107 | #endif | 106 | #endif |
@@ -109,8 +108,9 @@ asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs) | |||
109 | { | 108 | { |
110 | struct pt_regs *old_regs; | 109 | struct pt_regs *old_regs; |
111 | struct irq_desc *desc = irq_desc + irq; | 110 | struct irq_desc *desc = irq_desc + irq; |
111 | #ifndef CONFIG_IPIPE | ||
112 | unsigned short pending, other_ints; | 112 | unsigned short pending, other_ints; |
113 | 113 | #endif | |
114 | old_regs = set_irq_regs(regs); | 114 | old_regs = set_irq_regs(regs); |
115 | 115 | ||
116 | /* | 116 | /* |
@@ -121,9 +121,24 @@ asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs) | |||
121 | desc = &bad_irq_desc; | 121 | desc = &bad_irq_desc; |
122 | 122 | ||
123 | irq_enter(); | 123 | irq_enter(); |
124 | 124 | #ifdef CONFIG_DEBUG_STACKOVERFLOW | |
125 | /* Debugging check for stack overflow: is there less than STACK_WARN free? */ | ||
126 | { | ||
127 | long sp; | ||
128 | |||
129 | sp = __get_SP() & (THREAD_SIZE-1); | ||
130 | |||
131 | if (unlikely(sp < (sizeof(struct thread_info) + STACK_WARN))) { | ||
132 | dump_stack(); | ||
133 | printk(KERN_EMERG "%s: possible stack overflow while handling irq %i " | ||
134 | " only %ld bytes free\n", | ||
135 | __func__, irq, sp - sizeof(struct thread_info)); | ||
136 | } | ||
137 | } | ||
138 | #endif | ||
125 | generic_handle_irq(irq); | 139 | generic_handle_irq(irq); |
126 | 140 | ||
141 | #ifndef CONFIG_IPIPE /* Useless and bugous over the I-pipe: IRQs are threaded. */ | ||
127 | /* If we're the only interrupt running (ignoring IRQ15 which is for | 142 | /* If we're the only interrupt running (ignoring IRQ15 which is for |
128 | syscalls), lower our priority to IRQ14 so that softirqs run at | 143 | syscalls), lower our priority to IRQ14 so that softirqs run at |
129 | that level. If there's another, lower-level interrupt, irq_exit | 144 | that level. If there's another, lower-level interrupt, irq_exit |
@@ -133,6 +148,7 @@ asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs) | |||
133 | other_ints = pending & (pending - 1); | 148 | other_ints = pending & (pending - 1); |
134 | if (other_ints == 0) | 149 | if (other_ints == 0) |
135 | lower_to_irq14(); | 150 | lower_to_irq14(); |
151 | #endif /* !CONFIG_IPIPE */ | ||
136 | irq_exit(); | 152 | irq_exit(); |
137 | 153 | ||
138 | set_irq_regs(old_regs); | 154 | set_irq_regs(old_regs); |