aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2005-11-08 21:28:33 -0500
committerStephen Rothwell <sfr@canb.auug.org.au>2005-11-08 21:28:33 -0500
commitb709c0832824da20a32a3119911b9f0cf6970452 (patch)
tree1bf6e461f754aee5dbd870072080b5e5f2c1ee8c
parent66ba135c5a398df5c3a4b43d84d9df80cbc87c61 (diff)
ppc64: move stack switching up in interrupt processing
This will make the ppc64 multiplatform irq handling more like the generic handling. Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
-rw-r--r--arch/powerpc/kernel/misc_64.S8
-rw-r--r--arch/ppc64/kernel/irq.c40
-rw-r--r--arch/ppc64/kernel/misc.S8
-rw-r--r--include/asm-powerpc/irq.h4
4 files changed, 30 insertions, 30 deletions
diff --git a/arch/powerpc/kernel/misc_64.S b/arch/powerpc/kernel/misc_64.S
index ae1433da09b2..9d09f0ad6efe 100644
--- a/arch/powerpc/kernel/misc_64.S
+++ b/arch/powerpc/kernel/misc_64.S
@@ -89,12 +89,12 @@ _GLOBAL(call_do_softirq)
89 mtlr r0 89 mtlr r0
90 blr 90 blr
91 91
92_GLOBAL(call_handle_IRQ_event) 92_GLOBAL(call_ppc_irq_dispatch_handler)
93 mflr r0 93 mflr r0
94 std r0,16(r1) 94 std r0,16(r1)
95 stdu r1,THREAD_SIZE-112(r6) 95 stdu r1,THREAD_SIZE-112(r5)
96 mr r1,r6 96 mr r1,r5
97 bl .handle_IRQ_event 97 bl .ppc_irq_dispatch_handler
98 ld r1,0(r1) 98 ld r1,0(r1)
99 ld r0,16(r1) 99 ld r0,16(r1)
100 mtlr r0 100 mtlr r0
diff --git a/arch/ppc64/kernel/irq.c b/arch/ppc64/kernel/irq.c
index 87474584033f..b61497d5be28 100644
--- a/arch/ppc64/kernel/irq.c
+++ b/arch/ppc64/kernel/irq.c
@@ -157,9 +157,6 @@ void ppc_irq_dispatch_handler(struct pt_regs *regs, int irq)
157 int cpu = smp_processor_id(); 157 int cpu = smp_processor_id();
158 irq_desc_t *desc = get_irq_desc(irq); 158 irq_desc_t *desc = get_irq_desc(irq);
159 irqreturn_t action_ret; 159 irqreturn_t action_ret;
160#ifdef CONFIG_IRQSTACKS
161 struct thread_info *curtp, *irqtp;
162#endif
163 160
164 kstat_cpu(cpu).irqs[irq]++; 161 kstat_cpu(cpu).irqs[irq]++;
165 162
@@ -227,20 +224,7 @@ void ppc_irq_dispatch_handler(struct pt_regs *regs, int irq)
227 for (;;) { 224 for (;;) {
228 spin_unlock(&desc->lock); 225 spin_unlock(&desc->lock);
229 226
230#ifdef CONFIG_IRQSTACKS 227 action_ret = handle_IRQ_event(irq, regs, action);
231 /* Switch to the irq stack to handle this */
232 curtp = current_thread_info();
233 irqtp = hardirq_ctx[smp_processor_id()];
234 if (curtp != irqtp) {
235 irqtp->task = curtp->task;
236 irqtp->flags = 0;
237 action_ret = call_handle_IRQ_event(irq, regs, action, irqtp);
238 irqtp->task = NULL;
239 if (irqtp->flags)
240 set_bits(irqtp->flags, &curtp->flags);
241 } else
242#endif
243 action_ret = handle_IRQ_event(irq, regs, action);
244 228
245 spin_lock(&desc->lock); 229 spin_lock(&desc->lock);
246 if (!noirqdebug) 230 if (!noirqdebug)
@@ -310,6 +294,9 @@ void do_IRQ(struct pt_regs *regs)
310void do_IRQ(struct pt_regs *regs) 294void do_IRQ(struct pt_regs *regs)
311{ 295{
312 int irq; 296 int irq;
297#ifdef CONFIG_IRQSTACKS
298 struct thread_info *curtp, *irqtp;
299#endif
313 300
314 irq_enter(); 301 irq_enter();
315 302
@@ -330,9 +317,22 @@ void do_IRQ(struct pt_regs *regs)
330 317
331 irq = ppc_md.get_irq(regs); 318 irq = ppc_md.get_irq(regs);
332 319
333 if (irq >= 0) 320 if (irq >= 0) {
334 ppc_irq_dispatch_handler(regs, irq); 321#ifdef CONFIG_IRQSTACKS
335 else 322 /* Switch to the irq stack to handle this */
323 curtp = current_thread_info();
324 irqtp = hardirq_ctx[smp_processor_id()];
325 if (curtp != irqtp) {
326 irqtp->task = curtp->task;
327 irqtp->flags = 0;
328 call_ppc_irq_dispatch_handler(regs, irq, irqtp);
329 irqtp->task = NULL;
330 if (irqtp->flags)
331 set_bits(irqtp->flags, &curtp->flags);
332 } else
333#endif
334 ppc_irq_dispatch_handler(regs, irq);
335 } else
336 /* That's not SMP safe ... but who cares ? */ 336 /* That's not SMP safe ... but who cares ? */
337 ppc_spurious_interrupts++; 337 ppc_spurious_interrupts++;
338 338
diff --git a/arch/ppc64/kernel/misc.S b/arch/ppc64/kernel/misc.S
index 914632ec587d..d82a30dc26f8 100644
--- a/arch/ppc64/kernel/misc.S
+++ b/arch/ppc64/kernel/misc.S
@@ -78,12 +78,12 @@ _GLOBAL(call_do_softirq)
78 mtlr r0 78 mtlr r0
79 blr 79 blr
80 80
81_GLOBAL(call_handle_IRQ_event) 81_GLOBAL(call_ppc_irq_dispatch_handler)
82 mflr r0 82 mflr r0
83 std r0,16(r1) 83 std r0,16(r1)
84 stdu r1,THREAD_SIZE-112(r6) 84 stdu r1,THREAD_SIZE-112(r5)
85 mr r1,r6 85 mr r1,r5
86 bl .handle_IRQ_event 86 bl .ppc_irq_dispatch_handler
87 ld r1,0(r1) 87 ld r1,0(r1)
88 ld r0,16(r1) 88 ld r0,16(r1)
89 mtlr r0 89 mtlr r0
diff --git a/include/asm-powerpc/irq.h b/include/asm-powerpc/irq.h
index b3935ea28fff..2a768e096067 100644
--- a/include/asm-powerpc/irq.h
+++ b/include/asm-powerpc/irq.h
@@ -488,8 +488,8 @@ extern struct thread_info *softirq_ctx[NR_CPUS];
488 488
489extern void irq_ctx_init(void); 489extern void irq_ctx_init(void);
490extern void call_do_softirq(struct thread_info *tp); 490extern void call_do_softirq(struct thread_info *tp);
491extern int call_handle_IRQ_event(int irq, struct pt_regs *regs, 491extern int call_ppc_irq_dispatch_handler(struct pt_regs *regs, int irq,
492 struct irqaction *action, struct thread_info *tp); 492 struct thread_info *tp);
493 493
494#define __ARCH_HAS_DO_SOFTIRQ 494#define __ARCH_HAS_DO_SOFTIRQ
495 495