metag: kick: add missing irq_enter/exit to kick_handler()
authorJames Hogan <james.hogan@imgtec.com>
Mon, 1 Jul 2013 12:44:10 +0000 (13:44 +0100)
committerJames Hogan <james.hogan@imgtec.com>
Tue, 2 Jul 2013 13:12:08 +0000 (14:12 +0100)
commitf6b30d32d242243a967993789c4cf550d840727e
tree95369d42eb77261e5f31b7908ee97af9e2f6a73e
parent9649814432faa9016952895684120942da0d8481
metag: kick: add missing irq_enter/exit to kick_handler()

kick_handler() doesn't have an irq_enter/exit pair, but it's used for
handling SMP IPIs which require work to be done in softirqs, which are
invoked from irq_exit() when the hard irq nest count reaches 0.

The scheduler_ipi() callback in the IPI handler calls irq_enter/exit
itself, but this is inside kick_handler()'s spin lock critical section,
so if an invoked softirq issues an IPI the kick_handler() will be
re-entered on the same CPU and will deadlock.

This is easily fixed by adding the missing irq_enter/exit to
kick_handler() so that the hard irq nest count doesn't reach 0 until
after the spin lock has been released.

Ideally the spin lock protected handler list will also be replaced by a
lockless RCU protected list since it is certainly mostly read. That can
be done in a later change though.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
arch/metag/kernel/kick.c