powerpc/ppc64: Use preempt_schedule_irq instead of preempt_schedule
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Mon, 26 Oct 2009 19:41:17 +0000 (19:41 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 27 Oct 2009 05:42:43 +0000 (16:42 +1100)
commit4f917ba3d5ee9c98d60fa357e799942df8412de3
tree3576261c81b76e74b2372d2221196040a369bb92
parent01deab98e3ad8ff27243a8d5f8dd746c7110ae4f
powerpc/ppc64: Use preempt_schedule_irq instead of preempt_schedule

Based on an original patch by Valentine Barshak <vbarshak@ru.mvista.com>

Use preempt_schedule_irq to prevent infinite irq-entry and
eventual stack overflow problems with fast-paced IRQ sources.

This kind of problems has been observed on the PASemi Electra IDE
controller. We have to make sure we are soft-disabled before calling
preempt_schedule_irq and hard disable interrupts after that
to avoid unrecoverable exceptions.

This patch also moves the "clrrdi r9,r1,THREAD_SHIFT" out of
the #ifdef CONFIG_PPC_BOOK3E scope, since r9 is clobbered
and has to be restored in both cases.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/kernel/entry_64.S