perf_counter: powerpc: add nmi_enter/nmi_exit calls
authorPaul Mackerras <paulus@samba.org>
Thu, 9 Apr 2009 04:42:56 +0000 (14:42 +1000)
committerIngo Molnar <mingo@elte.hu>
Thu, 9 Apr 2009 05:56:08 +0000 (07:56 +0200)
commitca8f2d7f019a8547f39ddb9ed0144932f12807f2
tree6bf7693de5751a305e4233dba288e603de83ff47
parent6c0b324435ff49fb3c68fe808a93853d81c7fb97
perf_counter: powerpc: add nmi_enter/nmi_exit calls

Impact: fix potential deadlocks on powerpc

Now that the core is using in_nmi() (added in e30e08f6, "perf_counter:
fix NMI race in task clock"), we need the powerpc perf_counter_interrupt
to call nmi_enter() and nmi_exit() in those cases where the interrupt
happens when interrupts are soft-disabled.

If interrupts were soft-enabled, we can treat it as a regular interrupt
and do irq_enter/irq_exit around the whole routine. This lets us get rid
of the test_perf_counter_pending() call at the end of
perf_counter_interrupt, thus simplifying things a little.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <18909.31952.873098.336615@cargo.ozlabs.ibm.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/powerpc/kernel/perf_counter.c