Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ppc64: remove ppc_irq_dispatch_handler

Use __do_IRQ instead. The only difference is that every controller
is now assumed to have an end() routine (only xics_8259 did not).

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>

+12 -118
+2 -2
arch/powerpc/kernel/misc_64.S
··· 89 89 mtlr r0 90 90 blr 91 91 92 - _GLOBAL(call_ppc_irq_dispatch_handler) 92 + _GLOBAL(call___do_IRQ) 93 93 mflr r0 94 94 std r0,16(r1) 95 95 stdu r1,THREAD_SIZE-112(r5) 96 96 mr r1,r5 97 - bl .ppc_irq_dispatch_handler 97 + bl .__do_IRQ 98 98 ld r1,0(r1) 99 99 ld r0,16(r1) 100 100 mtlr r0
+4 -6
arch/powerpc/platforms/iseries/irq.c
··· 120 120 if (curtp != irqtp) { 121 121 irqtp->task = curtp->task; 122 122 irqtp->flags = 0; 123 - call_ppc_irq_dispatch_handler(regsParm, irq, irqtp); 123 + call___do_IRQ(irq, regsParm, irqtp); 124 124 irqtp->task = NULL; 125 125 if (irqtp->flags) 126 126 set_bits(irqtp->flags, &curtp->flags); 127 127 } else 128 128 #endif 129 - ppc_irq_dispatch_handler(regsParm, irq); 129 + __do_IRQ(irq, regsParm); 130 130 HvCallPci_eoi(eventParm->eventData.slotInterrupt.busNumber, 131 131 eventParm->eventData.slotInterrupt.subBusNumber, 132 132 eventParm->eventData.slotInterrupt.deviceId); ··· 326 326 } 327 327 328 328 /* 329 - * Need to define this so ppc_irq_dispatch_handler will NOT call 330 - * enable_IRQ at the end of interrupt handling. However, this does 331 - * nothing because there is not enough information provided to do 332 - * the EOI HvCall. This is done by XmPciLpEvent.c 329 + * This does nothing because there is not enough information 330 + * provided to do the EOI HvCall. This is done by XmPciLpEvent.c 333 331 */ 334 332 static void iSeries_end_IRQ(unsigned int irq) 335 333 {
+1
arch/powerpc/platforms/pseries/xics.c
··· 567 567 568 568 xics_8259_pic.enable = i8259_pic.enable; 569 569 xics_8259_pic.disable = i8259_pic.disable; 570 + xics_8259_pic.end = i8259_pic.end; 570 571 for (i = 0; i < 16; ++i) 571 572 get_irq_desc(i)->handler = &xics_8259_pic; 572 573 for (; i < NR_IRQS; ++i)
+2 -106
arch/ppc64/kernel/irq.c
··· 144 144 } 145 145 #endif 146 146 147 - extern int noirqdebug; 148 - 149 - /* 150 - * Eventually, this should take an array of interrupts and an array size 151 - * so it can dispatch multiple interrupts. 152 - */ 153 - void ppc_irq_dispatch_handler(struct pt_regs *regs, int irq) 154 - { 155 - int status; 156 - struct irqaction *action; 157 - int cpu = smp_processor_id(); 158 - irq_desc_t *desc = get_irq_desc(irq); 159 - irqreturn_t action_ret; 160 - 161 - kstat_cpu(cpu).irqs[irq]++; 162 - 163 - if (desc->status & IRQ_PER_CPU) { 164 - /* no locking required for CPU-local interrupts: */ 165 - ack_irq(irq); 166 - action_ret = handle_IRQ_event(irq, regs, desc->action); 167 - desc->handler->end(irq); 168 - return; 169 - } 170 - 171 - spin_lock(&desc->lock); 172 - ack_irq(irq); 173 - /* 174 - REPLAY is when Linux resends an IRQ that was dropped earlier 175 - WAITING is used by probe to mark irqs that are being tested 176 - */ 177 - status = desc->status & ~(IRQ_REPLAY | IRQ_WAITING); 178 - status |= IRQ_PENDING; /* we _want_ to handle it */ 179 - 180 - /* 181 - * If the IRQ is disabled for whatever reason, we cannot 182 - * use the action we have. 183 - */ 184 - action = NULL; 185 - if (likely(!(status & (IRQ_DISABLED | IRQ_INPROGRESS)))) { 186 - action = desc->action; 187 - if (!action || !action->handler) { 188 - ppc_spurious_interrupts++; 189 - printk(KERN_DEBUG "Unhandled interrupt %x, disabled\n", irq); 190 - /* We can't call disable_irq here, it would deadlock */ 191 - if (!desc->depth) 192 - desc->depth = 1; 193 - desc->status |= IRQ_DISABLED; 194 - /* This is not a real spurrious interrupt, we 195 - * have to eoi it, so we jump to out 196 - */ 197 - mask_irq(irq); 198 - goto out; 199 - } 200 - status &= ~IRQ_PENDING; /* we commit to handling */ 201 - status |= IRQ_INPROGRESS; /* we are handling it */ 202 - } 203 - desc->status = status; 204 - 205 - /* 206 - * If there is no IRQ handler or it was disabled, exit early. 207 - Since we set PENDING, if another processor is handling 208 - a different instance of this same irq, the other processor 209 - will take care of it. 210 - */ 211 - if (unlikely(!action)) 212 - goto out; 213 - 214 - /* 215 - * Edge triggered interrupts need to remember 216 - * pending events. 217 - * This applies to any hw interrupts that allow a second 218 - * instance of the same irq to arrive while we are in do_IRQ 219 - * or in the handler. But the code here only handles the _second_ 220 - * instance of the irq, not the third or fourth. So it is mostly 221 - * useful for irq hardware that does not mask cleanly in an 222 - * SMP environment. 223 - */ 224 - for (;;) { 225 - spin_unlock(&desc->lock); 226 - 227 - action_ret = handle_IRQ_event(irq, regs, action); 228 - 229 - spin_lock(&desc->lock); 230 - if (!noirqdebug) 231 - note_interrupt(irq, desc, action_ret, regs); 232 - if (likely(!(desc->status & IRQ_PENDING))) 233 - break; 234 - desc->status &= ~IRQ_PENDING; 235 - } 236 - out: 237 - desc->status &= ~IRQ_INPROGRESS; 238 - /* 239 - * The ->end() handler has to deal with interrupts which got 240 - * disabled while the handler was running. 241 - */ 242 - if (desc->handler) { 243 - if (desc->handler->end) 244 - desc->handler->end(irq); 245 - else if (desc->handler->enable) 246 - desc->handler->enable(irq); 247 - } 248 - spin_unlock(&desc->lock); 249 - } 250 - 251 147 #ifdef CONFIG_PPC_ISERIES 252 148 void do_IRQ(struct pt_regs *regs) 253 149 { ··· 221 325 if (curtp != irqtp) { 222 326 irqtp->task = curtp->task; 223 327 irqtp->flags = 0; 224 - call_ppc_irq_dispatch_handler(regs, irq, irqtp); 328 + call___do_IRQ(irq, regs, irqtp); 225 329 irqtp->task = NULL; 226 330 if (irqtp->flags) 227 331 set_bits(irqtp->flags, &curtp->flags); 228 332 } else 229 333 #endif 230 - ppc_irq_dispatch_handler(regs, irq); 334 + __do_IRQ(irq, regs); 231 335 } else 232 336 /* That's not SMP safe ... but who cares ? */ 233 337 ppc_spurious_interrupts++;
+2 -2
arch/ppc64/kernel/misc.S
··· 78 78 mtlr r0 79 79 blr 80 80 81 - _GLOBAL(call_ppc_irq_dispatch_handler) 81 + _GLOBAL(call___do_IRQ) 82 82 mflr r0 83 83 std r0,16(r1) 84 84 stdu r1,THREAD_SIZE-112(r5) 85 85 mr r1,r5 86 - bl .ppc_irq_dispatch_handler 86 + bl .__do_IRQ 87 87 ld r1,0(r1) 88 88 ld r0,16(r1) 89 89 mtlr r0
-1
include/asm-powerpc/hw_irq.h
··· 12 12 #include <asm/processor.h> 13 13 14 14 extern void timer_interrupt(struct pt_regs *); 15 - extern void ppc_irq_dispatch_handler(struct pt_regs *regs, int irq); 16 15 17 16 #ifdef CONFIG_PPC_ISERIES 18 17
+1 -1
include/asm-powerpc/irq.h
··· 488 488 489 489 extern void irq_ctx_init(void); 490 490 extern void call_do_softirq(struct thread_info *tp); 491 - extern int call_ppc_irq_dispatch_handler(struct pt_regs *regs, int irq, 491 + extern int call___do_IRQ(int irq, struct pt_regs *regs, 492 492 struct thread_info *tp); 493 493 494 494 #define __ARCH_HAS_DO_SOFTIRQ