aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r--arch/powerpc/kernel/irq.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index 292163f5b39..4617b65d464 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -310,8 +310,21 @@ void do_IRQ(struct pt_regs *regs)
310 handler = &__do_IRQ; 310 handler = &__do_IRQ;
311 irqtp->task = curtp->task; 311 irqtp->task = curtp->task;
312 irqtp->flags = 0; 312 irqtp->flags = 0;
313
314 /* Copy the softirq bits in preempt_count so that the
315 * softirq checks work in the hardirq context.
316 */
317 irqtp->preempt_count =
318 (irqtp->preempt_count & ~SOFTIRQ_MASK) |
319 (curtp->preempt_count & SOFTIRQ_MASK);
320
313 call_handle_irq(irq, desc, irqtp, handler); 321 call_handle_irq(irq, desc, irqtp, handler);
314 irqtp->task = NULL; 322 irqtp->task = NULL;
323
324
325 /* Set any flag that may have been set on the
326 * alternate stack
327 */
315 if (irqtp->flags) 328 if (irqtp->flags)
316 set_bits(irqtp->flags, &curtp->flags); 329 set_bits(irqtp->flags, &curtp->flags);
317 } else 330 } else
@@ -357,7 +370,7 @@ void irq_ctx_init(void)
357 memset((void *)softirq_ctx[i], 0, THREAD_SIZE); 370 memset((void *)softirq_ctx[i], 0, THREAD_SIZE);
358 tp = softirq_ctx[i]; 371 tp = softirq_ctx[i];
359 tp->cpu = i; 372 tp->cpu = i;
360 tp->preempt_count = SOFTIRQ_OFFSET; 373 tp->preempt_count = 0;
361 374
362 memset((void *)hardirq_ctx[i], 0, THREAD_SIZE); 375 memset((void *)hardirq_ctx[i], 0, THREAD_SIZE);
363 tp = hardirq_ctx[i]; 376 tp = hardirq_ctx[i];