Merge branch 'genirq' of master.kernel.org:/home/rmk/linux-2.6-arm

* 'genirq' of master.kernel.org:/home/rmk/linux-2.6-arm: (24 commits)
[ARM] 3683/2: ARM: Convert at91rm9200 to generic irq handling
[ARM] 3682/2: ARM: Convert ixp4xx to generic irq handling
[ARM] 3702/1: ARM: Convert ixp23xx to generic irq handling
[ARM] 3701/1: ARM: Convert plat-omap to generic irq handling
[ARM] 3700/1: ARM: Convert lh7a40x to generic irq handling
[ARM] 3699/1: ARM: Convert s3c2410 to generic irq handling
[ARM] 3698/1: ARM: Convert sa1100 to generic irq handling
[ARM] 3697/1: ARM: Convert shark to generic irq handling
[ARM] 3696/1: ARM: Convert clps711x to generic irq handling
[ARM] 3694/1: ARM: Convert ecard driver to generic irq handling
[ARM] 3693/1: ARM: Convert omap1 to generic irq handling
[ARM] 3691/1: ARM: Convert imx to generic irq handling
[ARM] 3688/1: ARM: Convert clps7500 to generic irq handling
[ARM] 3687/1: ARM: Convert integrator to generic irq handling
[ARM] 3685/1: ARM: Convert pxa to generic irq handling
[ARM] 3684/1: ARM: Convert l7200 to generic irq handling
[ARM] 3681/1: ARM: Convert ixp2000 to generic irq handling
[ARM] 3680/1: ARM: Convert footbridge to generic irq handling
[ARM] 3695/1: ARM drivers/pcmcia: Fixup includes
[ARM] 3689/1: ARM drivers/input/touchscreen: Fixup includes
...

Manual conflict resolved in kernel/irq/handle.c (butt-ugly ARM tickless
code).

+208 -1082
+12
arch/arm/Kconfig
··· 47 <file:Documentation/mca.txt> (and especially the web page given 48 there) before attempting to build an MCA bus kernel. 49 50 config RWSEM_GENERIC_SPINLOCK 51 bool 52 default y
··· 47 <file:Documentation/mca.txt> (and especially the web page given 48 there) before attempting to build an MCA bus kernel. 49 50 + config GENERIC_HARDIRQS 51 + bool 52 + default y 53 + 54 + config HARDIRQS_SW_RESEND 55 + bool 56 + default y 57 + 58 + config GENERIC_IRQ_PROBE 59 + bool 60 + default y 61 + 62 config RWSEM_GENERIC_SPINLOCK 63 bool 64 default y
+16 -2
arch/arm/common/gic.c
··· 33 34 static void __iomem *gic_dist_base; 35 static void __iomem *gic_cpu_base; 36 37 /* 38 * Routines to acknowledge, disable and enable interrupts ··· 53 static void gic_ack_irq(unsigned int irq) 54 { 55 u32 mask = 1 << (irq % 32); 56 writel(mask, gic_dist_base + GIC_DIST_ENABLE_CLEAR + (irq / 32) * 4); 57 writel(irq, gic_cpu_base + GIC_CPU_EOI); 58 } 59 60 static void gic_mask_irq(unsigned int irq) 61 { 62 u32 mask = 1 << (irq % 32); 63 writel(mask, gic_dist_base + GIC_DIST_ENABLE_CLEAR + (irq / 32) * 4); 64 } 65 66 static void gic_unmask_irq(unsigned int irq) 67 { 68 u32 mask = 1 << (irq % 32); 69 writel(mask, gic_dist_base + GIC_DIST_ENABLE_SET + (irq / 32) * 4); 70 } 71 72 #ifdef CONFIG_SMP 73 - static void gic_set_cpu(struct irqdesc *desc, unsigned int irq, unsigned int cpu) 74 { 75 void __iomem *reg = gic_dist_base + GIC_DIST_TARGET + (irq & ~3); 76 unsigned int shift = (irq % 4) * 8; 77 u32 val; 78 79 val = readl(reg) & ~(0xff << shift); 80 val |= 1 << (cpu + shift); 81 writel(val, reg); 82 } 83 #endif 84 ··· 100 .mask = gic_mask_irq, 101 .unmask = gic_unmask_irq, 102 #ifdef CONFIG_SMP 103 - .set_cpu = gic_set_cpu, 104 #endif 105 }; 106
··· 33 34 static void __iomem *gic_dist_base; 35 static void __iomem *gic_cpu_base; 36 + static DEFINE_SPINLOCK(irq_controller_lock); 37 38 /* 39 * Routines to acknowledge, disable and enable interrupts ··· 52 static void gic_ack_irq(unsigned int irq) 53 { 54 u32 mask = 1 << (irq % 32); 55 + 56 + spin_lock(&irq_controller_lock); 57 writel(mask, gic_dist_base + GIC_DIST_ENABLE_CLEAR + (irq / 32) * 4); 58 writel(irq, gic_cpu_base + GIC_CPU_EOI); 59 + spin_unlock(&irq_controller_lock); 60 } 61 62 static void gic_mask_irq(unsigned int irq) 63 { 64 u32 mask = 1 << (irq % 32); 65 + 66 + spin_lock(&irq_controller_lock); 67 writel(mask, gic_dist_base + GIC_DIST_ENABLE_CLEAR + (irq / 32) * 4); 68 + spin_unlock(&irq_controller_lock); 69 } 70 71 static void gic_unmask_irq(unsigned int irq) 72 { 73 u32 mask = 1 << (irq % 32); 74 + 75 + spin_lock(&irq_controller_lock); 76 writel(mask, gic_dist_base + GIC_DIST_ENABLE_SET + (irq / 32) * 4); 77 + spin_unlock(&irq_controller_lock); 78 } 79 80 #ifdef CONFIG_SMP 81 + static void gic_set_cpu(unsigned int irq, cpumask_t mask_val) 82 { 83 void __iomem *reg = gic_dist_base + GIC_DIST_TARGET + (irq & ~3); 84 unsigned int shift = (irq % 4) * 8; 85 + unsigned int cpu = first_cpu(mask_val); 86 u32 val; 87 88 + spin_lock(&irq_controller_lock); 89 + irq_desc[irq].cpu = cpu; 90 val = readl(reg) & ~(0xff << shift); 91 val |= 1 << (cpu + shift); 92 writel(val, reg); 93 + spin_unlock(&irq_controller_lock); 94 } 95 #endif 96 ··· 86 .mask = gic_mask_irq, 87 .unmask = gic_unmask_irq, 88 #ifdef CONFIG_SMP 89 + .set_affinity = gic_set_cpu, 90 #endif 91 }; 92
+3 -3
arch/arm/common/sa1111.c
··· 150 sa1111_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) 151 { 152 unsigned int stat0, stat1, i; 153 - void __iomem *base = desc->data; 154 155 stat0 = sa1111_readl(base + SA1111_INTSTATCLR0); 156 stat1 = sa1111_readl(base + SA1111_INTSTATCLR1); ··· 168 169 for (i = IRQ_SA1111_START; stat0; i++, stat0 >>= 1) 170 if (stat0 & 1) 171 - do_edge_IRQ(i, irq_desc + i, regs); 172 173 for (i = IRQ_SA1111_START + 32; stat1; i++, stat1 >>= 1) 174 if (stat1 & 1) 175 - do_edge_IRQ(i, irq_desc + i, regs); 176 177 /* For level-based interrupts */ 178 desc->chip->unmask(irq);
··· 150 sa1111_irq_handler(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) 151 { 152 unsigned int stat0, stat1, i; 153 + void __iomem *base = get_irq_data(irq); 154 155 stat0 = sa1111_readl(base + SA1111_INTSTATCLR0); 156 stat1 = sa1111_readl(base + SA1111_INTSTATCLR1); ··· 168 169 for (i = IRQ_SA1111_START; stat0; i++, stat0 >>= 1) 170 if (stat0 & 1) 171 + handle_edge_irq(i, irq_desc + i, regs); 172 173 for (i = IRQ_SA1111_START + 32; stat1; i++, stat1 >>= 1) 174 if (stat1 & 1) 175 + handle_edge_irq(i, irq_desc + i, regs); 176 177 /* For level-based interrupts */ 178 desc->chip->unmask(irq);
+1
arch/arm/common/time-acorn.c
··· 16 #include <linux/timex.h> 17 #include <linux/init.h> 18 #include <linux/interrupt.h> 19 20 #include <asm/hardware.h> 21 #include <asm/io.h>
··· 16 #include <linux/timex.h> 17 #include <linux/init.h> 18 #include <linux/interrupt.h> 19 + #include <linux/irq.h> 20 21 #include <asm/hardware.h> 22 #include <asm/io.h>
+1 -1
arch/arm/kernel/ecard.c
··· 619 ecard_t *ec = slot_to_ecard(slot); 620 621 if (ec->claimed) { 622 - struct irqdesc *d = irqdesc + ec->irq; 623 /* 624 * this ugly code is so that we can operate a 625 * prioritorising system:
··· 619 ecard_t *ec = slot_to_ecard(slot); 620 621 if (ec->claimed) { 622 + struct irq_desc *d = irq_desc + ec->irq; 623 /* 624 * this ugly code is so that we can operate a 625 * prioritorising system:
+1
arch/arm/kernel/fiq.c
··· 38 #include <linux/module.h> 39 #include <linux/kernel.h> 40 #include <linux/init.h> 41 #include <linux/seq_file.h> 42 43 #include <asm/cacheflush.h>
··· 38 #include <linux/module.h> 39 #include <linux/kernel.h> 40 #include <linux/init.h> 41 + #include <linux/interrupt.h> 42 #include <linux/seq_file.h> 43 44 #include <asm/cacheflush.h>
+26 -925
arch/arm/kernel/irq.c
··· 26 #include <linux/signal.h> 27 #include <linux/ioport.h> 28 #include <linux/interrupt.h> 29 #include <linux/ptrace.h> 30 #include <linux/slab.h> 31 #include <linux/random.h> ··· 38 #include <linux/kallsyms.h> 39 #include <linux/proc_fs.h> 40 41 - #include <asm/irq.h> 42 #include <asm/system.h> 43 - #include <asm/mach/irq.h> 44 #include <asm/mach/time.h> 45 - 46 - /* 47 - * Maximum IRQ count. Currently, this is arbitary. However, it should 48 - * not be set too low to prevent false triggering. Conversely, if it 49 - * is set too high, then you could miss a stuck IRQ. 50 - * 51 - * Maybe we ought to set a timer and re-enable the IRQ at a later time? 52 - */ 53 - #define MAX_IRQ_CNT 100000 54 - 55 - static int noirqdebug __read_mostly; 56 - static volatile unsigned long irq_err_count; 57 - static DEFINE_SPINLOCK(irq_controller_lock); 58 - static LIST_HEAD(irq_pending); 59 - 60 - struct irqdesc irq_desc[NR_IRQS]; 61 - void (*init_arch_irq)(void) __initdata = NULL; 62 63 /* 64 * No architecture-specific irq_finish function defined in arm/arch/irqs.h. ··· 48 #define irq_finish(irq) do { } while (0) 49 #endif 50 51 - /* 52 - * Dummy mask/unmask handler 53 - */ 54 - void dummy_mask_unmask_irq(unsigned int irq) 55 - { 56 - } 57 - 58 - irqreturn_t no_action(int irq, void *dev_id, struct pt_regs *regs) 59 - { 60 - return IRQ_NONE; 61 - } 62 - 63 - void do_bad_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) 64 - { 65 - irq_err_count++; 66 - printk(KERN_ERR "IRQ: spurious interrupt %d\n", irq); 67 - } 68 - 69 - static struct irqchip bad_chip = { 70 - .ack = dummy_mask_unmask_irq, 71 - .mask = dummy_mask_unmask_irq, 72 - .unmask = dummy_mask_unmask_irq, 73 - }; 74 - 75 - static struct irqdesc bad_irq_desc = { 76 - .chip = &bad_chip, 77 - .handle = do_bad_IRQ, 78 - .pend = LIST_HEAD_INIT(bad_irq_desc.pend), 79 - .disable_depth = 1, 80 - }; 81 - 82 - #ifdef CONFIG_SMP 83 - void synchronize_irq(unsigned int irq) 84 - { 85 - struct irqdesc *desc = irq_desc + irq; 86 - 87 - while (desc->running) 88 - barrier(); 89 - } 90 - EXPORT_SYMBOL(synchronize_irq); 91 - 92 - #define smp_set_running(desc) do { desc->running = 1; } while (0) 93 - #define smp_clear_running(desc) do { desc->running = 0; } while (0) 94 - #else 95 - #define smp_set_running(desc) do { } while (0) 96 - #define smp_clear_running(desc) do { } while (0) 97 - #endif 98 - 99 - /** 100 - * disable_irq_nosync - disable an irq without waiting 101 - * @irq: Interrupt to disable 102 - * 103 - * Disable the selected interrupt line. Enables and disables 104 - * are nested. We do this lazily. 105 - * 106 - * This function may be called from IRQ context. 107 - */ 108 - void disable_irq_nosync(unsigned int irq) 109 - { 110 - struct irqdesc *desc = irq_desc + irq; 111 - unsigned long flags; 112 - 113 - spin_lock_irqsave(&irq_controller_lock, flags); 114 - desc->disable_depth++; 115 - list_del_init(&desc->pend); 116 - spin_unlock_irqrestore(&irq_controller_lock, flags); 117 - } 118 - EXPORT_SYMBOL(disable_irq_nosync); 119 - 120 - /** 121 - * disable_irq - disable an irq and wait for completion 122 - * @irq: Interrupt to disable 123 - * 124 - * Disable the selected interrupt line. Enables and disables 125 - * are nested. This functions waits for any pending IRQ 126 - * handlers for this interrupt to complete before returning. 127 - * If you use this function while holding a resource the IRQ 128 - * handler may need you will deadlock. 129 - * 130 - * This function may be called - with care - from IRQ context. 131 - */ 132 - void disable_irq(unsigned int irq) 133 - { 134 - struct irqdesc *desc = irq_desc + irq; 135 - 136 - disable_irq_nosync(irq); 137 - if (desc->action) 138 - synchronize_irq(irq); 139 - } 140 - EXPORT_SYMBOL(disable_irq); 141 - 142 - /** 143 - * enable_irq - enable interrupt handling on an irq 144 - * @irq: Interrupt to enable 145 - * 146 - * Re-enables the processing of interrupts on this IRQ line. 147 - * Note that this may call the interrupt handler, so you may 148 - * get unexpected results if you hold IRQs disabled. 149 - * 150 - * This function may be called from IRQ context. 151 - */ 152 - void enable_irq(unsigned int irq) 153 - { 154 - struct irqdesc *desc = irq_desc + irq; 155 - unsigned long flags; 156 - 157 - spin_lock_irqsave(&irq_controller_lock, flags); 158 - if (unlikely(!desc->disable_depth)) { 159 - printk("enable_irq(%u) unbalanced from %p\n", irq, 160 - __builtin_return_address(0)); 161 - } else if (!--desc->disable_depth) { 162 - desc->probing = 0; 163 - desc->chip->unmask(irq); 164 - 165 - /* 166 - * If the interrupt is waiting to be processed, 167 - * try to re-run it. We can't directly run it 168 - * from here since the caller might be in an 169 - * interrupt-protected region. 170 - */ 171 - if (desc->pending && list_empty(&desc->pend)) { 172 - desc->pending = 0; 173 - if (!desc->chip->retrigger || 174 - desc->chip->retrigger(irq)) 175 - list_add(&desc->pend, &irq_pending); 176 - } 177 - } 178 - spin_unlock_irqrestore(&irq_controller_lock, flags); 179 - } 180 - EXPORT_SYMBOL(enable_irq); 181 - 182 - /* 183 - * Enable wake on selected irq 184 - */ 185 - void enable_irq_wake(unsigned int irq) 186 - { 187 - struct irqdesc *desc = irq_desc + irq; 188 - unsigned long flags; 189 - 190 - spin_lock_irqsave(&irq_controller_lock, flags); 191 - if (desc->chip->set_wake) 192 - desc->chip->set_wake(irq, 1); 193 - spin_unlock_irqrestore(&irq_controller_lock, flags); 194 - } 195 - EXPORT_SYMBOL(enable_irq_wake); 196 - 197 - void disable_irq_wake(unsigned int irq) 198 - { 199 - struct irqdesc *desc = irq_desc + irq; 200 - unsigned long flags; 201 - 202 - spin_lock_irqsave(&irq_controller_lock, flags); 203 - if (desc->chip->set_wake) 204 - desc->chip->set_wake(irq, 0); 205 - spin_unlock_irqrestore(&irq_controller_lock, flags); 206 - } 207 - EXPORT_SYMBOL(disable_irq_wake); 208 209 int show_interrupts(struct seq_file *p, void *v) 210 { ··· 69 } 70 71 if (i < NR_IRQS) { 72 - spin_lock_irqsave(&irq_controller_lock, flags); 73 - action = irq_desc[i].action; 74 if (!action) 75 goto unlock; 76 ··· 83 84 seq_putc(p, '\n'); 85 unlock: 86 - spin_unlock_irqrestore(&irq_controller_lock, flags); 87 } else if (i == NR_IRQS) { 88 #ifdef CONFIG_ARCH_ACORN 89 show_fiq_list(p, v); ··· 97 return 0; 98 } 99 100 - /* 101 - * IRQ lock detection. 102 - * 103 - * Hopefully, this should get us out of a few locked situations. 104 - * However, it may take a while for this to happen, since we need 105 - * a large number if IRQs to appear in the same jiffie with the 106 - * same instruction pointer (or within 2 instructions). 107 - */ 108 - static int check_irq_lock(struct irqdesc *desc, int irq, struct pt_regs *regs) 109 - { 110 - unsigned long instr_ptr = instruction_pointer(regs); 111 - 112 - if (desc->lck_jif == jiffies && 113 - desc->lck_pc >= instr_ptr && desc->lck_pc < instr_ptr + 8) { 114 - desc->lck_cnt += 1; 115 - 116 - if (desc->lck_cnt > MAX_IRQ_CNT) { 117 - printk(KERN_ERR "IRQ LOCK: IRQ%d is locking the system, disabled\n", irq); 118 - return 1; 119 - } 120 - } else { 121 - desc->lck_cnt = 0; 122 - desc->lck_pc = instruction_pointer(regs); 123 - desc->lck_jif = jiffies; 124 - } 125 - return 0; 126 - } 127 - 128 - static void 129 - report_bad_irq(unsigned int irq, struct pt_regs *regs, struct irqdesc *desc, int ret) 130 - { 131 - static int count = 100; 132 - struct irqaction *action; 133 - 134 - if (noirqdebug) 135 - return; 136 - 137 - if (ret != IRQ_HANDLED && ret != IRQ_NONE) { 138 - if (!count) 139 - return; 140 - count--; 141 - printk("irq%u: bogus retval mask %x\n", irq, ret); 142 - } else { 143 - desc->irqs_unhandled++; 144 - if (desc->irqs_unhandled <= 99900) 145 - return; 146 - desc->irqs_unhandled = 0; 147 - printk("irq%u: nobody cared\n", irq); 148 - } 149 - show_regs(regs); 150 - dump_stack(); 151 - printk(KERN_ERR "handlers:"); 152 - action = desc->action; 153 - do { 154 - printk("\n" KERN_ERR "[<%p>]", action->handler); 155 - print_symbol(" (%s)", (unsigned long)action->handler); 156 - action = action->next; 157 - } while (action); 158 - printk("\n"); 159 - } 160 - 161 - static int 162 - __do_irq(unsigned int irq, struct irqaction *action, struct pt_regs *regs) 163 - { 164 - unsigned int status; 165 - int ret, retval = 0; 166 - 167 - spin_unlock(&irq_controller_lock); 168 - 169 - #ifdef CONFIG_NO_IDLE_HZ 170 - if (!(action->flags & SA_TIMER) && system_timer->dyn_tick != NULL) { 171 - spin_lock(&system_timer->dyn_tick->lock); 172 - if (system_timer->dyn_tick->state & DYN_TICK_ENABLED) 173 - system_timer->dyn_tick->handler(irq, 0, regs); 174 - spin_unlock(&system_timer->dyn_tick->lock); 175 - } 176 - #endif 177 - 178 - if (!(action->flags & SA_INTERRUPT)) 179 - local_irq_enable(); 180 - 181 - status = 0; 182 - do { 183 - ret = action->handler(irq, action->dev_id, regs); 184 - if (ret == IRQ_HANDLED) 185 - status |= action->flags; 186 - retval |= ret; 187 - action = action->next; 188 - } while (action); 189 - 190 - if (status & SA_SAMPLE_RANDOM) 191 - add_interrupt_randomness(irq); 192 - 193 - spin_lock_irq(&irq_controller_lock); 194 - 195 - return retval; 196 - } 197 - 198 - /* 199 - * This is for software-decoded IRQs. The caller is expected to 200 - * handle the ack, clear, mask and unmask issues. 201 - */ 202 - void 203 - do_simple_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) 204 - { 205 - struct irqaction *action; 206 - const unsigned int cpu = smp_processor_id(); 207 - 208 - desc->triggered = 1; 209 - 210 - kstat_cpu(cpu).irqs[irq]++; 211 - 212 - smp_set_running(desc); 213 - 214 - action = desc->action; 215 - if (action) { 216 - int ret = __do_irq(irq, action, regs); 217 - if (ret != IRQ_HANDLED) 218 - report_bad_irq(irq, regs, desc, ret); 219 - } 220 - 221 - smp_clear_running(desc); 222 - } 223 - 224 - /* 225 - * Most edge-triggered IRQ implementations seem to take a broken 226 - * approach to this. Hence the complexity. 227 - */ 228 - void 229 - do_edge_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) 230 - { 231 - const unsigned int cpu = smp_processor_id(); 232 - 233 - desc->triggered = 1; 234 - 235 - /* 236 - * If we're currently running this IRQ, or its disabled, 237 - * we shouldn't process the IRQ. Instead, turn on the 238 - * hardware masks. 239 - */ 240 - if (unlikely(desc->running || desc->disable_depth)) 241 - goto running; 242 - 243 - /* 244 - * Acknowledge and clear the IRQ, but don't mask it. 245 - */ 246 - desc->chip->ack(irq); 247 - 248 - /* 249 - * Mark the IRQ currently in progress. 250 - */ 251 - desc->running = 1; 252 - 253 - kstat_cpu(cpu).irqs[irq]++; 254 - 255 - do { 256 - struct irqaction *action; 257 - 258 - action = desc->action; 259 - if (!action) 260 - break; 261 - 262 - if (desc->pending && !desc->disable_depth) { 263 - desc->pending = 0; 264 - desc->chip->unmask(irq); 265 - } 266 - 267 - __do_irq(irq, action, regs); 268 - } while (desc->pending && !desc->disable_depth); 269 - 270 - desc->running = 0; 271 - 272 - /* 273 - * If we were disabled or freed, shut down the handler. 274 - */ 275 - if (likely(desc->action && !check_irq_lock(desc, irq, regs))) 276 - return; 277 - 278 - running: 279 - /* 280 - * We got another IRQ while this one was masked or 281 - * currently running. Delay it. 282 - */ 283 - desc->pending = 1; 284 - desc->chip->mask(irq); 285 - desc->chip->ack(irq); 286 - } 287 - 288 - /* 289 - * Level-based IRQ handler. Nice and simple. 290 - */ 291 - void 292 - do_level_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) 293 - { 294 - struct irqaction *action; 295 - const unsigned int cpu = smp_processor_id(); 296 - 297 - desc->triggered = 1; 298 - 299 - /* 300 - * Acknowledge, clear _AND_ disable the interrupt. 301 - */ 302 - desc->chip->ack(irq); 303 - 304 - if (likely(!desc->disable_depth)) { 305 - kstat_cpu(cpu).irqs[irq]++; 306 - 307 - smp_set_running(desc); 308 - 309 - /* 310 - * Return with this interrupt masked if no action 311 - */ 312 - action = desc->action; 313 - if (action) { 314 - int ret = __do_irq(irq, desc->action, regs); 315 - 316 - if (ret != IRQ_HANDLED) 317 - report_bad_irq(irq, regs, desc, ret); 318 - 319 - if (likely(!desc->disable_depth && 320 - !check_irq_lock(desc, irq, regs))) 321 - desc->chip->unmask(irq); 322 - } 323 - 324 - smp_clear_running(desc); 325 - } 326 - } 327 - 328 - static void do_pending_irqs(struct pt_regs *regs) 329 - { 330 - struct list_head head, *l, *n; 331 - 332 - do { 333 - struct irqdesc *desc; 334 - 335 - /* 336 - * First, take the pending interrupts off the list. 337 - * The act of calling the handlers may add some IRQs 338 - * back onto the list. 339 - */ 340 - head = irq_pending; 341 - INIT_LIST_HEAD(&irq_pending); 342 - head.next->prev = &head; 343 - head.prev->next = &head; 344 - 345 - /* 346 - * Now run each entry. We must delete it from our 347 - * list before calling the handler. 348 - */ 349 - list_for_each_safe(l, n, &head) { 350 - desc = list_entry(l, struct irqdesc, pend); 351 - list_del_init(&desc->pend); 352 - desc_handle_irq(desc - irq_desc, desc, regs); 353 - } 354 - 355 - /* 356 - * The list must be empty. 357 - */ 358 - BUG_ON(!list_empty(&head)); 359 - } while (!list_empty(&irq_pending)); 360 - } 361 362 /* 363 * do_IRQ handles all hardware IRQ's. Decoded IRQs should not ··· 120 desc = &bad_irq_desc; 121 122 irq_enter(); 123 - spin_lock(&irq_controller_lock); 124 desc_handle_irq(irq, desc, regs); 125 126 - /* 127 - * Now re-run any pending interrupts. 128 - */ 129 - if (!list_empty(&irq_pending)) 130 - do_pending_irqs(regs); 131 - 132 irq_finish(irq); 133 134 - spin_unlock(&irq_controller_lock); 135 irq_exit(); 136 } 137 - 138 - void __set_irq_handler(unsigned int irq, irq_handler_t handle, int is_chained) 139 - { 140 - struct irqdesc *desc; 141 - unsigned long flags; 142 - 143 - if (irq >= NR_IRQS) { 144 - printk(KERN_ERR "Trying to install handler for IRQ%d\n", irq); 145 - return; 146 - } 147 - 148 - if (handle == NULL) 149 - handle = do_bad_IRQ; 150 - 151 - desc = irq_desc + irq; 152 - 153 - if (is_chained && desc->chip == &bad_chip) 154 - printk(KERN_WARNING "Trying to install chained handler for IRQ%d\n", irq); 155 - 156 - spin_lock_irqsave(&irq_controller_lock, flags); 157 - if (handle == do_bad_IRQ) { 158 - desc->chip->mask(irq); 159 - desc->chip->ack(irq); 160 - desc->disable_depth = 1; 161 - } 162 - desc->handle = handle; 163 - if (handle != do_bad_IRQ && is_chained) { 164 - desc->valid = 0; 165 - desc->probe_ok = 0; 166 - desc->disable_depth = 0; 167 - desc->chip->unmask(irq); 168 - } 169 - spin_unlock_irqrestore(&irq_controller_lock, flags); 170 - } 171 - 172 - void set_irq_chip(unsigned int irq, struct irqchip *chip) 173 - { 174 - struct irqdesc *desc; 175 - unsigned long flags; 176 - 177 - if (irq >= NR_IRQS) { 178 - printk(KERN_ERR "Trying to install chip for IRQ%d\n", irq); 179 - return; 180 - } 181 - 182 - if (chip == NULL) 183 - chip = &bad_chip; 184 - 185 - desc = irq_desc + irq; 186 - spin_lock_irqsave(&irq_controller_lock, flags); 187 - desc->chip = chip; 188 - spin_unlock_irqrestore(&irq_controller_lock, flags); 189 - } 190 - 191 - int set_irq_type(unsigned int irq, unsigned int type) 192 - { 193 - struct irqdesc *desc; 194 - unsigned long flags; 195 - int ret = -ENXIO; 196 - 197 - if (irq >= NR_IRQS) { 198 - printk(KERN_ERR "Trying to set irq type for IRQ%d\n", irq); 199 - return -ENODEV; 200 - } 201 - 202 - desc = irq_desc + irq; 203 - if (desc->chip->set_type) { 204 - spin_lock_irqsave(&irq_controller_lock, flags); 205 - ret = desc->chip->set_type(irq, type); 206 - spin_unlock_irqrestore(&irq_controller_lock, flags); 207 - } 208 - 209 - return ret; 210 - } 211 - EXPORT_SYMBOL(set_irq_type); 212 213 void set_irq_flags(unsigned int irq, unsigned int iflags) 214 { ··· 140 } 141 142 desc = irq_desc + irq; 143 - spin_lock_irqsave(&irq_controller_lock, flags); 144 - desc->valid = (iflags & IRQF_VALID) != 0; 145 - desc->probe_ok = (iflags & IRQF_PROBE) != 0; 146 - desc->noautoenable = (iflags & IRQF_NOAUTOEN) != 0; 147 - spin_unlock_irqrestore(&irq_controller_lock, flags); 148 - } 149 - 150 - int setup_irq(unsigned int irq, struct irqaction *new) 151 - { 152 - int shared = 0; 153 - struct irqaction *old, **p; 154 - unsigned long flags; 155 - struct irqdesc *desc; 156 - 157 - /* 158 - * Some drivers like serial.c use request_irq() heavily, 159 - * so we have to be careful not to interfere with a 160 - * running system. 161 - */ 162 - if (new->flags & SA_SAMPLE_RANDOM) { 163 - /* 164 - * This function might sleep, we want to call it first, 165 - * outside of the atomic block. 166 - * Yes, this might clear the entropy pool if the wrong 167 - * driver is attempted to be loaded, without actually 168 - * installing a new handler, but is this really a problem, 169 - * only the sysadmin is able to do this. 170 - */ 171 - rand_initialize_irq(irq); 172 - } 173 - 174 - /* 175 - * The following block of code has to be executed atomically 176 - */ 177 - desc = irq_desc + irq; 178 - spin_lock_irqsave(&irq_controller_lock, flags); 179 - p = &desc->action; 180 - if ((old = *p) != NULL) { 181 - /* 182 - * Can't share interrupts unless both agree to and are 183 - * the same type. 184 - */ 185 - if (!(old->flags & new->flags & SA_SHIRQ) || 186 - (~old->flags & new->flags) & SA_TRIGGER_MASK) { 187 - spin_unlock_irqrestore(&irq_controller_lock, flags); 188 - return -EBUSY; 189 - } 190 - 191 - /* add new interrupt at end of irq queue */ 192 - do { 193 - p = &old->next; 194 - old = *p; 195 - } while (old); 196 - shared = 1; 197 - } 198 - 199 - *p = new; 200 - 201 - if (!shared) { 202 - desc->probing = 0; 203 - desc->running = 0; 204 - desc->pending = 0; 205 - desc->disable_depth = 1; 206 - 207 - if (new->flags & SA_TRIGGER_MASK && 208 - desc->chip->set_type) { 209 - unsigned int type = new->flags & SA_TRIGGER_MASK; 210 - desc->chip->set_type(irq, type); 211 - } 212 - 213 - if (!desc->noautoenable) { 214 - desc->disable_depth = 0; 215 - desc->chip->unmask(irq); 216 - } 217 - } 218 - 219 - spin_unlock_irqrestore(&irq_controller_lock, flags); 220 - return 0; 221 - } 222 - 223 - /** 224 - * request_irq - allocate an interrupt line 225 - * @irq: Interrupt line to allocate 226 - * @handler: Function to be called when the IRQ occurs 227 - * @irqflags: Interrupt type flags 228 - * @devname: An ascii name for the claiming device 229 - * @dev_id: A cookie passed back to the handler function 230 - * 231 - * This call allocates interrupt resources and enables the 232 - * interrupt line and IRQ handling. From the point this 233 - * call is made your handler function may be invoked. Since 234 - * your handler function must clear any interrupt the board 235 - * raises, you must take care both to initialise your hardware 236 - * and to set up the interrupt handler in the right order. 237 - * 238 - * Dev_id must be globally unique. Normally the address of the 239 - * device data structure is used as the cookie. Since the handler 240 - * receives this value it makes sense to use it. 241 - * 242 - * If your interrupt is shared you must pass a non NULL dev_id 243 - * as this is required when freeing the interrupt. 244 - * 245 - * Flags: 246 - * 247 - * SA_SHIRQ Interrupt is shared 248 - * 249 - * SA_INTERRUPT Disable local interrupts while processing 250 - * 251 - * SA_SAMPLE_RANDOM The interrupt can be used for entropy 252 - * 253 - */ 254 - int request_irq(unsigned int irq, irqreturn_t (*handler)(int, void *, struct pt_regs *), 255 - unsigned long irq_flags, const char * devname, void *dev_id) 256 - { 257 - unsigned long retval; 258 - struct irqaction *action; 259 - 260 - if (irq >= NR_IRQS || !irq_desc[irq].valid || !handler || 261 - (irq_flags & SA_SHIRQ && !dev_id)) 262 - return -EINVAL; 263 - 264 - action = (struct irqaction *)kmalloc(sizeof(struct irqaction), GFP_KERNEL); 265 - if (!action) 266 - return -ENOMEM; 267 - 268 - action->handler = handler; 269 - action->flags = irq_flags; 270 - cpus_clear(action->mask); 271 - action->name = devname; 272 - action->next = NULL; 273 - action->dev_id = dev_id; 274 - 275 - retval = setup_irq(irq, action); 276 - 277 - if (retval) 278 - kfree(action); 279 - return retval; 280 - } 281 - 282 - EXPORT_SYMBOL(request_irq); 283 - 284 - /** 285 - * free_irq - free an interrupt 286 - * @irq: Interrupt line to free 287 - * @dev_id: Device identity to free 288 - * 289 - * Remove an interrupt handler. The handler is removed and if the 290 - * interrupt line is no longer in use by any driver it is disabled. 291 - * On a shared IRQ the caller must ensure the interrupt is disabled 292 - * on the card it drives before calling this function. 293 - * 294 - * This function must not be called from interrupt context. 295 - */ 296 - void free_irq(unsigned int irq, void *dev_id) 297 - { 298 - struct irqaction * action, **p; 299 - unsigned long flags; 300 - 301 - if (irq >= NR_IRQS || !irq_desc[irq].valid) { 302 - printk(KERN_ERR "Trying to free IRQ%d\n",irq); 303 - dump_stack(); 304 - return; 305 - } 306 - 307 - spin_lock_irqsave(&irq_controller_lock, flags); 308 - for (p = &irq_desc[irq].action; (action = *p) != NULL; p = &action->next) { 309 - if (action->dev_id != dev_id) 310 - continue; 311 - 312 - /* Found it - now free it */ 313 - *p = action->next; 314 - break; 315 - } 316 - spin_unlock_irqrestore(&irq_controller_lock, flags); 317 - 318 - if (!action) { 319 - printk(KERN_ERR "Trying to free free IRQ%d\n",irq); 320 - dump_stack(); 321 - } else { 322 - synchronize_irq(irq); 323 - kfree(action); 324 - } 325 - } 326 - 327 - EXPORT_SYMBOL(free_irq); 328 - 329 - static DECLARE_MUTEX(probe_sem); 330 - 331 - /* Start the interrupt probing. Unlike other architectures, 332 - * we don't return a mask of interrupts from probe_irq_on, 333 - * but return the number of interrupts enabled for the probe. 334 - * The interrupts which have been enabled for probing is 335 - * instead recorded in the irq_desc structure. 336 - */ 337 - unsigned long probe_irq_on(void) 338 - { 339 - unsigned int i, irqs = 0; 340 - unsigned long delay; 341 - 342 - down(&probe_sem); 343 - 344 - /* 345 - * first snaffle up any unassigned but 346 - * probe-able interrupts 347 - */ 348 - spin_lock_irq(&irq_controller_lock); 349 - for (i = 0; i < NR_IRQS; i++) { 350 - if (!irq_desc[i].probe_ok || irq_desc[i].action) 351 - continue; 352 - 353 - irq_desc[i].probing = 1; 354 - irq_desc[i].triggered = 0; 355 - if (irq_desc[i].chip->set_type) 356 - irq_desc[i].chip->set_type(i, IRQT_PROBE); 357 - irq_desc[i].chip->unmask(i); 358 - irqs += 1; 359 - } 360 - spin_unlock_irq(&irq_controller_lock); 361 - 362 - /* 363 - * wait for spurious interrupts to mask themselves out again 364 - */ 365 - for (delay = jiffies + HZ/10; time_before(jiffies, delay); ) 366 - /* min 100ms delay */; 367 - 368 - /* 369 - * now filter out any obviously spurious interrupts 370 - */ 371 - spin_lock_irq(&irq_controller_lock); 372 - for (i = 0; i < NR_IRQS; i++) { 373 - if (irq_desc[i].probing && irq_desc[i].triggered) { 374 - irq_desc[i].probing = 0; 375 - irqs -= 1; 376 - } 377 - } 378 - spin_unlock_irq(&irq_controller_lock); 379 - 380 - return irqs; 381 - } 382 - 383 - EXPORT_SYMBOL(probe_irq_on); 384 - 385 - unsigned int probe_irq_mask(unsigned long irqs) 386 - { 387 - unsigned int mask = 0, i; 388 - 389 - spin_lock_irq(&irq_controller_lock); 390 - for (i = 0; i < 16 && i < NR_IRQS; i++) 391 - if (irq_desc[i].probing && irq_desc[i].triggered) 392 - mask |= 1 << i; 393 - spin_unlock_irq(&irq_controller_lock); 394 - 395 - up(&probe_sem); 396 - 397 - return mask; 398 - } 399 - EXPORT_SYMBOL(probe_irq_mask); 400 - 401 - /* 402 - * Possible return values: 403 - * >= 0 - interrupt number 404 - * -1 - no interrupt/many interrupts 405 - */ 406 - int probe_irq_off(unsigned long irqs) 407 - { 408 - unsigned int i; 409 - int irq_found = NO_IRQ; 410 - 411 - /* 412 - * look at the interrupts, and find exactly one 413 - * that we were probing has been triggered 414 - */ 415 - spin_lock_irq(&irq_controller_lock); 416 - for (i = 0; i < NR_IRQS; i++) { 417 - if (irq_desc[i].probing && 418 - irq_desc[i].triggered) { 419 - if (irq_found != NO_IRQ) { 420 - irq_found = NO_IRQ; 421 - goto out; 422 - } 423 - irq_found = i; 424 - } 425 - } 426 - 427 - if (irq_found == -1) 428 - irq_found = NO_IRQ; 429 - out: 430 - spin_unlock_irq(&irq_controller_lock); 431 - 432 - up(&probe_sem); 433 - 434 - return irq_found; 435 - } 436 - 437 - EXPORT_SYMBOL(probe_irq_off); 438 - 439 - #ifdef CONFIG_SMP 440 - static void route_irq(struct irqdesc *desc, unsigned int irq, unsigned int cpu) 441 - { 442 - pr_debug("IRQ%u: moving from cpu%u to cpu%u\n", irq, desc->cpu, cpu); 443 - 444 - spin_lock_irq(&irq_controller_lock); 445 - desc->cpu = cpu; 446 - desc->chip->set_cpu(desc, irq, cpu); 447 - spin_unlock_irq(&irq_controller_lock); 448 - } 449 - 450 - #ifdef CONFIG_PROC_FS 451 - static int 452 - irq_affinity_read_proc(char *page, char **start, off_t off, int count, 453 - int *eof, void *data) 454 - { 455 - struct irqdesc *desc = irq_desc + ((int)data); 456 - int len = cpumask_scnprintf(page, count, desc->affinity); 457 - 458 - if (count - len < 2) 459 - return -EINVAL; 460 - page[len++] = '\n'; 461 - page[len] = '\0'; 462 - 463 - return len; 464 - } 465 - 466 - static int 467 - irq_affinity_write_proc(struct file *file, const char __user *buffer, 468 - unsigned long count, void *data) 469 - { 470 - unsigned int irq = (unsigned int)data; 471 - struct irqdesc *desc = irq_desc + irq; 472 - cpumask_t affinity, tmp; 473 - int ret = -EIO; 474 - 475 - if (!desc->chip->set_cpu) 476 - goto out; 477 - 478 - ret = cpumask_parse(buffer, count, affinity); 479 - if (ret) 480 - goto out; 481 - 482 - cpus_and(tmp, affinity, cpu_online_map); 483 - if (cpus_empty(tmp)) { 484 - ret = -EINVAL; 485 - goto out; 486 - } 487 - 488 - desc->affinity = affinity; 489 - route_irq(desc, irq, first_cpu(tmp)); 490 - ret = count; 491 - 492 - out: 493 - return ret; 494 - } 495 - #endif 496 - #endif 497 - 498 - void __init init_irq_proc(void) 499 - { 500 - #if defined(CONFIG_SMP) && defined(CONFIG_PROC_FS) 501 - struct proc_dir_entry *dir; 502 - int irq; 503 - 504 - dir = proc_mkdir("irq", NULL); 505 - if (!dir) 506 - return; 507 - 508 - for (irq = 0; irq < NR_IRQS; irq++) { 509 - struct proc_dir_entry *entry; 510 - struct irqdesc *desc; 511 - char name[16]; 512 - 513 - desc = irq_desc + irq; 514 - memset(name, 0, sizeof(name)); 515 - snprintf(name, sizeof(name) - 1, "%u", irq); 516 - 517 - desc->procdir = proc_mkdir(name, dir); 518 - if (!desc->procdir) 519 - continue; 520 - 521 - entry = create_proc_entry("smp_affinity", 0600, desc->procdir); 522 - if (entry) { 523 - entry->nlink = 1; 524 - entry->data = (void *)irq; 525 - entry->read_proc = irq_affinity_read_proc; 526 - entry->write_proc = irq_affinity_write_proc; 527 - } 528 - } 529 - #endif 530 } 531 532 void __init init_IRQ(void) 533 { 534 - struct irqdesc *desc; 535 int irq; 536 537 #ifdef CONFIG_SMP 538 bad_irq_desc.affinity = CPU_MASK_ALL; 539 bad_irq_desc.cpu = smp_processor_id(); 540 #endif 541 - 542 - for (irq = 0, desc = irq_desc; irq < NR_IRQS; irq++, desc++) { 543 - *desc = bad_irq_desc; 544 - INIT_LIST_HEAD(&desc->pend); 545 - } 546 - 547 init_arch_irq(); 548 } 549 - 550 - static int __init noirqdebug_setup(char *str) 551 - { 552 - noirqdebug = 1; 553 - return 1; 554 - } 555 - 556 - __setup("noirqdebug", noirqdebug_setup); 557 558 #ifdef CONFIG_HOTPLUG_CPU 559 /*
··· 26 #include <linux/signal.h> 27 #include <linux/ioport.h> 28 #include <linux/interrupt.h> 29 + #include <linux/irq.h> 30 #include <linux/ptrace.h> 31 #include <linux/slab.h> 32 #include <linux/random.h> ··· 37 #include <linux/kallsyms.h> 38 #include <linux/proc_fs.h> 39 40 #include <asm/system.h> 41 #include <asm/mach/time.h> 42 43 /* 44 * No architecture-specific irq_finish function defined in arm/arch/irqs.h. ··· 66 #define irq_finish(irq) do { } while (0) 67 #endif 68 69 + void (*init_arch_irq)(void) __initdata = NULL; 70 + unsigned long irq_err_count; 71 72 int show_interrupts(struct seq_file *p, void *v) 73 { ··· 242 } 243 244 if (i < NR_IRQS) { 245 + spin_lock_irqsave(&irq_desc[i].lock, flags); 246 + action = irq_desc[i].action; 247 if (!action) 248 goto unlock; 249 ··· 256 257 seq_putc(p, '\n'); 258 unlock: 259 + spin_unlock_irqrestore(&irq_desc[i].lock, flags); 260 } else if (i == NR_IRQS) { 261 #ifdef CONFIG_ARCH_ACORN 262 show_fiq_list(p, v); ··· 270 return 0; 271 } 272 273 + /* Handle bad interrupts */ 274 + static struct irq_desc bad_irq_desc = { 275 + .handle_irq = handle_bad_irq, 276 + .lock = SPIN_LOCK_UNLOCKED 277 + }; 278 279 /* 280 * do_IRQ handles all hardware IRQ's. Decoded IRQs should not ··· 549 desc = &bad_irq_desc; 550 551 irq_enter(); 552 + 553 desc_handle_irq(irq, desc, regs); 554 555 + /* AT91 specific workaround */ 556 irq_finish(irq); 557 558 irq_exit(); 559 } 560 561 void set_irq_flags(unsigned int irq, unsigned int iflags) 562 { ··· 650 } 651 652 desc = irq_desc + irq; 653 + spin_lock_irqsave(&desc->lock, flags); 654 + desc->status |= IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN; 655 + if (iflags & IRQF_VALID) 656 + desc->status &= ~IRQ_NOREQUEST; 657 + if (iflags & IRQF_PROBE) 658 + desc->status &= ~IRQ_NOPROBE; 659 + if (!(iflags & IRQF_NOAUTOEN)) 660 + desc->status &= ~IRQ_NOAUTOEN; 661 + spin_unlock_irqrestore(&desc->lock, flags); 662 } 663 664 void __init init_IRQ(void) 665 { 666 int irq; 667 + 668 + for (irq = 0; irq < NR_IRQS; irq++) 669 + irq_desc[irq].status |= IRQ_NOREQUEST | IRQ_DELAYED_DISABLE | 670 + IRQ_NOPROBE; 671 672 #ifdef CONFIG_SMP 673 bad_irq_desc.affinity = CPU_MASK_ALL; 674 bad_irq_desc.cpu = smp_processor_id(); 675 #endif 676 init_arch_irq(); 677 } 678 679 #ifdef CONFIG_HOTPLUG_CPU 680 /*
+1 -1
arch/arm/mach-at91rm9200/at91rm9200_time.c
··· 21 22 #include <linux/init.h> 23 #include <linux/interrupt.h> 24 #include <linux/kernel.h> 25 #include <linux/sched.h> 26 #include <linux/time.h> 27 28 #include <asm/hardware.h> 29 #include <asm/io.h> 30 - #include <asm/irq.h> 31 #include <asm/mach/time.h> 32 33 static unsigned long last_crtr;
··· 21 22 #include <linux/init.h> 23 #include <linux/interrupt.h> 24 + #include <linux/irq.h> 25 #include <linux/kernel.h> 26 #include <linux/sched.h> 27 #include <linux/time.h> 28 29 #include <asm/hardware.h> 30 #include <asm/io.h> 31 #include <asm/mach/time.h> 32 33 static unsigned long last_crtr;
+6 -5
arch/arm/mach-at91rm9200/gpio.c
··· 10 */ 11 12 #include <linux/errno.h> 13 #include <linux/kernel.h> 14 #include <linux/list.h> 15 #include <linux/module.h> 16 17 #include <asm/io.h> 18 - #include <asm/mach/irq.h> 19 #include <asm/hardware.h> 20 #include <asm/arch/gpio.h> 21 ··· 341 void __iomem *pio; 342 u32 isr; 343 344 - pio = desc->base; 345 346 /* temporarily mask (level sensitive) parent IRQ */ 347 desc->chip->ack(irq); ··· 351 if (!isr) 352 break; 353 354 - pin = (unsigned) desc->data; 355 gpio = &irq_desc[pin]; 356 357 while (isr) { 358 if (isr & 1) { 359 - if (unlikely(gpio->disable_depth)) { 360 /* 361 * The core ARM interrupt handler lazily disables IRQs so 362 * another IRQ must be generated before it actually gets ··· 365 gpio_irq_mask(pin); 366 } 367 else 368 - gpio->handle(pin, gpio, regs); 369 } 370 pin++; 371 gpio++;
··· 10 */ 11 12 #include <linux/errno.h> 13 + #include <linux/interrupt.h> 14 + #include <linux/irq.h> 15 #include <linux/kernel.h> 16 #include <linux/list.h> 17 #include <linux/module.h> 18 19 #include <asm/io.h> 20 #include <asm/hardware.h> 21 #include <asm/arch/gpio.h> 22 ··· 340 void __iomem *pio; 341 u32 isr; 342 343 + pio = get_irq_chip_data(irq); 344 345 /* temporarily mask (level sensitive) parent IRQ */ 346 desc->chip->ack(irq); ··· 350 if (!isr) 351 break; 352 353 + pin = (unsigned) get_irq_data(irq); 354 gpio = &irq_desc[pin]; 355 356 while (isr) { 357 if (isr & 1) { 358 + if (unlikely(gpio->depth)) { 359 /* 360 * The core ARM interrupt handler lazily disables IRQs so 361 * another IRQ must be generated before it actually gets ··· 364 gpio_irq_mask(pin); 365 } 366 else 367 + desc_handle_irq(pin, gpio, regs); 368 } 369 pin++; 370 gpio++;
+1
arch/arm/mach-clps711x/time.c
··· 19 #include <linux/timex.h> 20 #include <linux/init.h> 21 #include <linux/interrupt.h> 22 #include <linux/sched.h> 23 24 #include <asm/hardware.h>
··· 19 #include <linux/timex.h> 20 #include <linux/init.h> 21 #include <linux/interrupt.h> 22 + #include <linux/irq.h> 23 #include <linux/sched.h> 24 25 #include <asm/hardware.h>
+1
arch/arm/mach-clps7500/core.c
··· 9 #include <linux/kernel.h> 10 #include <linux/types.h> 11 #include <linux/interrupt.h> 12 #include <linux/list.h> 13 #include <linux/sched.h> 14 #include <linux/init.h>
··· 9 #include <linux/kernel.h> 10 #include <linux/types.h> 11 #include <linux/interrupt.h> 12 + #include <linux/irq.h> 13 #include <linux/list.h> 14 #include <linux/sched.h> 15 #include <linux/init.h>
+1
arch/arm/mach-footbridge/dc21285-timer.c
··· 6 */ 7 #include <linux/init.h> 8 #include <linux/interrupt.h> 9 10 #include <asm/irq.h> 11
··· 6 */ 7 #include <linux/init.h> 8 #include <linux/interrupt.h> 9 + #include <linux/irq.h> 10 11 #include <asm/irq.h> 12
+1
arch/arm/mach-footbridge/isa-timer.c
··· 6 */ 7 #include <linux/init.h> 8 #include <linux/interrupt.h> 9 10 #include <asm/io.h> 11 #include <asm/irq.h>
··· 6 */ 7 #include <linux/init.h> 8 #include <linux/interrupt.h> 9 + #include <linux/irq.h> 10 11 #include <asm/io.h> 12 #include <asm/irq.h>
+1
arch/arm/mach-imx/time.c
··· 12 #include <linux/sched.h> 13 #include <linux/init.h> 14 #include <linux/interrupt.h> 15 #include <linux/time.h> 16 17 #include <asm/hardware.h>
··· 12 #include <linux/sched.h> 13 #include <linux/init.h> 14 #include <linux/interrupt.h> 15 + #include <linux/irq.h> 16 #include <linux/time.h> 17 18 #include <asm/hardware.h>
+1
arch/arm/mach-integrator/core.c
··· 13 #include <linux/device.h> 14 #include <linux/spinlock.h> 15 #include <linux/interrupt.h> 16 #include <linux/sched.h> 17 #include <linux/smp.h> 18 #include <linux/termios.h>
··· 13 #include <linux/device.h> 14 #include <linux/spinlock.h> 15 #include <linux/interrupt.h> 16 + #include <linux/irq.h> 17 #include <linux/sched.h> 18 #include <linux/smp.h> 19 #include <linux/termios.h>
+2 -1
arch/arm/mach-ixp2000/core.c
··· 19 #include <linux/spinlock.h> 20 #include <linux/sched.h> 21 #include <linux/interrupt.h> 22 #include <linux/serial.h> 23 #include <linux/tty.h> 24 #include <linux/bitops.h> ··· 409 for(i = 31; i >= 0; i--) { 410 if(status & (1 << i)) { 411 desc = irq_desc + IRQ_IXP2000_DRAM0_MIN_ERR + i; 412 - desc->handle(IRQ_IXP2000_DRAM0_MIN_ERR + i, desc, regs); 413 } 414 } 415 }
··· 19 #include <linux/spinlock.h> 20 #include <linux/sched.h> 21 #include <linux/interrupt.h> 22 + #include <linux/irq.h> 23 #include <linux/serial.h> 24 #include <linux/tty.h> 25 #include <linux/bitops.h> ··· 408 for(i = 31; i >= 0; i--) { 409 if(status & (1 << i)) { 410 desc = irq_desc + IRQ_IXP2000_DRAM0_MIN_ERR + i; 411 + desc_handle_irq(IRQ_IXP2000_DRAM0_MIN_ERR + i, desc, regs); 412 } 413 } 414 }
+1 -1
arch/arm/mach-ixp2000/ixdp2x00.c
··· 167 } 168 169 /* Hook into PCI interrupt */ 170 - set_irq_chained_handler(IRQ_IXP2000_PCIB, &ixdp2x00_irq_handler); 171 } 172 173 /*************************************************************************
··· 167 } 168 169 /* Hook into PCI interrupt */ 170 + set_irq_chained_handler(IRQ_IXP2000_PCIB, ixdp2x00_irq_handler); 171 } 172 173 /*************************************************************************
+1 -1
arch/arm/mach-ixp2000/ixdp2x01.c
··· 127 } 128 129 /* Hook into PCI interrupts */ 130 - set_irq_chained_handler(IRQ_IXP2000_PCIB, &ixdp2x01_irq_handler); 131 } 132 133
··· 127 } 128 129 /* Hook into PCI interrupts */ 130 + set_irq_chained_handler(IRQ_IXP2000_PCIB, ixdp2x01_irq_handler); 131 } 132 133
+1 -1
arch/arm/mach-ixp23xx/core.c
··· 271 } 272 273 int_desc = irq_desc + irqno; 274 - int_desc->handle(irqno, int_desc, regs); 275 276 desc->chip->unmask(irq); 277 }
··· 271 } 272 273 int_desc = irq_desc + irqno; 274 + desc_handle_irq(irqno, int_desc, regs); 275 276 desc->chip->unmask(irq); 277 }
+5 -5
arch/arm/mach-ixp23xx/ixdp2351.c
··· 19 #include <linux/spinlock.h> 20 #include <linux/sched.h> 21 #include <linux/interrupt.h> 22 #include <linux/serial.h> 23 #include <linux/tty.h> 24 #include <linux/bitops.h> ··· 37 #include <asm/memory.h> 38 #include <asm/hardware.h> 39 #include <asm/mach-types.h> 40 - #include <asm/irq.h> 41 #include <asm/system.h> 42 #include <asm/tlbflush.h> 43 #include <asm/pgtable.h> ··· 74 int cpld_irq = 75 IXP23XX_MACH_IRQ(IXDP2351_INTA_IRQ_BASE + i); 76 cpld_desc = irq_desc + cpld_irq; 77 - cpld_desc->handle(cpld_irq, cpld_desc, regs); 78 } 79 } 80 ··· 111 int cpld_irq = 112 IXP23XX_MACH_IRQ(IXDP2351_INTB_IRQ_BASE + i); 113 cpld_desc = irq_desc + cpld_irq; 114 - cpld_desc->handle(cpld_irq, cpld_desc, regs); 115 } 116 } 117 ··· 158 } 159 } 160 161 - set_irq_chained_handler(IRQ_IXP23XX_INTA, &ixdp2351_inta_handler); 162 - set_irq_chained_handler(IRQ_IXP23XX_INTB, &ixdp2351_intb_handler); 163 } 164 165 /*
··· 19 #include <linux/spinlock.h> 20 #include <linux/sched.h> 21 #include <linux/interrupt.h> 22 + #include <linux/irq.h> 23 #include <linux/serial.h> 24 #include <linux/tty.h> 25 #include <linux/bitops.h> ··· 36 #include <asm/memory.h> 37 #include <asm/hardware.h> 38 #include <asm/mach-types.h> 39 #include <asm/system.h> 40 #include <asm/tlbflush.h> 41 #include <asm/pgtable.h> ··· 74 int cpld_irq = 75 IXP23XX_MACH_IRQ(IXDP2351_INTA_IRQ_BASE + i); 76 cpld_desc = irq_desc + cpld_irq; 77 + desc_handle_irq(cpld_irq, cpld_desc, regs); 78 } 79 } 80 ··· 111 int cpld_irq = 112 IXP23XX_MACH_IRQ(IXDP2351_INTB_IRQ_BASE + i); 113 cpld_desc = irq_desc + cpld_irq; 114 + desc_handle_irq(cpld_irq, cpld_desc, regs); 115 } 116 } 117 ··· 158 } 159 } 160 161 + set_irq_chained_handler(IRQ_IXP23XX_INTA, ixdp2351_inta_handler); 162 + set_irq_chained_handler(IRQ_IXP23XX_INTB, ixdp2351_intb_handler); 163 } 164 165 /*
+1
arch/arm/mach-ixp4xx/coyote-pci.c
··· 17 #include <linux/kernel.h> 18 #include <linux/pci.h> 19 #include <linux/init.h> 20 21 #include <asm/mach-types.h> 22 #include <asm/hardware.h>
··· 17 #include <linux/kernel.h> 18 #include <linux/pci.h> 19 #include <linux/init.h> 20 + #include <linux/irq.h> 21 22 #include <asm/mach-types.h> 23 #include <asm/hardware.h>
+1
arch/arm/mach-ixp4xx/ixdp425-pci.c
··· 17 #include <linux/kernel.h> 18 #include <linux/pci.h> 19 #include <linux/init.h> 20 #include <linux/delay.h> 21 22 #include <asm/mach/pci.h>
··· 17 #include <linux/kernel.h> 18 #include <linux/pci.h> 19 #include <linux/init.h> 20 + #include <linux/irq.h> 21 #include <linux/delay.h> 22 23 #include <asm/mach/pci.h>
+1 -1
arch/arm/mach-ixp4xx/ixdpg425-pci.c
··· 16 #include <linux/kernel.h> 17 #include <linux/pci.h> 18 #include <linux/init.h> 19 20 #include <asm/mach-types.h> 21 #include <asm/hardware.h> 22 - #include <asm/irq.h> 23 24 #include <asm/mach/pci.h> 25
··· 16 #include <linux/kernel.h> 17 #include <linux/pci.h> 18 #include <linux/init.h> 19 + #include <linux/irq.h> 20 21 #include <asm/mach-types.h> 22 #include <asm/hardware.h> 23 24 #include <asm/mach/pci.h> 25
+1
arch/arm/mach-ixp4xx/nas100d-pci.c
··· 17 18 #include <linux/pci.h> 19 #include <linux/init.h> 20 21 #include <asm/mach/pci.h> 22 #include <asm/mach-types.h>
··· 17 18 #include <linux/pci.h> 19 #include <linux/init.h> 20 + #include <linux/irq.h> 21 22 #include <asm/mach/pci.h> 23 #include <asm/mach-types.h>
+2 -2
arch/arm/mach-ixp4xx/nas100d-power.c
··· 17 * 18 */ 19 20 - #include <linux/module.h> 21 - #include <linux/reboot.h> 22 #include <linux/interrupt.h> 23 #include <linux/reboot.h> 24 25 #include <asm/mach-types.h>
··· 17 * 18 */ 19 20 #include <linux/interrupt.h> 21 + #include <linux/irq.h> 22 + #include <linux/module.h> 23 #include <linux/reboot.h> 24 25 #include <asm/mach-types.h>
+1
arch/arm/mach-l7200/core.c
··· 7 */ 8 #include <linux/kernel.h> 9 #include <linux/init.h> 10 #include <linux/device.h> 11 12 #include <asm/types.h>
··· 7 */ 8 #include <linux/kernel.h> 9 #include <linux/init.h> 10 + #include <linux/irq.h> 11 #include <linux/device.h> 12 13 #include <asm/types.h>
+1
arch/arm/mach-lh7a40x/arch-lpd7a40x.c
··· 12 #include <linux/init.h> 13 #include <linux/platform_device.h> 14 #include <linux/interrupt.h> 15 16 #include <asm/hardware.h> 17 #include <asm/setup.h>
··· 12 #include <linux/init.h> 13 #include <linux/platform_device.h> 14 #include <linux/interrupt.h> 15 + #include <linux/irq.h> 16 17 #include <asm/hardware.h> 18 #include <asm/setup.h>
+1
arch/arm/mach-lh7a40x/time.c
··· 11 #include <linux/module.h> 12 #include <linux/kernel.h> 13 #include <linux/interrupt.h> 14 #include <linux/time.h> 15 16 #include <asm/hardware.h>
··· 11 #include <linux/module.h> 12 #include <linux/kernel.h> 13 #include <linux/interrupt.h> 14 + #include <linux/irq.h> 15 #include <linux/time.h> 16 17 #include <asm/hardware.h>
+1 -1
arch/arm/mach-omap1/board-osk.c
··· 29 #include <linux/kernel.h> 30 #include <linux/init.h> 31 #include <linux/platform_device.h> 32 - #include <linux/interrupt.h> 33 34 #include <linux/mtd/mtd.h> 35 #include <linux/mtd/partitions.h>
··· 29 #include <linux/kernel.h> 30 #include <linux/init.h> 31 #include <linux/platform_device.h> 32 + #include <linux/irq.h> 33 34 #include <linux/mtd/mtd.h> 35 #include <linux/mtd/partitions.h>
+1
arch/arm/mach-omap1/serial.c
··· 11 #include <linux/module.h> 12 #include <linux/kernel.h> 13 #include <linux/init.h> 14 #include <linux/delay.h> 15 #include <linux/serial.h> 16 #include <linux/tty.h>
··· 11 #include <linux/module.h> 12 #include <linux/kernel.h> 13 #include <linux/init.h> 14 + #include <linux/irq.h> 15 #include <linux/delay.h> 16 #include <linux/serial.h> 17 #include <linux/tty.h>
+1
arch/arm/mach-pxa/idp.c
··· 18 19 #include <linux/init.h> 20 #include <linux/interrupt.h> 21 #include <linux/platform_device.h> 22 #include <linux/fb.h> 23
··· 18 19 #include <linux/init.h> 20 #include <linux/interrupt.h> 21 + #include <linux/irq.h> 22 #include <linux/platform_device.h> 23 #include <linux/fb.h> 24
+1 -1
arch/arm/mach-pxa/sharpsl_pm.c
··· 18 #include <linux/init.h> 19 #include <linux/kernel.h> 20 #include <linux/interrupt.h> 21 #include <linux/platform_device.h> 22 23 #include <asm/hardware.h> 24 #include <asm/mach-types.h> 25 - #include <asm/irq.h> 26 #include <asm/apm.h> 27 #include <asm/arch/pm.h> 28 #include <asm/arch/pxa-regs.h>
··· 18 #include <linux/init.h> 19 #include <linux/kernel.h> 20 #include <linux/interrupt.h> 21 + #include <linux/irq.h> 22 #include <linux/platform_device.h> 23 24 #include <asm/hardware.h> 25 #include <asm/mach-types.h> 26 #include <asm/apm.h> 27 #include <asm/arch/pm.h> 28 #include <asm/arch/pxa-regs.h>
+3 -3
arch/arm/mach-s3c2410/bast-irq.c
··· 136 for (i = 0; stat != 0; i++, stat >>= 1) { 137 if (stat & 1) { 138 irqno = bast_pc104_irqs[i]; 139 - 140 - desc_handle_irq(irqno, irq_desc + irqno, regs); 141 } 142 } 143 } ··· 156 157 set_irq_chained_handler(IRQ_ISA, bast_irq_pc104_demux); 158 159 - /* reigster our IRQs */ 160 161 for (i = 0; i < 4; i++) { 162 unsigned int irqno = bast_pc104_irqs[i];
··· 136 for (i = 0; stat != 0; i++, stat >>= 1) { 137 if (stat & 1) { 138 irqno = bast_pc104_irqs[i]; 139 + desc = irq_desc + irqno; 140 + desc_handle_irq(irqno, desc, regs); 141 } 142 } 143 } ··· 156 157 set_irq_chained_handler(IRQ_ISA, bast_irq_pc104_demux); 158 159 + /* register our IRQs */ 160 161 for (i = 0; i < 4; i++) { 162 unsigned int irqno = bast_pc104_irqs[i];
+1
arch/arm/mach-s3c2410/time.c
··· 22 #include <linux/sched.h> 23 #include <linux/init.h> 24 #include <linux/interrupt.h> 25 #include <linux/err.h> 26 #include <linux/clk.h> 27
··· 22 #include <linux/sched.h> 23 #include <linux/init.h> 24 #include <linux/interrupt.h> 25 + #include <linux/irq.h> 26 #include <linux/err.h> 27 #include <linux/clk.h> 28
+1
arch/arm/mach-sa1100/cerf.c
··· 14 #include <linux/kernel.h> 15 #include <linux/tty.h> 16 #include <linux/platform_device.h> 17 #include <linux/mtd/mtd.h> 18 #include <linux/mtd/partitions.h> 19
··· 14 #include <linux/kernel.h> 15 #include <linux/tty.h> 16 #include <linux/platform_device.h> 17 + #include <linux/irq.h> 18 #include <linux/mtd/mtd.h> 19 #include <linux/mtd/partitions.h> 20
+1 -1
arch/arm/mach-sa1100/h3600.c
··· 835 } 836 #endif 837 set_irq_type(IRQ_GPIO_H3800_ASIC, IRQT_RISING); 838 - set_irq_chained_handler(IRQ_GPIO_H3800_ASIC, &h3800_IRQ_demux); 839 } 840 841
··· 835 } 836 #endif 837 set_irq_type(IRQ_GPIO_H3800_ASIC, IRQT_RISING); 838 + set_irq_chained_handler(IRQ_GPIO_H3800_ASIC, h3800_IRQ_demux); 839 } 840 841
+2 -1
arch/arm/mach-sa1100/irq.c
··· 11 */ 12 #include <linux/init.h> 13 #include <linux/module.h> 14 #include <linux/ioport.h> 15 #include <linux/ptrace.h> 16 #include <linux/sysdev.h> 17 18 #include <asm/hardware.h> 19 - #include <asm/irq.h> 20 #include <asm/mach/irq.h> 21 22 #include "generic.h"
··· 11 */ 12 #include <linux/init.h> 13 #include <linux/module.h> 14 + #include <linux/interrupt.h> 15 + #include <linux/irq.h> 16 #include <linux/ioport.h> 17 #include <linux/ptrace.h> 18 #include <linux/sysdev.h> 19 20 #include <asm/hardware.h> 21 #include <asm/mach/irq.h> 22 23 #include "generic.h"
+1
arch/arm/mach-sa1100/pleb.c
··· 7 #include <linux/tty.h> 8 #include <linux/ioport.h> 9 #include <linux/platform_device.h> 10 11 #include <linux/mtd/partitions.h> 12
··· 7 #include <linux/tty.h> 8 #include <linux/ioport.h> 9 #include <linux/platform_device.h> 10 + #include <linux/irq.h> 11 12 #include <linux/mtd/partitions.h> 13
+1
arch/arm/mach-sa1100/time.c
··· 11 #include <linux/init.h> 12 #include <linux/errno.h> 13 #include <linux/interrupt.h> 14 #include <linux/timex.h> 15 #include <linux/signal.h> 16
··· 11 #include <linux/init.h> 12 #include <linux/errno.h> 13 #include <linux/interrupt.h> 14 + #include <linux/irq.h> 15 #include <linux/timex.h> 16 #include <linux/signal.h> 17
+1
arch/arm/mach-shark/core.c
··· 6 #include <linux/kernel.h> 7 #include <linux/init.h> 8 #include <linux/interrupt.h> 9 #include <linux/sched.h> 10 #include <linux/serial_8250.h> 11
··· 6 #include <linux/kernel.h> 7 #include <linux/init.h> 8 #include <linux/interrupt.h> 9 + #include <linux/irq.h> 10 #include <linux/sched.h> 11 #include <linux/serial_8250.h> 12
+1 -1
arch/arm/plat-omap/dma.c
··· 24 #include <linux/spinlock.h> 25 #include <linux/errno.h> 26 #include <linux/interrupt.h> 27 28 #include <asm/system.h> 29 - #include <asm/irq.h> 30 #include <asm/hardware.h> 31 #include <asm/dma.h> 32 #include <asm/io.h>
··· 24 #include <linux/spinlock.h> 25 #include <linux/errno.h> 26 #include <linux/interrupt.h> 27 + #include <linux/irq.h> 28 29 #include <asm/system.h> 30 #include <asm/hardware.h> 31 #include <asm/dma.h> 32 #include <asm/io.h>
+1 -1
arch/arm/plat-omap/gpio.c
··· 783 784 desc->chip->ack(irq); 785 786 - bank = (struct gpio_bank *) desc->data; 787 if (bank->method == METHOD_MPUIO) 788 isr_reg = bank->base + OMAP_MPUIO_GPIO_INT; 789 #ifdef CONFIG_ARCH_OMAP15XX
··· 783 784 desc->chip->ack(irq); 785 786 + bank = get_irq_data(irq); 787 if (bank->method == METHOD_MPUIO) 788 isr_reg = bank->base + OMAP_MPUIO_GPIO_INT; 789 #ifdef CONFIG_ARCH_OMAP15XX
+1 -1
drivers/input/touchscreen/corgi_ts.c
··· 17 #include <linux/interrupt.h> 18 #include <linux/module.h> 19 #include <linux/slab.h> 20 - //#include <asm/irq.h> 21 22 #include <asm/arch/sharpsl.h> 23 #include <asm/arch/hardware.h>
··· 17 #include <linux/interrupt.h> 18 #include <linux/module.h> 19 #include <linux/slab.h> 20 + #include <linux/irq.h> 21 22 #include <asm/arch/sharpsl.h> 23 #include <asm/arch/hardware.h>
+1 -1
drivers/pcmcia/soc_common.c
··· 38 #include <linux/timer.h> 39 #include <linux/mm.h> 40 #include <linux/interrupt.h> 41 #include <linux/spinlock.h> 42 #include <linux/cpufreq.h> 43 44 #include <asm/hardware.h> 45 #include <asm/io.h> 46 - #include <asm/irq.h> 47 #include <asm/system.h> 48 49 #include "soc_common.h"
··· 38 #include <linux/timer.h> 39 #include <linux/mm.h> 40 #include <linux/interrupt.h> 41 + #include <linux/irq.h> 42 #include <linux/spinlock.h> 43 #include <linux/cpufreq.h> 44 45 #include <asm/hardware.h> 46 #include <asm/io.h> 47 #include <asm/system.h> 48 49 #include "soc_common.h"
+6
include/asm-arm/dyntick.h
···
··· 1 + #ifndef _ASMARM_DYNTICK_H 2 + #define _ASMARM_DYNTICK_H 3 + 4 + #include <asm/mach/time.h> 5 + 6 + #endif /* _ASMARM_DYNTICK_H */
+9
include/asm-arm/hw_irq.h
···
··· 1 + /* 2 + * Nothing to see here yet 3 + */ 4 + #ifndef _ARCH_ARM_HW_IRQ_H 5 + #define _ARCH_ARM_HW_IRQ_H 6 + 7 + #include <asm/mach/irq.h> 8 + 9 + #endif
+6 -16
include/asm-arm/irq.h
··· 21 22 struct irqaction; 23 24 - extern void disable_irq_nosync(unsigned int); 25 - extern void disable_irq(unsigned int); 26 - extern void enable_irq(unsigned int); 27 - 28 /* 29 - * These correspond with the SA_TRIGGER_* defines, and therefore the 30 - * IORESOURCE_IRQ_* defines. 31 */ 32 - #define __IRQT_RISEDGE (1 << 0) 33 - #define __IRQT_FALEDGE (1 << 1) 34 - #define __IRQT_HIGHLVL (1 << 2) 35 - #define __IRQT_LOWLVL (1 << 3) 36 37 #define IRQT_NOEDGE (0) 38 #define IRQT_RISING (__IRQT_RISEDGE) ··· 35 #define IRQT_BOTHEDGE (__IRQT_RISEDGE|__IRQT_FALEDGE) 36 #define IRQT_LOW (__IRQT_LOWLVL) 37 #define IRQT_HIGH (__IRQT_HIGHLVL) 38 - #define IRQT_PROBE (1 << 4) 39 - 40 - int set_irq_type(unsigned int irq, unsigned int type); 41 - void disable_irq_wake(unsigned int irq); 42 - void enable_irq_wake(unsigned int irq); 43 - int setup_irq(unsigned int, struct irqaction *); 44 45 extern void migrate_irqs(void); 46 #endif
··· 21 22 struct irqaction; 23 24 /* 25 + * Migration helpers 26 */ 27 + #define __IRQT_FALEDGE IRQ_TYPE_EDGE_FALLING 28 + #define __IRQT_RISEDGE IRQ_TYPE_EDGE_RISING 29 + #define __IRQT_LOWLVL IRQ_TYPE_LEVEL_LOW 30 + #define __IRQT_HIGHLVL IRQ_TYPE_LEVEL_HIGH 31 32 #define IRQT_NOEDGE (0) 33 #define IRQT_RISING (__IRQT_RISEDGE) ··· 40 #define IRQT_BOTHEDGE (__IRQT_RISEDGE|__IRQT_FALEDGE) 41 #define IRQT_LOW (__IRQT_LOWLVL) 42 #define IRQT_HIGH (__IRQT_HIGHLVL) 43 + #define IRQT_PROBE IRQ_TYPE_PROBE 44 45 extern void migrate_irqs(void); 46 #endif
+33 -102
include/asm-arm/mach/irq.h
··· 10 #ifndef __ASM_ARM_MACH_IRQ_H 11 #define __ASM_ARM_MACH_IRQ_H 12 13 - struct irqdesc; 14 - struct pt_regs; 15 struct seq_file; 16 - 17 - typedef void (*irq_handler_t)(unsigned int, struct irqdesc *, struct pt_regs *); 18 - typedef void (*irq_control_t)(unsigned int); 19 - 20 - struct irqchip { 21 - /* 22 - * Acknowledge the IRQ. 23 - * If this is a level-based IRQ, then it is expected to mask the IRQ 24 - * as well. 25 - */ 26 - void (*ack)(unsigned int); 27 - /* 28 - * Mask the IRQ in hardware. 29 - */ 30 - void (*mask)(unsigned int); 31 - /* 32 - * Unmask the IRQ in hardware. 33 - */ 34 - void (*unmask)(unsigned int); 35 - /* 36 - * Ask the hardware to re-trigger the IRQ. 37 - * Note: This method _must_ _not_ call the interrupt handler. 38 - * If you are unable to retrigger the interrupt, do not 39 - * provide a function, or if you do, return non-zero. 40 - */ 41 - int (*retrigger)(unsigned int); 42 - /* 43 - * Set the type of the IRQ. 44 - */ 45 - int (*set_type)(unsigned int, unsigned int); 46 - /* 47 - * Set wakeup-enable on the selected IRQ 48 - */ 49 - int (*set_wake)(unsigned int, unsigned int); 50 - 51 - #ifdef CONFIG_SMP 52 - /* 53 - * Route an interrupt to a CPU 54 - */ 55 - void (*set_cpu)(struct irqdesc *desc, unsigned int irq, unsigned int cpu); 56 - #endif 57 - }; 58 - 59 - struct irqdesc { 60 - irq_handler_t handle; 61 - struct irqchip *chip; 62 - struct irqaction *action; 63 - struct list_head pend; 64 - void __iomem *base; 65 - void *data; 66 - unsigned int disable_depth; 67 - 68 - unsigned int triggered: 1; /* IRQ has occurred */ 69 - unsigned int running : 1; /* IRQ is running */ 70 - unsigned int pending : 1; /* IRQ is pending */ 71 - unsigned int probing : 1; /* IRQ in use for a probe */ 72 - unsigned int probe_ok : 1; /* IRQ can be used for probe */ 73 - unsigned int valid : 1; /* IRQ claimable */ 74 - unsigned int noautoenable : 1; /* don't automatically enable IRQ */ 75 - unsigned int unused :25; 76 - 77 - unsigned int irqs_unhandled; 78 - struct proc_dir_entry *procdir; 79 - 80 - #ifdef CONFIG_SMP 81 - cpumask_t affinity; 82 - unsigned int cpu; 83 - #endif 84 - 85 - /* 86 - * IRQ lock detection 87 - */ 88 - unsigned int lck_cnt; 89 - unsigned int lck_pc; 90 - unsigned int lck_jif; 91 - }; 92 - 93 - extern struct irqdesc irq_desc[]; 94 - 95 - /* 96 - * Helpful inline function for calling irq descriptor handlers. 97 - */ 98 - static inline void desc_handle_irq(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs) 99 - { 100 - desc->handle(irq, desc, regs); 101 - } 102 103 /* 104 * This is internal. Do not use it. ··· 20 extern void (*init_arch_irq)(void); 21 extern void init_FIQ(void); 22 extern int show_fiq_list(struct seq_file *, void *); 23 - void __set_irq_handler(unsigned int irq, irq_handler_t, int); 24 25 /* 26 - * External stuff. 27 */ 28 - #define set_irq_handler(irq,handler) __set_irq_handler(irq,handler,0) 29 - #define set_irq_chained_handler(irq,handler) __set_irq_handler(irq,handler,1) 30 - #define set_irq_data(irq,d) do { irq_desc[irq].data = d; } while (0) 31 - #define set_irq_chipdata(irq,d) do { irq_desc[irq].base = d; } while (0) 32 - #define get_irq_chipdata(irq) (irq_desc[irq].base) 33 34 - void set_irq_chip(unsigned int irq, struct irqchip *); 35 void set_irq_flags(unsigned int irq, unsigned int flags); 36 37 #define IRQF_VALID (1 << 0) ··· 43 #define IRQF_NOAUTOEN (1 << 2) 44 45 /* 46 - * Built-in IRQ handlers. 47 */ 48 - void do_level_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs); 49 - void do_edge_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs); 50 - void do_simple_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs); 51 - void do_bad_IRQ(unsigned int irq, struct irqdesc *desc, struct pt_regs *regs); 52 - void dummy_mask_unmask_irq(unsigned int irq); 53 54 #endif
··· 10 #ifndef __ASM_ARM_MACH_IRQ_H 11 #define __ASM_ARM_MACH_IRQ_H 12 13 + #include <linux/irq.h> 14 + 15 struct seq_file; 16 17 /* 18 * This is internal. Do not use it. ··· 106 extern void (*init_arch_irq)(void); 107 extern void init_FIQ(void); 108 extern int show_fiq_list(struct seq_file *, void *); 109 110 /* 111 + * Function wrappers 112 */ 113 + #define set_irq_chipdata(irq, d) set_irq_chip_data(irq, d) 114 + #define get_irq_chipdata(irq) get_irq_chip_data(irq) 115 116 + /* 117 + * Obsolete inline function for calling irq descriptor handlers. 118 + */ 119 + static inline void desc_handle_irq(unsigned int irq, struct irq_desc *desc, 120 + struct pt_regs *regs) 121 + { 122 + desc->handle_irq(irq, desc, regs); 123 + } 124 + 125 void set_irq_flags(unsigned int irq, unsigned int flags); 126 127 #define IRQF_VALID (1 << 0) ··· 125 #define IRQF_NOAUTOEN (1 << 2) 126 127 /* 128 + * This is for easy migration, but should be changed in the source 129 */ 130 + #define do_level_IRQ handle_level_irq 131 + #define do_edge_IRQ handle_edge_irq 132 + #define do_simple_IRQ handle_simple_irq 133 + #define irqdesc irq_desc 134 + #define irqchip irq_chip 135 + 136 + #define do_bad_IRQ(irq,desc,regs) \ 137 + do { \ 138 + spin_lock(&desc->lock); \ 139 + handle_bad_irq(irq, desc, regs); \ 140 + spin_unlock(&desc->lock); \ 141 + } while(0) 142 + 143 + extern unsigned long irq_err_count; 144 + static inline void ack_bad_irq(int irq) 145 + { 146 + irq_err_count++; 147 + } 148 149 #endif
+2 -1
include/linux/irq.h
··· 347 /* Checks whether the interrupt can be requested by request_irq(): */ 348 extern int can_request_irq(unsigned int irq, unsigned long irqflags); 349 350 - /* Dummy irq-chip implementation: */ 351 extern struct irq_chip no_irq_chip; 352 353 extern void 354 set_irq_chip_and_handler(unsigned int irq, struct irq_chip *chip,
··· 347 /* Checks whether the interrupt can be requested by request_irq(): */ 348 extern int can_request_irq(unsigned int irq, unsigned long irqflags); 349 350 + /* Dummy irq-chip implementations: */ 351 extern struct irq_chip no_irq_chip; 352 + extern struct irq_chip dummy_irq_chip; 353 354 extern void 355 set_irq_chip_and_handler(unsigned int irq, struct irq_chip *chip,
+12 -3
kernel/irq/chip.c
··· 462 if (!handle) 463 handle = handle_bad_irq; 464 465 - if (is_chained && desc->chip == &no_irq_chip) 466 - printk(KERN_WARNING "Trying to install " 467 - "chained interrupt type for IRQ%d\n", irq); 468 469 spin_lock_irqsave(&desc->lock, flags); 470
··· 462 if (!handle) 463 handle = handle_bad_irq; 464 465 + if (desc->chip == &no_irq_chip) { 466 + printk(KERN_WARNING "Trying to install %sinterrupt handler " 467 + "for IRQ%d\n", is_chained ? "chained " : " ", irq); 468 + /* 469 + * Some ARM implementations install a handler for really dumb 470 + * interrupt hardware without setting an irq_chip. This worked 471 + * with the ARM no_irq_chip but the check in setup_irq would 472 + * prevent us to setup the interrupt at all. Switch it to 473 + * dummy_irq_chip for easy transition. 474 + */ 475 + desc->chip = &dummy_irq_chip; 476 + } 477 478 spin_lock_irqsave(&desc->lock, flags); 479
+29
kernel/irq/handle.c
··· 16 #include <linux/interrupt.h> 17 #include <linux/kernel_stat.h> 18 19 #include "internals.h" 20 21 /** ··· 96 }; 97 98 /* 99 * Special, empty irq handler: 100 */ 101 irqreturn_t no_action(int cpl, void *dev_id, struct pt_regs *regs) ··· 132 { 133 irqreturn_t ret, retval = IRQ_NONE; 134 unsigned int status = 0; 135 136 if (!(action->flags & IRQF_DISABLED)) 137 local_irq_enable();
··· 16 #include <linux/interrupt.h> 17 #include <linux/kernel_stat.h> 18 19 + #if defined(CONFIG_NO_IDLE_HZ) && defined(CONFIG_ARM) 20 + #include <asm/dyntick.h> 21 + #endif 22 + 23 #include "internals.h" 24 25 /** ··· 92 }; 93 94 /* 95 + * Generic dummy implementation which can be used for 96 + * real dumb interrupt sources 97 + */ 98 + struct irq_chip dummy_irq_chip = { 99 + .name = "dummy", 100 + .startup = noop_ret, 101 + .shutdown = noop, 102 + .enable = noop, 103 + .disable = noop, 104 + .ack = noop, 105 + .mask = noop, 106 + .unmask = noop, 107 + .end = noop, 108 + }; 109 + 110 + /* 111 * Special, empty irq handler: 112 */ 113 irqreturn_t no_action(int cpl, void *dev_id, struct pt_regs *regs) ··· 112 { 113 irqreturn_t ret, retval = IRQ_NONE; 114 unsigned int status = 0; 115 + 116 + #if defined(CONFIG_NO_IDLE_HZ) && defined(CONFIG_ARM) 117 + if (!(action->flags & SA_TIMER) && system_timer->dyn_tick != NULL) { 118 + write_seqlock(&xtime_lock); 119 + if (system_timer->dyn_tick->state & DYN_TICK_ENABLED) 120 + system_timer->dyn_tick->handler(irq, 0, regs); 121 + write_sequnlock(&xtime_lock); 122 + } 123 + #endif 124 125 if (!(action->flags & IRQF_DISABLED)) 126 local_irq_enable();