x86/IRQ: fix create_irq() after c/s 24068:6928172f7ded
authorJan Beulich <jbeulich@suse.com>
Fri, 4 Nov 2011 14:55:50 +0000 (15:55 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 4 Nov 2011 14:55:50 +0000 (15:55 +0100)
commit8d1277c729aea7e682ec44307ef5d682ff781154
tree5b4a4067d3d26396e91a648cd4deb194e4ff1e0f
parent66a1a9c38dfc15942ef9eb0c13e26c9deaf2f2d9
x86/IRQ: fix create_irq() after c/s 24068:6928172f7ded

init_one_irq_desc() must be called with interrupts enabled (as it may
call functions from the xmalloc() group). Rather than mis-using
vector_lock to also protect the finding of an unused IRQ, make this
lockless through using cmpxchg(), and obtain the lock only around the
actual assignment of the vector.

Also fold find_unassigned_irq() into its only caller.

It is, btw, questionable whether create_irq() calling
__assign_irq_vector() (rather than assign_irq_vector()) is actually
correct - desc->affinity appears to not get initialized properly in
this case.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen/arch/x86/irq.c
xen/include/asm-x86/irq.h